This is the mail archive of the 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: ld doesn't relocate sysroot if called as tooldir/bin/ld

On Wed, Feb 26, 2003 at 03:42:53AM -0300, Alexandre Oliva wrote:
> On Feb 20, 2003, Daniel Jacobowitz <drow at mvista dot com> wrote:
> > On Thu, Feb 20, 2003 at 07:10:06AM -0300, Alexandre Oliva wrote:
> >> What would people think of arranging for pathnames in linker
> >> scripts within the sysroot to have the sysroot pathname prepended
> >> to them?  This would solve the main problem of relocating a cross
> >> toolchain with a glibc sysroot, because the glibc linker scripts
> >> reference full pathnames in the real root.  Comments?
> > Oooh.  I love it.  That'd kill one of the last truly gross hacks in my
> > cross tool setup.
> /me loves killing truly gross hacks :-)
> Ok to install?

> Index: ld/ChangeLog
> from  Alexandre Oliva  <aoliva at redhat dot com>
> 	* ldfile.h (struct search_dirs): Added sysrooted field.
> 	* ldlang.h (struct lang_input_statement_struct): Likewise.
> 	* ldfile.c (ldfile_add_library_path): Mark sysrooted paths.
> 	(ldfile_open_file_search): Look for sysrooted filename
> 	starting with / in ld_sysroot first.  Clear sysrooted flag if
> 	it's found in the current directory.  Set it from the
> 	search directory's sysrooted flag where it is found otherwise.

May I recommend a slightly different behavior?  It looks like, given
"GROUP ( /lib/ /usr/lib/libc_nonshared.a )", your patch will
search for $sysroot/lib/ and fall back to /lib/  I'd
rather it only searched the $sysroot'd version - that's how GCC does

Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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