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 Wed, May 27, 2009 at 08:46:39AM +0200, Sven Rebhan wrote:
> Please CC me as I'm not subscribed to the list!
> 
> Hello List,
> 
> while cross-compiling a Gentoo Linux system for an arm architecture I noticed
> that in some cases the sysroot prefix is not prepended to absolute library path.
> This especially can be seen after adding some debugging to  ldfile.c line 311.
> For linking a simple C program "int main(void) { return 0; }" you see that the
> entry->sysrooted flag is set to TRUE while the filename to link is
> "/lib/libc.so.6".
> The toolchain sysroot is /usr/armv4tl-softfloat-linux-gnueabi. In the
> following the
> sysroot prefix gets prepended. However, in my interpretation the sysroot prefix
> should have been prepended before if  entry->sysrooted == TRUE!?

You didn't say how you configured the linker, or how you invoked it,
so it's hard to answer you.

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.

> When linking against the following linker script
> 
> OUTPUT_FORMAT ( elf32-littlearm )
> GROUP ( /lib/libusb.so )
> 
> you get a entry->sysrooted == FALSE and filename == "/lib/libusb.so" in the
> following the prefix gets not prepended as  entry->sysrooted == FALSE which
> leads to sever problems during cross-compilation.

This script is only going to work if it's linked to from *inside* the
sysroot.  If it is, sysrooted should be TRUE already.

-- 
Daniel Jacobowitz
CodeSourcery


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