Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Oct 2015 18:04:27 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Bryan Drewery <bdrewery@FreeBSD.org>
Cc:        NGie Cooper <yaneurabeya@gmail.com>, Garrett Cooper <ngie@FreeBSD.org>, src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   Re: 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...
Message-ID:  <B42ED4B5-6174-43BF-85E3-8A2E57B41986@bsdimp.com>
In-Reply-To: <5622D517.5000606@FreeBSD.org>
References:  <201510172138.t9HLcwiF095174@repo.freebsd.org> <5622D147.7050701@FreeBSD.org> <542455B8-3355-497A-B667-AF72C197B9A4@gmail.com> <5622D243.5020603@FreeBSD.org> <E18978A9-A86A-4F06-A07C-D79CD91A4F9A@gmail.com> <5622D517.5000606@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]

> On Oct 17, 2015, at 5:09 PM, Bryan Drewery <bdrewery@FreeBSD.org> wrote:
> 
> On 10/17/15 4:04 PM, NGie Cooper wrote:
>> 
>>> On Oct 17, 2015, at 15:57, Bryan Drewery <bdrewery@FreeBSD.org> wrote:
>>> 
>>> On 10/17/15 3:56 PM, NGie Cooper wrote:
>>>> 
>>>>> On Oct 17, 2015, at 15:52, Bryan Drewery <bdrewery@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


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJWIuILAAoJEGwc0Sh9sBEAqKcP+wXoAPhJkPUQ9fw1JhnUpi1U
+LgQUOBE6NsAPnwwcn0kvHWC1qPaYQFpHNOVnXZN/o6RitKxBRivOvesHa+/gPKG
vQ99zzBjxj3dEnVzsDadFjvwOKB1qHMwO/Sko/S4i65veXndIcqa/22H7SQgsHdl
+suUTuieCRst9U9sVC7zbJgCWRLbgu/dDkNr+2WLupdCWm30kyiF1jvT6dzxISsw
HCgW6AoWsZKPq10ZJ1X8MHRXjFSZaigQZZ1w6qBY9kLyMvt3Mlm6Vrlxdrop1S8u
dD7uWp1Jq4u57rWnQC46nNAzqmz0Z98IBmAtOMUk1gEIipeYpvPKwh053Pb9fcgB
9JUX9fEZPJNHW/s0XO0r5FdnJa17/TKL3KXigzlHuTCevdBsGogcoj87LIgx8HhV
3ZRcqptWuLv7aR+AK0Tnke/rJ24aZO7WTKqN2ef1i2LGu44B5bXTonZwftNclArv
JNvDTrKdXTFOiBrnd+IFZLLzLfutIZkxHDxVjK4mPGS+QUrrF6NY2ZLztbttfZTE
Rv0GFfETvmNQVYoiPBF/j4JIV9F3mNFN7SB1Lv4nha1pou3oSI60yWO6/G3wZqYU
RUumx0eMPKOPiXGJJkfkJWj81nflC2XG7bxTefIou/RVNNnQ5q5EUhggSLcC+auM
hdy+dgWcE3woWqkm5N28
=89MV
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B42ED4B5-6174-43BF-85E3-8A2E57B41986>