bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/29288] Dependent libraries cannot be found with default sysroot


From: amodra at gmail dot com
Subject: [Bug ld/29288] Dependent libraries cannot be found with default sysroot search dir and rpath using cross ld
Date: Thu, 30 Jun 2022 01:37:55 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=29288

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #7 from Alan Modra <amodra at gmail dot com> ---
sysroot and rpath are complicated, and can be difficult to get right.  If using
sysroot you have a linker that has access to your entire file system, but
default searches should be as if the linker was chroot'd at the sysroot.

BFD ld adds the sysroot to absolute paths in rpath when searching for shared
library dependencies, ie. libraries not mentioned on the command line but found
in DT_NEEDED entries of other libraries.  If you accept that linking against
libraries not mentioned on the command line is a good thing (debatable), then
emulating the run-time loader is necessary.  Note that gold doesn't go
searching for library dependencies, hence the gold difference.

I don't believe BFD ld prefixes -rpath paths with the sysroot in other
circumstances.  (You definitely would not want the sysroot prefix added to
DT_NEEDED in executables you create, since they then would have the wrong paths
if copied over to a native environment.)

BFD ld also replaces an initial "=" or "$SYSROOT" in any -L or other
paths with the sysroot.  If configured with a sysroot, the default
library search paths have the "=" prefix.  eg. "=/usr/lib" and "=/lib".

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]