On Sun, 7 Nov 2021 20:11:52 +0000
Stuart Henderson <[email protected]> wrote:
> On 2021/11/07 12:14, Kurt Miller wrote:
> > Yes adding -L/usr/X11R6/lib allows them to link, but the question is
> > why is it necessary when the libs ld claims it can’t find are explicitly
> > listed in the list of libs with full paths to find them?
>
> I'm not sure of the reason, but there are a number of other
> -L/usr/X11R6/lib across the tree, some of which are because of this
> problem on ld.bfd archs (and others are "normal" because we don't
> have /usr/X11R6/lib in the standard search path).
amd64$ readelf -d /usr/X11R6/lib/libxcb.so.4.1
Dynamic section at offset 0x2c690 contains 20 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libXau.so.10.0]
0x0000000000000001 (NEEDED) Shared library: [libXdmcp.so.11.0]
...
I believe that ld.lld ignores DT_NEEDED libs, but ld.bfd opens them
and adds them to the link. ld has the full path to libxcb, but
doesn't know where to look for DT_NEEDED libXau and libXdmcp, unless
we pass -L/usr/X11R6/lib
At runtime, ld.so(1) will find DT_NEEDED libs in /usr/X11R6/lib,
because rc(8) had passed the dir to ldconfig(8).
--George