This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Linker script and dependency search path


Hi,

Mike Frysinger <vapier@gentoo.org> writes:

> On Wednesday 19 May 2010 03:14:53 Ludovic CourtÃs wrote:
>> Adding -L/path/to/libc, or LIBRARY_PATH=/path/to/libc, or adding
>> /path/to/libc to the RUNPATH of libc.so.0* doesnât solve the problem
>> (libhurduser and libmachuser are in the same directory as libc.so.)
>
> are you not using sysroots ?

No.

>> So, is ld supposed to honor RUNPATH from libc.so.0*, given that this
>> shared library is only referenced from a âGROUPâ command in libc.so?
>> What are the search paths used for dependencies of shared libraries
>> mentioned in a âGROUPâ command?
>
> i dont think so.  if you didnt want to use sysroots for some weird reason, an 
> alternative might be to use the full path in the linker script.

Yes, thatâs what I ended up doing.

Hans-Peter Nilsson <hp@bitrange.com> writes:

> On Wed, 19 May 2010, Ludovic CourtÃs wrote:
>> While building the final cross-GCC, linking fails because the cross ld
>> cannot find libhurduser.so and libmachuser.so, leading to undefined
>> references in libc.so.0*.
>>
>> Adding -L/path/to/libc, or LIBRARY_PATH=/path/to/libc, or adding
>> /path/to/libc to the RUNPATH of libc.so.0* doesn?t solve the problem
>> (libhurduser and libmachuser are in the same directory as libc.so.)
>
> You're looking for -rpath-link; cf. ld.info.

Yes, but thatâs inconvenient for the libc itself: I find it more
convenient if linking with glibc just works without passing additional
flags (as on GNU/Linux), and augmenting the linker script does that
nicely.

In the meantime I noticed that the ld manual explicitly mentions that
RUNPATH is not honored by cross-linkers (info "(ld) Options").

Thanks for your answers,
Ludoâ.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]