|
|
Created:
13 years, 10 months ago by Diego Novillo Modified:
13 years, 3 months ago Reviewers:
simonb, Ralf.Wildenhues, mikestump, ro CC:
simonb Visibility:
Public. |
Patch Set 1 #Patch Set 2 : Trunk version. #
MessagesTotal messages: 11
When running tests in a toolchain configure --with-build-sysroot, we need to execute the testsuite pointing every compiler invocation to the build sysroot (which in our case is different than the sysroot that the compiler is configured with). This patch adds a new global variable TEST_SYSROOT that takes its value from SYSROOT_CFLAGS_FOR_TARGET. Mike, Rainer, is this approach OK? I had started by setting TOOL_OPTIONS, but that confused libgloss.exp when it tried to compute multilibs (get_multilibs). The presence of the argument --sysroot=.... causes get_multilibs to call gcc with --print-multilibs, which returns the string '.'. This causes massive failures on all the tests that run with non-default multilibs. I'm applying this on google/integration. OK for 4.7? (the patch for trunk would be slightly different, but the idea is the same). Thanks. Diego. ChangeLog.google-integration * Makefile.in (GCC_FOR_TARGET): Remove use of $(SYSROOT_CFLAGS_FOR_TARGET). (site.exp): Add definition of TEST_SYSROOT. testsuite/ChangeLog.google-integration * lib/g++.exp (g++_target_compile): Add $TEST_SYSROOT to additional_flags, if defined. * lib/gcc.exp (gcc_target_compile): Likewise. * lib/gfortran.exp (gfortran_target_compile): Likewise. * lib/gnat.exp (gnat_target_compile): Likewise. * lib/go.exp (go_target_compile): Likewise. * lib/obj-c++.exp (obj-c++_target_compile): Likewise. * lib/objc.exp (objc_target_compile): Likewise. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 2ff382e..dca5302 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -371,8 +371,10 @@ 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 + +# Set if the compiler was configured with --with-build-sysroot. 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./. @@ -4833,7 +4835,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 + @echo "set TEST_SYSROOT \"$(SYSROOT_CFLAGS_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 diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp index 9de817b..481edb5 100644 --- a/gcc/testsuite/lib/g++.exp +++ b/gcc/testsuite/lib/g++.exp @@ -282,6 +282,7 @@ proc g++_target_compile { source dest type options } { global gluefile wrap_flags global ALWAYS_CXXFLAGS global GXX_UNDER_TEST + global TEST_SYSROOT if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } { lappend options "libs=${gluefile}" @@ -292,6 +293,9 @@ proc g++_target_compile { source dest type options } { lappend options "compiler=$GXX_UNDER_TEST" lappend options "timeout=[timeout_value]" + if [info exists TEST_SYSROOT] { + lappend options "additional_flags=$TEST_SYSROOT" + } set options [concat $gpp_compile_options $options] set options [concat "$ALWAYS_CXXFLAGS" $options] diff --git a/gcc/testsuite/lib/gcc.exp b/gcc/testsuite/lib/gcc.exp index ddbf9ef..208fb6e 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_SYSROOT if {[target_info needs_status_wrapper] != "" && \ [target_info needs_status_wrapper] != "0" && \ @@ -148,6 +149,9 @@ proc gcc_target_compile { source dest type options } { if [info exists TOOL_OPTIONS] { set options [concat "{additional_flags=$TOOL_OPTIONS}" $options] } + if [info exists TEST_SYSROOT] { + lappend options "additional_flags=$TEST_SYSROOT" + } 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 4a1a636..f4c8c2b 100644 --- a/gcc/testsuite/lib/gfortran.exp +++ b/gcc/testsuite/lib/gfortran.exp @@ -227,6 +227,7 @@ proc gfortran_target_compile { source dest type options } { global gluefile wrap_flags global ALWAYS_GFORTRANFLAGS global GFORTRAN_UNDER_TEST + global TEST_SYSROOT if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } { lappend options "libs=${gluefile}" @@ -236,6 +237,9 @@ proc gfortran_target_compile { source dest type options } { lappend options "compiler=$GFORTRAN_UNDER_TEST" lappend options "timeout=[timeout_value]" + if [info exists TEST_SYSROOT] { + lappend options "additional_flags=$TEST_SYSROOT" + } set options [concat "$ALWAYS_GFORTRANFLAGS" $options] set options [dg-additional-files-options $options $source] return [target_compile $source $dest $type $options] diff --git a/gcc/testsuite/lib/gnat.exp b/gcc/testsuite/lib/gnat.exp index ad33069..ea6a067 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_SYSROOT # dg-require-effective-target tests must be compiled as C. if [ string match "*.c" $source ] then { @@ -160,6 +161,10 @@ proc gnat_target_compile { source dest type options } { set options [concat "additional_flags=$TOOL_OPTIONS" $options] } + if [info exists TEST_SYSROOT] { + lappend options "additional_flags=$TEST_SYSROOT" + } + return [target_compile $source $dest $type $options] } diff --git a/gcc/testsuite/lib/go.exp b/gcc/testsuite/lib/go.exp index ee5eb76..a67fe63 100644 --- a/gcc/testsuite/lib/go.exp +++ b/gcc/testsuite/lib/go.exp @@ -202,12 +202,17 @@ proc go_target_compile { source dest type options } { global gluefile wrap_flags global ALWAYS_GOCFLAGS global GOC_UNDER_TEST + global TEST_SYSROOT if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } { lappend options "libs=${gluefile}" lappend options "ldflags=${wrap_flags}" } + if [info exists TEST_SYSROOT] { + lappend options "additional_flags=$TEST_SYSROOT" + } + lappend options "compiler=$GOC_UNDER_TEST" set options [concat "$ALWAYS_GOCFLAGS" $options] diff --git a/gcc/testsuite/lib/obj-c++.exp b/gcc/testsuite/lib/obj-c++.exp index 57bab52..c2b5f85 100644 --- a/gcc/testsuite/lib/obj-c++.exp +++ b/gcc/testsuite/lib/obj-c++.exp @@ -291,6 +291,7 @@ proc obj-c++_target_compile { source dest type options } { global ALWAYS_OBJCXXFLAGS global OBJCXX_UNDER_TEST global shlib_ext + global TEST_SYSROOT set shlib_ext [get_shlib_extension] verbose "input-options: $options" 4 @@ -362,6 +363,9 @@ proc obj-c++_target_compile { source dest type options } { } } + if [info exists TEST_SYSROOT] { + lappend options "additional_flags=$TEST_SYSROOT" + } lappend options "additional_flags=[libio_include_flags]" lappend options "compiler=$OBJCXX_UNDER_TEST"; lappend options "timeout=[timeout_value]" diff --git a/gcc/testsuite/lib/objc.exp b/gcc/testsuite/lib/objc.exp index ae0671f..ca6ea46 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_SYSROOT set shlib_ext [get_shlib_extension] set ld_library_path ".:${objc_libgcc_s_path}" @@ -205,6 +206,10 @@ proc objc_target_compile { source dest type options } { set options [concat "{additional_flags=$TOOL_OPTIONS}" $options] } + if [info exists TEST_SYSROOT] { + lappend options "additional_flags=$TEST_SYSROOT" + } + # If we have built libobjc along with the compiler, point the test harness # at it (and associated headers). -- This patch is available for review at http://codereview.appspot.com/4248059
Sign in to reply to this message.
On Fri, Mar 4, 2011 at 13:48, Diego Novillo <dnovillo@google.com> wrote: > > When running tests in a toolchain configure --with-build-sysroot, we > need to execute the testsuite pointing every compiler invocation to > the build sysroot (which in our case is different than the sysroot > that the compiler is configured with). > > This patch adds a new global variable TEST_SYSROOT that takes its > value from SYSROOT_CFLAGS_FOR_TARGET. > > Mike, Rainer, is this approach OK? I had started by setting > TOOL_OPTIONS, but that confused libgloss.exp when it tried to compute > multilibs (get_multilibs). The presence of the argument > --sysroot=.... causes get_multilibs to call gcc with > --print-multilibs, which returns the string '.'. This causes massive > failures on all the tests that run with non-default multilibs. > > I'm applying this on google/integration. OK for 4.7? (the patch for > trunk would be slightly different, but the idea is the same). I forgot to add. Simon, this still shows up some failures in google/integration, but these failures are the same we have in trunk. For our builds, we have been XFAILing these failures, right? Do you want me to mark them XFAIL to avoid problems with the auto builds? Diego.
Sign in to reply to this message.
Hello Diego, * Diego Novillo wrote on Fri, Mar 04, 2011 at 10:48:36PM CET: > ChangeLog.google-integration > > * Makefile.in (GCC_FOR_TARGET): Remove use of > $(SYSROOT_CFLAGS_FOR_TARGET). > (site.exp): Add definition of TEST_SYSROOT. > --- a/gcc/Makefile.in > +++ b/gcc/Makefile.in > @@ -371,8 +371,10 @@ 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 > + > +# Set if the compiler was configured with --with-build-sysroot. > 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 No comment on the rest, but shouldn't toplevel Makefile.tpl and configure machinery not also be updated to reflect this (e.g., so you can run 'make check-gcc' from the toplevel)? Thanks, Ralf
Sign in to reply to this message.
On Fri, Mar 4, 2011 at 14:01, Ralf Wildenhues <Ralf.Wildenhues@gmx.de> wrote: > No comment on the rest, but shouldn't toplevel Makefile.tpl and > configure machinery not also be updated to reflect this > (e.g., so you can run 'make check-gcc' from the toplevel)? Yeah, that's why I mentioned that the 4.7 patch would be slightly different. We already have those changes in google/integration (so they didn't show up in my patch). My question to you and Mike was regarding the approach of creating TEST_SYSROOT. If you think that's a good approach, I will prepare a patch vs 4.7. Thanks. Diego.
Sign in to reply to this message.
On Mar 4, 2011, at 1:48 PM, Diego Novillo wrote: > When running tests in a toolchain configure --with-build-sysroot, we > need to execute the testsuite pointing every compiler invocation to > the build sysroot (which in our case is different than the sysroot > that the compiler is configured with). When testing the built compiler, we test it on the host. The path name on the command line, is a path name on the build machine. You can't use that, in general on the host machine. So, for this to work, you'd need to work out a location on the host, and then remote_download that to the host, and then use that for the host compiler for testing. So, roughly, check out copy-file.exp or additional_files for example. In building, we use the build compiler to compile the target libraries, which means we can use that argument directly in that environment. I hate the cut-n-paste programming model (still). Though, you didn't invent it, so you don't have to pay the price to fix it, I'll just note it in passing. > # 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 > + > +# Set if the compiler was configured with --with-build-sysroot. > 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 $(shell $(PWD_COMMAND)) is slow (unless make short circuits it). Beyond that, this confuses the build != host setup I think. See, . is special and the testing infrastructure works hard to appear the compiler is ., not any other directory. You can't change the name for testing and have it just work. > - @echo "set GCC_UNDER_TEST \"$(GCC_FOR_TARGET)\"" >> ./tmp0 ? What's this? GCC_UNDER_TEST is kinda important to testing. I feel like I'm missing something trivial. > + @echo "set TEST_SYSROOT \"$(SYSROOT_CFLAGS_FOR_TARGET)\"" >> ./tmp0 > + if [info exists TEST_SYSROOT] { > + lappend options "additional_flags=$TEST_SYSROOT" > + } So, this will cause a certain ordering on the command line. If there is a testcase in the testsuite that tests that flag, this might cause the option under test to be overridden unless the TEST_SYSROOT option comes first on the command line. You can glance at the .log file, and ensure that this option comes before the -O2 say, of the multilib options in a torture suite.
Sign in to reply to this message.
On 4 March 2011 22:50, Diego Novillo <dnovillo@google.com> wrote: > ... > I forgot to add. Simon, this still shows up some failures in > google/integration, but these failures are the same we have in trunk. > > For our builds, we have been XFAILing these failures, right? Do you > want me to mark them XFAIL to avoid problems with the auto builds? No, it's okay to leave them failing for now. I'll go through and address each individually once the overall framework is settled. -- Google UK Limited | Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ | Registered in England Number: 3977902
Sign in to reply to this message.
On Fri, Mar 4, 2011 at 20:07, Mike Stump <mikestump@comcast.net> wrote: >> - @echo "set GCC_UNDER_TEST \"$(GCC_FOR_TARGET)\"" >> ./tmp0 > > ? What's this? GCC_UNDER_TEST is kinda important to testing. I feel like I'm missing something trivial. This is an artifact of the branch. We used to force GCC_UNDER_TEST, but we don't need to anymore. It will become clear when I send the patch against trunk. I'm testing it now. I will send it as soon as I finish testing all the variants. > >> + @echo "set TEST_SYSROOT \"$(SYSROOT_CFLAGS_FOR_TARGET)\"" >> ./tmp0 > >> + if [info exists TEST_SYSROOT] { >> + lappend options "additional_flags=$TEST_SYSROOT" >> + } > > So, this will cause a certain ordering on the command line. If there is a testcase in the > testsuite that tests that flag, this might cause the option under test to be overridden > unless the TEST_SYSROOT option comes first on the command line. You can glance > at the .log file, and ensure that this option comes before the -O2 say, of the multilib > options in a torture suite. Thanks. I see that I'm emitting it fairly late in the options. I will move it so this is added early in the command line. Diego.
Sign in to reply to this message.
On Mon, Mar 7, 2011 at 05:44, Simon Baldwin <simonb@google.com> wrote: > On 4 March 2011 22:50, Diego Novillo <dnovillo@google.com> wrote: >> ... >> I forgot to add. Simon, this still shows up some failures in >> google/integration, but these failures are the same we have in trunk. >> >> For our builds, we have been XFAILing these failures, right? Do you >> want me to mark them XFAIL to avoid problems with the auto builds? > > > No, it's okay to leave them failing for now. I'll go through and > address each individually once the overall framework is settled. OK, thanks. Diego.
Sign in to reply to this message.
This is the patch I had in mind for trunk. I made it a little more generic by changing the name of the variable to TEST_ALWAYS_FLAGS and setting it by default to use the value from SYSROOT_CFLAGS_FOR_TARGET. I also added the setting of SYSROOT_CFLAGS_FOR_TARGET to use the value from --with-build-sysroot. I think this would also be useful for any other settings that one would want to use with all compiles, but I'm not completely sure if the approach is OK. If this is not the proper way, I need something like this so I can execute every test in the testsuite with a specific set of flags (--sysroot=... in this case) Bootstrapped and tested on x86_64 with and without build-sysroot. OK for 4.7? Thanks. Diego. ChangeLog * 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. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 9a8262a..158f47d 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -373,6 +373,9 @@ UNWIND_H = $(srcdir)/unwind-generic.h # 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. @@ -4831,6 +4834,9 @@ site.exp: ./config.status Makefile @echo "set CXXFLAGS \"\"" >> ./tmp0 @echo "set HOSTCC \"$(CC)\"" >> ./tmp0 @echo "set HOSTCFLAGS \"$(CFLAGS)\"" >> ./tmp0 +# 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)\"" >> ./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 diff --git a/gcc/configure b/gcc/configure index a454946..df8b166 100755 --- a/gcc/configure +++ b/gcc/configure @@ -759,6 +759,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 @@ -7060,11 +7061,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; @@ -17505,7 +17511,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17508 "configure" +#line 17514 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17611,7 +17617,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17614 "configure" +#line 17620 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 03a8cef..82aef96 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -711,7 +711,12 @@ AC_SUBST(enable_shared) AC_ARG_WITH(build-sysroot, [ --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, [ --with-sysroot[=DIR] Search for usr/lib, usr/include, et al, within DIR.], diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp index 9de817b..c421298 100644 --- a/gcc/testsuite/lib/g++.exp +++ b/gcc/testsuite/lib/g++.exp @@ -191,6 +191,7 @@ proc g++_init { args } { global target_triplet 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 @@ -242,6 +243,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 ddbf9ef..bb1763a 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 4a1a636..d9934fc 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 ad33069..21cfce4 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 ee5eb76..e189ea1 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 57bab52..9e31d9d 100644 --- a/gcc/testsuite/lib/obj-c++.exp +++ b/gcc/testsuite/lib/obj-c++.exp @@ -213,6 +213,7 @@ proc obj-c++_init { args } { global target_triplet global gcc_warning_prefix global gcc_error_prefix + global TEST_ALWAYS_FLAGS if ![info exists OBJCXX_UNDER_TEST] then { if [info exists TOOL_EXECUTABLE] { @@ -249,6 +250,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 ae0671f..30d24e1 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 3a2c0dc..6adb7db 100644 --- a/gcc/testsuite/lib/target-supports-dg.exp +++ b/gcc/testsuite/lib/target-supports-dg.exp @@ -258,6 +258,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] @@ -268,6 +269,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] " -- This patch is available for review at http://codereview.appspot.com/4248059
Sign in to reply to this message.
On Mar 7, 2011, at 5:30 PM, Diego Novillo wrote: > This is the patch I had in mind for trunk. > OK for 4.7? Ok. I'll just note here, that this is necessary for canadian, but not always sufficient. It is monotonically better however. I looked at the Make/configure issues, and they look fine to me, though, there are others that specialize in that. Thanks.
Sign in to reply to this message.
On Mon, Mar 7, 2011 at 20:47, Mike Stump <mikestump@comcast.net> wrote: > On Mar 7, 2011, at 5:30 PM, Diego Novillo wrote: >> This is the patch I had in mind for trunk. > >> OK for 4.7? > > Ok. I'll just note here, that this is necessary for canadian, but not always sufficient. It is monotonically better however. I looked at the Make/configure issues, and they look fine to me, though, there are others that specialize in that. Thanks. Took me a while, but I've applied this patch as rev 178897. Diego.
Sign in to reply to this message.
|