How do I determine the fastest link order?

前端 未结 4 626
小蘑菇
小蘑菇 2021-02-01 14:14

I have about 50 different static libraries being linked into my c++ project and the linking takes on average 70s.

I\'ve found that moving around with the link order of

4条回答
  •  春和景丽
    2021-02-01 14:38

    In the past, the order of objects in a static library was important. You can sort the objects accordingly with:

    $ lorder *.o | tsort

    Maybe you could do the same with your main objects and libraries, e.g. lorder main.o test.o libsome.a libthing.a | tsort. Look at man lorder

提交回复
热议问题