[RFC] ld sysroot prefix handling

Sven Rebhan odinshorse@googlemail.com
Thu May 28 09:11:00 GMT 2009


2009/5/28 Mike Frysinger <vapier@gentoo.org>:
> along those lines, i'm assuming this works:
> armv4tl-softfloat-linux-gnueabi-gcc test.c -lusb
>
> but this fails:
> armv4tl-softfloat-linux-gnueabi-gcc test.c /usr/armv4tl-softfloat-linux-
> gnueabi/usr/lib/libusb.so

Exactly. I have not tested this exact example (will do this evening),
but that's what you observe when compiling programs using libtool.
Nevertheless, I will test this case in about 9h.

>> The problem is _not_ the search path, but only the case where an
>> absolute path to a library is specified (as it is often done by
>> libtool for example).
>
> that wasnt really communicated in original e-mail ... i thought the same as
> Daniel in that what you were talking about was crazy talk

Yeah, sorry about that. As English is not my mother tongue it was
difficult to describe for me. Again, the problem exists only for
absolute paths and shows only while linking against ld-scripts. In the
case of a real lib the two errors (entry->sysrooted set, but sysroot
not prepended and the prepending of sysroot when entry->sysrooted is
set) eliminate each other.

> any changes proposed have to not break full paths outside of the sysroot.
> i.e. something like:
> cd ~/
> mkdir lib/scripts
> echo "GROUP ( $PWD/lib/libfoo.so )" > lib/scripts/libfoo.so
> <make a library at lib/libfoo.so>
> armv4tl-softfloat-linux-gnueabi-gcc -Llib/scripts -lfoo ....

This is handled correctly in the searchpath add  procedure (sorry
don't have the code right now). However, if you compile with
armv4tl-softfloat-linux-gnueabi-gcc ...
${ABSOLUTE_PATH_TO_LD_SCRIPT}/libfoo.so it should fail. Again, the bug
only occures in the absolute filename case in combination with linker
scripts. Sorry if I wasn't clear about this...

Sven



More information about the Binutils mailing list