summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-15 21:00:03 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-15 21:00:03 +0000
commit224d9f3db5e292d8e700700b9429c01c63e2dbfb (patch)
tree701e6a3873944b6f2226d0e7a4c7b25e7c11f7fe
parenta771cff407f45e85c4ca5992d63966faafce7f8e (diff)
downloadgcc-224d9f3db5e292d8e700700b9429c01c63e2dbfb.tar.gz
* Makefile.in (SYSROOT_CFLAGS_FOR_TARGET): Define from
@SYSROOT_CFLAGS_FOR_TARGET@. * configure.ac (SYSROOT_CFLAGS_FOR_TARGET): Set from build-sysroot. * configure: Regenerate. (site.exp): Add definition of TEST_ALWAYS_FLAGS. Remove setting of GCC_UNDER_TEST. testsuite/ChangeLog * lib/g++.exp (g++_init): Add $TEST_ALWAYS_FLAGS to ALWAYS_CXXFLAGS, if defined. * lib/gfortran.exp (gfortran_init): Add $TEST_ALWAYS_FLAGS to ALWAYS_GFORTRANFLAGS, if defined. * lib/go.exp (go_target_compile): Add $TEST_ALWAYS_FLAGS to ALWAYS_GOCFLAGS, if defined. * lib/obj-c++.exp (obj-c++_init): Add $TEST_ALWAYS_FLAGS to ALWAYS_OBJCXXFLAGS, if defined. * lib/gcc.exp (gcc_target_compile): Add $TEST_ALWAYS_FLAGS to additional_flags, if defined. * lib/gnat.exp (gnat_target_compile): Likewise. * lib/objc.exp (objc_target_compile): Likewise. * lib/target-supports-dg.exp (dg-add-options): Handle TEST_ALWAYS_FLAGS. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178897 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/Makefile.in6
-rwxr-xr-xgcc/configure12
-rw-r--r--gcc/configure.ac7
-rw-r--r--gcc/testsuite/ChangeLog17
-rw-r--r--gcc/testsuite/lib/g++.exp8
-rw-r--r--gcc/testsuite/lib/gcc.exp10
-rw-r--r--gcc/testsuite/lib/gfortran.exp8
-rw-r--r--gcc/testsuite/lib/gnat.exp8
-rw-r--r--gcc/testsuite/lib/go.exp8
-rw-r--r--gcc/testsuite/lib/obj-c++.exp8
-rw-r--r--gcc/testsuite/lib/objc.exp9
-rw-r--r--gcc/testsuite/lib/target-supports-dg.exp3
13 files changed, 110 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 17080c9dec0..f2b39a54a55 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2011-09-15 Diego Novillo <dnovillo@google.com>
+
+ * Makefile.in (SYSROOT_CFLAGS_FOR_TARGET): Define from
+ @SYSROOT_CFLAGS_FOR_TARGET@.
+ * configure.ac (SYSROOT_CFLAGS_FOR_TARGET): Set from
+ build-sysroot.
+ * configure: Regenerate.
+ (site.exp): Add definition of TEST_ALWAYS_FLAGS.
+ Remove setting of GCC_UNDER_TEST.
+
2011-09-15 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (output_fp_compare): Return %v prefixed
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index d5caba6c7f7..92016f2f92b 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -384,6 +384,9 @@ USER_H_INC_NEXT_POST = @user_headers_inc_next_post@
# 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
+# Set if the compiler was configured with --with-build-sysroot.
+SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
+
# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
# It specifies -B./.
# It also specifies -isystem ./include to find, e.g., stddef.h.
@@ -4923,6 +4926,9 @@ site.exp: ./config.status Makefile
@echo "set CXXFLAGS \"\"" >> ./site.tmp
@echo "set HOSTCC \"$(CC)\"" >> ./site.tmp
@echo "set HOSTCFLAGS \"$(CFLAGS)\"" >> ./site.tmp
+# TEST_ALWAYS_FLAGS are flags that should be passed to every compilation.
+# They are passed first to allow individual tests to override them.
+ @echo "set TEST_ALWAYS_FLAGS \"$(SYSROOT_CFLAGS_FOR_TARGET)\"" >> ./site.tmp
# 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
diff --git a/gcc/configure b/gcc/configure
index b1dd57b6ff4..651471ca9c8 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -764,6 +764,7 @@ CONFIGURE_SPECS
CROSS_SYSTEM_HEADER_DIR
TARGET_SYSTEM_ROOT_DEFINE
TARGET_SYSTEM_ROOT
+SYSROOT_CFLAGS_FOR_TARGET
enable_shared
enable_fixed_point
enable_decimal_float
@@ -7153,11 +7154,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;
@@ -17915,7 +17921,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17918 "configure"
+#line 17924 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -18021,7 +18027,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18024 "configure"
+#line 18030 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 51ab3acd409..126cb196450 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -727,7 +727,12 @@ AC_SUBST(enable_shared)
AC_ARG_WITH(build-sysroot,
[AS_HELP_STRING([--with-build-sysroot=sysroot],
- [use sysroot as the system root during the build])])
+ [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,
[AS_HELP_STRING([[--with-sysroot[=DIR]]],
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e30948118f5..b337503f7e4 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,20 @@
+2011-09-15 Diego Novillo <dnovillo@google.com>
+
+ * lib/g++.exp (g++_init): Add $TEST_ALWAYS_FLAGS to
+ ALWAYS_CXXFLAGS, if defined.
+ * lib/gfortran.exp (gfortran_init): Add $TEST_ALWAYS_FLAGS to
+ ALWAYS_GFORTRANFLAGS, if defined.
+ * lib/go.exp (go_target_compile): Add $TEST_ALWAYS_FLAGS to
+ ALWAYS_GOCFLAGS, if defined.
+ * lib/obj-c++.exp (obj-c++_init): Add $TEST_ALWAYS_FLAGS to
+ ALWAYS_OBJCXXFLAGS, if defined.
+ * lib/gcc.exp (gcc_target_compile): Add $TEST_ALWAYS_FLAGS to
+ additional_flags, if defined.
+ * lib/gnat.exp (gnat_target_compile): Likewise.
+ * lib/objc.exp (objc_target_compile): Likewise.
+ * lib/target-supports-dg.exp (dg-add-options): Handle
+ TEST_ALWAYS_FLAGS.
+
2011-09-15 Tom de Vries <tom@codesourcery.com>
PR testsuite/50322
diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp
index 9e269b12d66..ff111253f12 100644
--- a/gcc/testsuite/lib/g++.exp
+++ b/gcc/testsuite/lib/g++.exp
@@ -190,6 +190,7 @@ proc g++_init { args } {
global TESTING_IN_BUILD_TREE
global gcc_warning_prefix
global gcc_error_prefix
+ global TEST_ALWAYS_FLAGS
# We set LC_ALL and LANG to C so that we get the same error messages as expected.
setenv LC_ALL C
@@ -241,6 +242,13 @@ proc g++_init { args } {
set ALWAYS_CXXFLAGS ""
+ # TEST_ALWAYS_FLAGS are flags that should be passed to every
+ # compilation command. They are passed first to allow individual
+ # tests to override them.
+ if [info exists TEST_ALWAYS_FLAGS] {
+ lappend ALWAYS_CXXFLAGS "additional_flags=$TEST_ALWAYS_FLAGS"
+ }
+
if ![is_remote host] {
if [info exists TOOL_OPTIONS] {
lappend ALWAYS_CXXFLAGS "additional_flags=[g++_include_flags [get_multilibs ${TOOL_OPTIONS}] ]"
diff --git a/gcc/testsuite/lib/gcc.exp b/gcc/testsuite/lib/gcc.exp
index ddbf9ef6bf7..bb1763ad343 100644
--- a/gcc/testsuite/lib/gcc.exp
+++ b/gcc/testsuite/lib/gcc.exp
@@ -126,6 +126,7 @@ proc gcc_target_compile { source dest type options } {
global gluefile wrap_flags
global GCC_UNDER_TEST
global TOOL_OPTIONS
+ global TEST_ALWAYS_FLAGS
if {[target_info needs_status_wrapper] != "" && \
[target_info needs_status_wrapper] != "0" && \
@@ -143,11 +144,20 @@ proc gcc_target_compile { source dest type options } {
if [target_info exists gcc,no_label_values] {
lappend options "additional_flags=-DNO_LABEL_VALUES"
}
+
+ # TEST_ALWAYS_FLAGS are flags that should be passed to every
+ # compilation. They are passed first to allow individual
+ # tests to override them.
+ if [info exists TEST_ALWAYS_FLAGS] {
+ set options [concat "{additional_flags=$TEST_ALWAYS_FLAGS}" $options]
+ }
+
# TOOL_OPTIONS must come first, so that it doesn't override testcase
# specific options.
if [info exists TOOL_OPTIONS] {
set options [concat "{additional_flags=$TOOL_OPTIONS}" $options]
}
+
lappend options "timeout=[timeout_value]"
lappend options "compiler=$GCC_UNDER_TEST"
set options [dg-additional-files-options $options $source]
diff --git a/gcc/testsuite/lib/gfortran.exp b/gcc/testsuite/lib/gfortran.exp
index 4a1a636bb93..d9934fc07ab 100644
--- a/gcc/testsuite/lib/gfortran.exp
+++ b/gcc/testsuite/lib/gfortran.exp
@@ -144,6 +144,7 @@ proc gfortran_init { args } {
global TESTING_IN_BUILD_TREE
global gcc_warning_prefix
global gcc_error_prefix
+ global TEST_ALWAYS_FLAGS
# We set LC_ALL and LANG to C so that we get the same error messages as expected.
setenv LC_ALL C
@@ -194,6 +195,13 @@ proc gfortran_init { args } {
set ALWAYS_GFORTRANFLAGS ""
+ # TEST_ALWAYS_FLAGS are flags that should be passed to every
+ # compilation. They are passed first to allow individual
+ # tests to override them.
+ if [info exists TEST_ALWAYS_FLAGS] {
+ lappend ALWAYS_GFORTRANFLAGS "additional_flags=$TEST_ALWAYS_FLAGS"
+ }
+
if ![is_remote host] {
if [info exists TOOL_OPTIONS] {
lappend ALWAYS_GFORTRANFLAGS "ldflags=[gfortran_link_flags [get_multilibs ${TOOL_OPTIONS}] ]"
diff --git a/gcc/testsuite/lib/gnat.exp b/gcc/testsuite/lib/gnat.exp
index ad330693342..21cfce4315b 100644
--- a/gcc/testsuite/lib/gnat.exp
+++ b/gcc/testsuite/lib/gnat.exp
@@ -115,6 +115,7 @@ proc gnat_target_compile { source dest type options } {
global GNAT_UNDER_TEST
global TOOL_OPTIONS
global gnat_target_current
+ global TEST_ALWAYS_FLAGS
# dg-require-effective-target tests must be compiled as C.
if [ string match "*.c" $source ] then {
@@ -154,6 +155,13 @@ proc gnat_target_compile { source dest type options } {
lappend options "ldflags=$wrap_flags"
}
+ # TEST_ALWAYS_FLAGS are flags that should be passed to every
+ # compilation. They are passed first to allow individual
+ # tests to override them.
+ if [info exists TEST_ALWAYS_FLAGS] {
+ set options [concat "{additional_flags=$TEST_ALWAYS_FLAGS}" $options]
+ }
+
# TOOL_OPTIONS must come first, so that it doesn't override testcase
# specific options.
if [info exists TOOL_OPTIONS] {
diff --git a/gcc/testsuite/lib/go.exp b/gcc/testsuite/lib/go.exp
index ee5eb76ef8e..e189ea135e1 100644
--- a/gcc/testsuite/lib/go.exp
+++ b/gcc/testsuite/lib/go.exp
@@ -139,6 +139,7 @@ proc go_init { args } {
global TOOL_EXECUTABLE TOOL_OPTIONS
global GOC_UNDER_TEST
global TESTING_IN_BUILD_TREE
+ global TEST_ALWAYS_FLAGS
# We set LC_ALL and LANG to C so that we get the same error messages as expected.
setenv LC_ALL C
@@ -174,6 +175,13 @@ proc go_init { args } {
set ALWAYS_GOCFLAGS ""
+ # TEST_ALWAYS_FLAGS are flags that should be passed to every
+ # compilation. They are passed first to allow individual
+ # tests to override them.
+ if [info exists TEST_ALWAYS_FLAGS] {
+ lappend ALWAYS_GOCFLAGS "additional_flags=$TEST_ALWAYS_FLAGS"
+ }
+
if ![is_remote host] {
if [info exists TOOL_OPTIONS] {
lappend ALWAYS_GOCFLAGS "additional_flags=[go_include_flags [get_multilibs ${TOOL_OPTIONS}] ]"
diff --git a/gcc/testsuite/lib/obj-c++.exp b/gcc/testsuite/lib/obj-c++.exp
index b3bed0e30a2..8c190cd2f58 100644
--- a/gcc/testsuite/lib/obj-c++.exp
+++ b/gcc/testsuite/lib/obj-c++.exp
@@ -212,6 +212,7 @@ proc obj-c++_init { args } {
global TESTING_IN_BUILD_TREE
global gcc_warning_prefix
global gcc_error_prefix
+ global TEST_ALWAYS_FLAGS
if ![info exists OBJCXX_UNDER_TEST] then {
if [info exists TOOL_EXECUTABLE] {
@@ -248,6 +249,13 @@ proc obj-c++_init { args } {
set ALWAYS_OBJCXXFLAGS ""
+ # TEST_ALWAYS_FLAGS are flags that should be passed to every
+ # compilation. They are passed first to allow individual
+ # tests to override them.
+ if [info exists TEST_ALWAYS_FLAGS] {
+ lappend ALWAYS_OBJCXXFLAGS "additional_flags=$TEST_ALWAYS_FLAGS"
+ }
+
if ![is_remote host] {
if [info exists TOOL_OPTIONS] {
lappend ALWAYS_OBJCXXFLAGS "additional_flags=[obj-c++_include_flags [get_multilibs ${TOOL_OPTIONS}] ]";
diff --git a/gcc/testsuite/lib/objc.exp b/gcc/testsuite/lib/objc.exp
index 3a19c48f278..8cff974602f 100644
--- a/gcc/testsuite/lib/objc.exp
+++ b/gcc/testsuite/lib/objc.exp
@@ -142,6 +142,7 @@ proc objc_target_compile { source dest type options } {
global ld_library_path
global objc_libgcc_s_path
global shlib_ext
+ global TEST_ALWAYS_FLAGS
set shlib_ext [get_shlib_extension]
set ld_library_path ".:${objc_libgcc_s_path}"
@@ -199,6 +200,14 @@ proc objc_target_compile { source dest type options } {
if [target_info exists objc,no_label_values] {
lappend options "additional_flags=-DNO_LABEL_VALUES"
}
+
+ # TEST_ALWAYS_FLAGS are flags that should be passed to every
+ # compilation. They are passed first to allow individual
+ # tests to override them.
+ if [info exists TEST_ALWAYS_FLAGS] {
+ set options [concat "{additional_flags=$TEST_ALWAYS_FLAGS}" $options]
+ }
+
# TOOL_OPTIONS must come first, so that it doesn't override testcase
# specific options.
if [info exists TOOL_OPTIONS] {
diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp
index 3e577a91166..a8f0a69a2e8 100644
--- a/gcc/testsuite/lib/target-supports-dg.exp
+++ b/gcc/testsuite/lib/target-supports-dg.exp
@@ -262,6 +262,7 @@ proc dg-add-options { args } {
proc check-flags { args } {
global compiler_flags
global TOOL_OPTIONS
+ global TEST_ALWAYS_FLAGS
# The args are within another list; pull them out.
set args [lindex $args 0]
@@ -272,6 +273,8 @@ proc check-flags { args } {
append compiler_flags [current_compiler_flags]
# If running a subset of the test suite, $TOOL_OPTIONS may not exist.
catch {append compiler_flags " $TOOL_OPTIONS "}
+ # If running a subset of the test suite, $TEST_ALWAYS_FLAGS may not exist.
+ catch {append compiler_flags " $TEST_ALWAYS_FLAGS "}
set dest [target_info name]
if [board_info $dest exists multilib_flags] {
append compiler_flags "[board_info $dest multilib_flags] "