diff mbox

[google] Include build sysroot in GCC_FOR_TARGET, and use it when running tests

Message ID 20110128130946.6EDC41C6D15@hpgntab-ubiq73.eem.corp.google.com
State New
Headers show

Commit Message

Simon Baldwin Jan. 28, 2011, 1:09 p.m. UTC
Include build sysroot in GCC_FOR_TARGET, and use it when running tests.

When gcc is configured with --with-build-sysroot, the same -sysroot needs
to be passed to both the build and the test phase.  This change propagates
any -sysroot to the dejagnu tests.

Targeted for the google/integration branch.

gcc/ChangeLog.google:
2011-01-28  Simon Baldwin  <simonb@google.com>

	* configure.ac: Add new SYSROOT_CFLAGS_FOR_TARGET variable.
	* configure: Rebuild from configure.ac.
	* Makefile.in: Add SYSROOT_CFLAGS_FOR_TARGET to GCC_FOR_TARGET.

Google ref: 39277

Comments

Diego Novillo Jan. 28, 2011, 1:14 p.m. UTC | #1
On Fri, Jan 28, 2011 at 08:09, Simon Baldwin <simonb@google.com> wrote:

> 2011-01-28  Simon Baldwin  <simonb@google.com>
>
>        * configure.ac: Add new SYSROOT_CFLAGS_FOR_TARGET variable.
>        * configure: Rebuild from configure.ac.
>        * Makefile.in: Add SYSROOT_CFLAGS_FOR_TARGET to GCC_FOR_TARGET.

OK.


Diego.
diff mbox

Patch

Index: gcc/configure
===================================================================
--- gcc/configure	(revision 169355)
+++ gcc/configure	(working copy)
@@ -759,6 +759,7 @@  CONFIGURE_SPECS
 CROSS_SYSTEM_HEADER_DIR
 TARGET_SYSTEM_ROOT_DEFINE
 TARGET_SYSTEM_ROOT
+SYSROOT_CFLAGS_FOR_TARGET
 RUNTIME_ROOT_PREFIX_DEFINE
 NATIVE_SYSTEM_HEADER_DIR
 enable_shared
@@ -1654,7 +1655,7 @@  Optional Packages:
                           prepend prefix to paths used by the compiler to
                           name the dynamic linker and other files used at
                           runtime.  Defaults to empty (no prefix).
-  --with-build-sysroot=sysroot
+  --with-build-sysroot=SYSROOT
                           use sysroot as the system root during the build
   --with-sysroot=DIR Search for usr/lib, usr/include, et al, within DIR.
   --with-specs=SPECS      add SPECS to driver command-line processing
@@ -7109,11 +7110,16 @@  fi
 
 # Check whether --with-build-sysroot was given.
 if test "${with_build_sysroot+set}" = set; then :
-  withval=$with_build_sysroot;
+  withval=$with_build_sysroot; if test x"$withval" != x ; then
+     SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
+   fi
+else
+  SYSROOT_CFLAGS_FOR_TARGET=
 fi
 
 
 
+
 # Check whether --with-sysroot was given.
 if test "${with_sysroot+set}" = set; then :
   withval=$with_sysroot;
@@ -17562,7 +17568,7 @@  else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 17565 "configure"
+#line 17571 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -17668,7 +17674,7 @@  else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 17671 "configure"
+#line 17677 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 169355)
+++ gcc/configure.ac	(working copy)
@@ -741,9 +741,14 @@  AC_ARG_WITH([runtime-root-prefix],
 ], [RUNTIME_ROOT_PREFIX_DEFINE=""])
 AC_SUBST(RUNTIME_ROOT_PREFIX_DEFINE)
 
-AC_ARG_WITH(build-sysroot, 
-  [  --with-build-sysroot=sysroot
-                          use sysroot as the system root during the build])
+AC_ARG_WITH([build-sysroot],
+  [  --with-build-sysroot=SYSROOT
+                          use sysroot as the system root during the build],
+  [if test x"$withval" != x ; then
+     SYSROOT_CFLAGS_FOR_TARGET="--sysroot=$withval"
+   fi],
+  [SYSROOT_CFLAGS_FOR_TARGET=])
+AC_SUBST(SYSROOT_CFLAGS_FOR_TARGET)
 
 AC_ARG_WITH(sysroot,
 [  --with-sysroot[=DIR] Search for usr/lib, usr/include, et al, within DIR.],
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 169355)
+++ gcc/Makefile.in	(working copy)
@@ -371,7 +371,8 @@  UNWIND_H = $(srcdir)/unwind-generic.h
 # The GCC to use for compiling crt*.o.
 # Usually the one we just built.
 # Don't use this as a dependency--use $(GCC_PASSES).
-GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld
+SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
+GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $(shell $(PWD_COMMAND))/xgcc $(SYSROOT_CFLAGS_FOR_TARGET) -B$(shell ($PWD_COMMAND))/ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld
 
 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
 # It specifies -B./.
@@ -4843,6 +4844,7 @@  site.exp: ./config.status Makefile
 	@echo "set CXXFLAGS \"\"" >> ./tmp0
 	@echo "set HOSTCC \"$(CC)\"" >> ./tmp0
 	@echo "set HOSTCFLAGS \"$(CFLAGS)\"" >> ./tmp0
+	@echo "set GCC_UNDER_TEST \"$(GCC_FOR_TARGET)\"" >> ./tmp0
 # When running the tests we set GCC_EXEC_PREFIX to the install tree so that
 # files that have already been installed there will be found.  The -B option
 # overrides it, so use of GCC_EXEC_PREFIX will not result in using GCC files