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: [RFC] ld sysroot prefix handling


On Thursday 28 May 2009 03:19:38 Sven Rebhan wrote:
> 2009/5/27 Daniel Jacobowitz <drow@false.org>:
> linker script:
> /usr/armv4tl-softfloat-linux-gnueabi/usr/lib/libusb.so
> OUTPUT_FORMAT ( elf32-littlearm )
> GROUP ( /lib/libusb.so )
>
> When compiling the test C program with:
>
> armv4tl-softfloat-linux-gnueabi-gcc test.c
>
> I get entry->sysrooted == TRUE and entry->filename == "/lib/libc.so.6" and
> the program compiles.
>
> When I try to do an
>
> armv4tl-softfloat-linux-gnueabi-ld --verbose -T
> /usr/armv4tl-softfloat-linux-gnueabi/usr/lib/libusb.so
>
> I get entry->sysrooted == FALSE and entry->filename ==
> "/lib/libusb.so" and the file is not found as libusb.so is not
> installed on host but installed in
>  /usr/armv4tl-softfloat-linux-gnueabi/lib/libusb.so.

hrm, this sounds like a bug in ld to me and is probably triggered by libtool 
script processing.  non-libtool builds would use -l/-L majority of the time.

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

> > I believe that library search directories have the sysroot in their name
> > field, but files initially don't.  Then ldfile_open_file_search adds it.
>
> 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

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 ....

it should not prefix the sysroot to this path.

> > This script is only going to work if it's linked to from *inside* the
> > sysroot.  If it is, sysrooted should be TRUE already.
>
> I dunno if it is relevant, but gentoo builds its packages in
> /tmp/portage/$PACKAGENAME/work/PACKAGENAME in my case.

the location of the source should not matter in any way
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


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