[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: --with-sysroot conflicts in binutils and gcc

From: Paolo Bonzini
Subject: Re: --with-sysroot conflicts in binutils and gcc
Date: Sat, 23 Oct 2010 09:38:43 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100907 Fedora/3.1.3-1.fc13 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.3

On 10/21/2010 10:23 PM, Khem Raj wrote:
> toolchain has two options when it comes to sysroot --with-sysroot and
> --with-build-sysroot I think libtool should
> also differentiate between two and set both to same if not explicitly
> set during configure time. I think libtool
> means to use build time sysroot and not runtime sysroot its just that
> configure options are colliding

Yes, for target modules the GCC toplevel should pass
--with-sysroot=$with_build_sysroot, or libtool should learn
about --with-build-sysroot.

Also, libtool should probably ignore --with-sysroot if build==host;
native compilers are never build with a sysroot in practice.  This however
would still conflict with GCC when cross-building a native compiler, or
for a sysrooted Canadian cross.  The attached patch could be made to work
in this scenario if you can afford using --without-build-sysroot.

Another possibility is to have an environment variable which would
override the command-line options (ick).  Then the GCC toplevel can
set it as they wish.


diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 967dd38..3b7ff61 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -1183,19 +1183,21 @@ AC_DEFUN([_LT_WITH_SYSROOT],
 [  --with-sysroot[=DIR] Search for dependent libraries within DIR
                         (or the compiler's sysroot if not specified).],
-[], [with_sysroot=no])
+[], [with_sysroot=${with_build_sysroot}])
 dnl lt_sysroot will always be passed unquoted.  We quote it here
 dnl in case the user passed a directory name.
 case ${with_sysroot} in #(
-   if test "$GCC" = yes; then
+   if test "$GCC" = yes && test "$build" != "$host"; then
      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
    ;; #(
-   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   if test "$build" != "$host"; then
+     lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   fi
    ;; #(
    ;; #(

reply via email to

[Prev in Thread] Current Thread [Next in Thread]