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]

[PATCH 0/6] Allow a first "=" to mean sysroot for all paths in linker-scripts

> From: Nicholas Clifton <>
> Date: Mon, 9 Jun 2014 15:56:22 +0200

> Hi Hans-Peter,
> > Is there a reason not to allow a first character '=' to mean
> > sysroot-prefix for all paths inside linker scripts?
> No...
> > So again, how about treating "=" as the sysroot prefix for
> > *all* paths in linker scripts?
> A good idea - please submit a patch.
> > What to do about quoted paths?
> > (I suggest both quoted and unquoted "="-prefixed paths to work.)
> Hmm, I can think of no situation where a user would want to use = as a 
> valid first character of a real filepath, so quoted and unquoted 
> prefixes are fine.

So, here we go, a patch-set to implement this.  I haven't done
the same for gold though.  I had a brief look: it appears it
doesn't currently support a "=" as in SEARCH_DIR("=/file/path")
so at least it's not inconsistent. :)

Again, the automatic and context-sensitive semantics of naked
absolute paths for sysrooted configurations may look like a
feature but can actually pick up the wrong files.  See
<> for
original RFC.

Hopefully after this, the glibc project can consider
autoconf-checking if the linker being used supports a "=" prefix
and then always prefix that in its, like
 GROUP ( =/lib/ =/lib/libc_nonshared.a  AS_NEEDED ( =/lib/ ) )
as this'll work for both sysrooted and non-sysrooted
configurations.  The default sysroot for the *linker* is "" (and
then that's also the only supported option to --sysroot).

(I also have a glimmer of a hope that some day cross-toolchains
will default to have sysroot enabled with a value like
<prefix>/<triplet>/sys-root, so you'd have sane semantics when
linking dynamically and with no need to pass configure options
other than --target and --prefix.)

brgds, H-P

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