svn commit: r289471 - in user/ngie/bug203673: bin/df bin/ls bin/ps lib/libxo lib/libxo/tests lib/libxo/tests/encoder libexec/ftpd sbin/savecore share/mk usr.bin/iscsictl usr.bin/netstat usr.bin/pro...

Warner Losh imp at bsdimp.com
Sun Oct 18 00:04:31 UTC 2015


> On Oct 17, 2015, at 5:09 PM, Bryan Drewery <bdrewery at FreeBSD.org> wrote:
> 
> On 10/17/15 4:04 PM, NGie Cooper wrote:
>> 
>>> On Oct 17, 2015, at 15:57, Bryan Drewery <bdrewery at FreeBSD.org> wrote:
>>> 
>>> On 10/17/15 3:56 PM, NGie Cooper wrote:
>>>> 
>>>>> On Oct 17, 2015, at 15:52, Bryan Drewery <bdrewery at FreeBSD.org> wrote:
>>>>> 
>>>>> On 10/17/15 2:38 PM, Garrett Cooper wrote:
>>>>>> -LIBADD=	xo util
>>>>>> +LIBADD=	util xo
>>>>> 
>>>>> Woops!
>>>> 
>>>> It’s intentional. I sorted the lists alphabetically and in doing so also made it more apparent that libxo isn’t the one pull in libutil by accident :) (someone went and added libxo before libutil everywhere so it was hard to know who needed libutil as a first order dependency instead of as a side-effect of libxo).
>>>> 
>>>> I’ll change the final commit message to reflect that.
>>>> 
>>>> Thanks for the pointers earlier :).
>>>> 
>>> 
>>> Do keep in mind that ordering can be significant for linking.
>> 
>> How? As far as the final object size, the time it takes to link the objects, ...?
>> 
> 
> If two libraries provide the same symbols. For example r265003. Easily
> sen with libmd and libcrypto too if I remember right.

Also consider libA and libB. Lib B calls something in lib A. If nothing in the main program calls it, and it is in its own .o, then that .o won’t get pulled in from the .a, so the symbol won’t get resolved. This is very definitely true for static libraries. The rules for dynamic are different, but then Bryan’s example applies.

Order matters. Don’t alphabetize just for “neatness” sake.

Warner

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/svn-src-user/attachments/20151017/82174b5e/attachment.bin>


More information about the svn-src-user mailing list