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: Default linker library search paths


Hi,

On Tue, Sep 29, 2009 at 08:09:02PM -0400, Mike Frysinger wrote:

> binutils configured sanely is often configured to be relocatable, so the exact 
> location of the tools really shouldnt matter as it'll find the system libs on 
> the fly just fine

How does this interact with --sysroot?

As far as I've understood, gcc passes this argument down to the linker;
this might be a solution for the GP if he uses a sysroot capable linker.

With stuff like multiarch coming up in distributions, the situation is
bound to become more complicated though. At the Debian Conference this
year, we had a lengthy discussion on sysroot and multiarch, and so far,
it looks as if it would be best to treat them as orthogonal.

That is, the native compiler looks into

/usr/include/$host_alias            (multiarch)
/usr/local/include/$host_alias      (multiarch)
/usr/include                        (standard)
/usr/local/include                  (standard)

for includes and s/include/lib/ for libraries.

Cross compilers are expected to search

/usr/include/$target_alias          (multiarch)
/usr/local/include/$target_alias    (multiarch)
/usr/$target_alias/include          (standard)
/usr/local/$target_alias/include    (standard)

With --sysroot, the sysroot prefix is prepended to this path.

These two features are independent because it must be possible to point
sysroot at an installation that uses multiarch.

As it is probably not a good idea to move the library path setup from ld
to gcc because people have somewhat grown to assume that "ld ... -lc"
works, I wonder if it would make sense to have a central mechanism to
populate the path list for both gcc and binutils from a single place.

   Simon


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