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 Wednesday 27 May 2009 12:02:50 Daniel Jacobowitz wrote:
> On Wed, May 27, 2009 at 08:46:39AM +0200, Sven Rebhan wrote:
> > 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.

all Gentoo cross-compilers have sysroot set to /usr/$CTARGET (where in this 
case, $CTARGET is armv4tl-softfloat-linux-gnueabi).

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

some people think that the paths found in linker scripts should always get 
sysrooted when they're absolute regardless of them being inside the sysroot.  
i dont personally care -- i know both methods have drawbacks and that forcing 
sysroot paths all the time can break things.
-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]