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: [RESEND][PATCH] ld: -rpath must search under sysroot

On Monday 22 October 2012 01:29:59 Alan Modra wrote:
> On Wed, Sep 12, 2012 at 11:20:48AM -0700, Andy Ross wrote:
> > The -rpath argument would search the host filesystem for libraries,
> > even when a sysroot was defined.  For cross toolchains with targets
> > compatible with the host architecture this can find incorrect
> > libraries.  Leave -rpath-link unmodified, as build systems in the wild
> > are already using this to point to host directories.
> I agree that your patch makes sense, but I hesitate to apply the
> change for two reasons:
> a) It's odd to have -rpath add the sysroot but -rpath-link not do so.

agreed.  we should update -rpath-link to search the sysroot too.

> b) I wonder how many people already add the sysroot to their -rpath
> argument, and would have their builds broken by this change.

i think we already have that problem since gold is behaving the correct way.

i'm also not sure who would actually be relying on this behavior.  i'd hazard 
a guess that the vast majority of people using a sysroot are cross-compiling 
which means the host paths contain incompatible formats.

in the case where they're linking code with the full sysroot path in -rpath 
(which doesn't make much sense in the first place since the sysroot path 
generally has no meaning in the target system), it's trivial for them to add a 
-L flag to the full sysroot path, and doing so would be backwards compatible.

i think the cases where people are doing it The Right Way are much more common 
than people doing it the wrong way.  especially since people doing the right 
way have no recourse (other than to not use -rpath) while people doing the 
wrong way do (just add -L).

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]