* Allow sysroots to be relocated under $prefix as well as $exec_prefix
@ 2007-05-02 10:32 Richard Sandiford
2007-05-11 18:05 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: Richard Sandiford @ 2007-05-02 10:32 UTC (permalink / raw)
To: gcc-patches, binutils, gdb-patches
--exec-prefix is useful if you want to install toolchains for two hosts
(but the same target) side-by-side. The toolchains can then share various
files, thus reducing the install footprint.
If you're using a sysroot, you'll probably want to share that sysroot
between hosts. Thus if you're putting the sysroot in the install tree,
you'll probably want to put it in something relative to --prefix rather
than something relative to --exec-prefix.
Unfortunately, the current configure code only treats sysroots as
relocatable if they are subdirectories of --exec-prefix. This seems
to be academic in the case of ld and gdb; they don't seem to take any
notice of TARGET_SYSTEM_ROOT_RELOCATABLE anyway. (ld relies on the
relocation performed by the gcc driver.) However, the gcc driver can
relocate sysroots in --prefix just as easily as those in --exec-prefix;
no driver changes are needed. The configure check therefore seems
unnecessarily restrictive.
This patch makes configure treat sysroots as relocatable if they are
under either --prefix or --exec-prefix. I've updated the ld and gdb
versions to keep them in sync.
Bootstrapped & regression-tested on x86_64-linux-gnu. Also tested
on a sysrooted mips-linux-gnu compiler. OK to install?
Richard
gcc/
* configure.ac: Allow sysroots to be relocated under $prefix as
well as $exec_prefix.
* configure: Regenerate.
ld/
* configure.in: Allow sysroots to be relocated under $prefix as
well as $exec_prefix.
* configure: Regenerate.
gdb/
* configure.ac: Allow sysroots to be relocated under $prefix as
well as $exec_prefix.
* configure: Regenerate.
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac (revision 124214)
+++ gcc/configure.ac (working copy)
@@ -787,17 +787,20 @@ AC_ARG_WITH(sysroot,
TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$${sysroot_headers_suffix}$(NATIVE_SYSTEM_HEADER_DIR)'
+ if test "x$prefix" = xNONE; then
+ test_prefix=/usr/local
+ else
+ test_prefix=$prefix
+ fi
if test "x$exec_prefix" = xNONE; then
- if test "x$prefix" = xNONE; then
- test_prefix=/usr/local
- else
- test_prefix=$prefix
- fi
+ test_exec_prefix=$test_prefix
else
- test_prefix=$exec_prefix
+ test_exec_prefix=$exec_prefix
fi
case ${TARGET_SYSTEM_ROOT} in
"${test_prefix}"|"${test_prefix}/"*|\
+ "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
+ '${prefix}'|'${prefix}/'*|\
'${exec_prefix}'|'${exec_prefix}/'*)
t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
TARGET_SYSTEM_ROOT_DEFINE="$t"
Index: gcc/configure.ac
===================================================================
--- ld/configure.in (revision 124214)
+++ ld/configure.in (working copy)
@@ -787,17 +787,20 @@ AC_ARG_WITH(sysroot,
TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
use_sysroot=yes
+ if test "x$prefix" = xNONE; then
+ test_prefix=/usr/local
+ else
+ test_prefix=$prefix
+ fi
if test "x$exec_prefix" = xNONE; then
- if test "x$prefix" = xNONE; then
- test_prefix=/usr/local
- else
- test_prefix=$prefix
- fi
+ test_exec_prefix=$test_prefix
else
- test_prefix=$exec_prefix
+ test_exec_prefix=$exec_prefix
fi
case ${TARGET_SYSTEM_ROOT} in
"${test_prefix}"|"${test_prefix}/"*|\
+ "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
+ '${prefix}'|'${prefix}/'*|\
'${exec_prefix}'|'${exec_prefix}/'*)
t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
TARGET_SYSTEM_ROOT_DEFINE="$t"
Index: gdb/configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.44
diff -u -p -r1.44 configure.ac
--- gdb/configure.ac 11 Apr 2007 18:36:50 -0000 1.44
+++ gdb/configure.ac 2 May 2007 10:10:06 -0000
@@ -1121,17 +1121,20 @@ AC_ARG_WITH(sysroot,
TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
+ if test "x$prefix" = xNONE; then
+ test_prefix=/usr/local
+ else
+ test_prefix=$prefix
+ fi
if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
- if test "x$prefix" = xNONE; then
- test_prefix=/usr/local
- else
- test_prefix=$prefix
- fi
+ test_exec_prefix=$test_prefix
else
- test_prefix=$exec_prefix
+ test_exec_prefix=$exec_prefix
fi
case ${TARGET_SYSTEM_ROOT} in
"${test_prefix}"|"${test_prefix}/"*|\
+ "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
+ '${prefix}'|'${prefix}/'*|\
'${exec_prefix}'|'${exec_prefix}/'*)
t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
TARGET_SYSTEM_ROOT_DEFINE="$t"
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Allow sysroots to be relocated under $prefix as well as $exec_prefix
2007-05-02 10:32 Allow sysroots to be relocated under $prefix as well as $exec_prefix Richard Sandiford
@ 2007-05-11 18:05 ` Daniel Jacobowitz
2007-05-12 8:23 ` Richard Sandiford
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-05-11 18:05 UTC (permalink / raw)
To: gcc-patches, binutils, gdb-patches, richard
On Wed, May 02, 2007 at 11:32:18AM +0100, Richard Sandiford wrote:
> Unfortunately, the current configure code only treats sysroots as
> relocatable if they are subdirectories of --exec-prefix. This seems
> to be academic in the case of ld and gdb; they don't seem to take any
> notice of TARGET_SYSTEM_ROOT_RELOCATABLE anyway. (ld relies on the
> relocation performed by the gcc driver.)
GDB definitely does honor TARGET_SYSTEM_ROOT_RELOCATABLE. ld does too
(get_relative_sysroot in ldmain.c).
> This patch makes configure treat sysroots as relocatable if they are
> under either --prefix or --exec-prefix. I've updated the ld and gdb
> versions to keep them in sync.
>
> Bootstrapped & regression-tested on x86_64-linux-gnu. Also tested
> on a sysrooted mips-linux-gnu compiler. OK to install?
LD and GDB parts are OK. I think the GCC part is sufficiently
obvious, or else ping Paolo.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Allow sysroots to be relocated under $prefix as well as $exec_prefix
2007-05-11 18:05 ` Daniel Jacobowitz
@ 2007-05-12 8:23 ` Richard Sandiford
2007-05-14 0:17 ` Mark Mitchell
0 siblings, 1 reply; 4+ messages in thread
From: Richard Sandiford @ 2007-05-12 8:23 UTC (permalink / raw)
To: gcc-patches; +Cc: binutils, gdb-patches
Daniel Jacobowitz <drow@false.org> writes:
> On Wed, May 02, 2007 at 11:32:18AM +0100, Richard Sandiford wrote:
>> Unfortunately, the current configure code only treats sysroots as
>> relocatable if they are subdirectories of --exec-prefix. This seems
>> to be academic in the case of ld and gdb; they don't seem to take any
>> notice of TARGET_SYSTEM_ROOT_RELOCATABLE anyway. (ld relies on the
>> relocation performed by the gcc driver.)
>
> GDB definitely does honor TARGET_SYSTEM_ROOT_RELOCATABLE. ld does too
> (get_relative_sysroot in ldmain.c).
Doh! Sorry, I must have grepped wrongly. Probably for
DTARGET_SYSTEM_ROOT_RELOCATABLE or something that stupid like that.
>> This patch makes configure treat sysroots as relocatable if they are
>> under either --prefix or --exec-prefix. I've updated the ld and gdb
>> versions to keep them in sync.
>>
>> Bootstrapped & regression-tested on x86_64-linux-gnu. Also tested
>> on a sysrooted mips-linux-gnu compiler. OK to install?
>
> LD and GDB parts are OK.
Thanks.
> I think the GCC part is sufficiently obvious, or else ping Paolo.
I think "obvious" is a bit of a stretch in this case, so I'll hold
off the applying until the gcc part is reviewed.
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Allow sysroots to be relocated under $prefix as well as $exec_prefix
2007-05-12 8:23 ` Richard Sandiford
@ 2007-05-14 0:17 ` Mark Mitchell
0 siblings, 0 replies; 4+ messages in thread
From: Mark Mitchell @ 2007-05-14 0:17 UTC (permalink / raw)
To: gcc-patches, binutils, gdb-patches, richard
Richard Sandiford wrote:
>> I think the GCC part is sufficiently obvious, or else ping Paolo.
>
> I think "obvious" is a bit of a stretch in this case, so I'll hold
> off the applying until the gcc part is reviewed.
The GCC bits are OK, assuming no objections from a build system
maintainer within 24 hours.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-05-14 0:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-02 10:32 Allow sysroots to be relocated under $prefix as well as $exec_prefix Richard Sandiford
2007-05-11 18:05 ` Daniel Jacobowitz
2007-05-12 8:23 ` Richard Sandiford
2007-05-14 0:17 ` Mark Mitchell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox