This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 0/6] Allow a first "=" to mean sysroot for all paths in linker-scripts
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: binutils at sourceware dot org
- Cc: nickc at redhat dot com
- Date: Thu, 9 Oct 2014 04:54:48 +0200
- Subject: [PATCH 0/6] Allow a first "=" to mean sysroot for all paths in linker-scripts
- Authentication-results: sourceware.org; auth=none
> From: Nicholas Clifton <nickc@redhat.com>
> 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
<http://sourceware.org/ml/binutils/2014-05/msg00222.html> 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 libc.so, like
GROUP ( =/lib/libc.so.6 =/lib/libc_nonshared.a AS_NEEDED ( =/lib/ld.so.1 ) )
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