[testsuite] Don't assume that HOSTCXX can respond to TEST_ALWAYS_FLAGS.

Message ID 6BA8585E-47D1-48EC-BBA2-2489FDD4E76F@sandoe.co.uk
State New
Headers show
Series
  • [testsuite] Don't assume that HOSTCXX can respond to TEST_ALWAYS_FLAGS.
Related show

Commit Message

Iain Sandoe Aug. 29, 2018, 10:30 a.m.
Hi,

I have noticed, for some configuration cases, that the ms-sysv tests fail with “can’t build generator”.

The setting of HOSTCXX in gcc/testsuite/gcc/site.exp is dependent on the top level configuration;
for example, configuring with —target,host,build = x86_64-linux-gnu or CXX=/usr/bin/g++ sets the
site.exp HOSTCXX to the discovered bootstrap compiler

Whereas, configuring with a plain …/configure  .. sets HOSTCXX to prev-gcc/xg++.

In the latter case, the “host” compiler can respond to TEST_ALWAYS_FLAGS, in the former cases
it cannot necessarily (unless one is bootstrapping with gcc-9).

The patch below removes  TEST_ALWAYS_FLAGS from the generator build - and the tests pass for
me on x86_64-linux and x86_64-darwin with various configuration lines.

If that doesn’t cover enough cases, and it’s really necessary that the generator is built with
TEST_ALWAYS_FLAGS, then support for them in HOSTCXX needs to be checked (there is already a
check for the host compiler support for c++11).

OK for trunk?
thanks
Iain

gcc/testsuite/

	* gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp (runtest_ms_sysv): Don’t
	assume that the HOSTCXX supports TEST_ALWAYS_FLAGS.

Comments

Jeff Law Sept. 14, 2018, 5:06 p.m. | #1
On 8/29/18 4:30 AM, Iain Sandoe wrote:
> Hi,

> 

> I have noticed, for some configuration cases, that the ms-sysv tests fail with “can’t build generator”.

> 

> The setting of HOSTCXX in gcc/testsuite/gcc/site.exp is dependent on the top level configuration;

> for example, configuring with —target,host,build = x86_64-linux-gnu or CXX=/usr/bin/g++ sets the

> site.exp HOSTCXX to the discovered bootstrap compiler

> 

> Whereas, configuring with a plain …/configure  .. sets HOSTCXX to prev-gcc/xg++.

> 

> In the latter case, the “host” compiler can respond to TEST_ALWAYS_FLAGS, in the former cases

> it cannot necessarily (unless one is bootstrapping with gcc-9).

> 

> The patch below removes  TEST_ALWAYS_FLAGS from the generator build - and the tests pass for

> me on x86_64-linux and x86_64-darwin with various configuration lines.

> 

> If that doesn’t cover enough cases, and it’s really necessary that the generator is built with

> TEST_ALWAYS_FLAGS, then support for them in HOSTCXX needs to be checked (there is already a

> check for the host compiler support for c++11).

> 

> OK for trunk?

> thanks

> Iain

> 

> gcc/testsuite/

> 

> 	* gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp (runtest_ms_sysv): Don’t

> 	assume that the HOSTCXX supports TEST_ALWAYS_FLAGS.

OK.
jeff

Patch

diff --git a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp
index bfdb787..f42b9be 100644
--- a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp
+++ b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp
@@ -109,7 +109,7 @@  proc runtest_ms_sysv { cflags generator_args } {
 					   < [file mtime "$src"]) } {
 	# Temporarily switch to the environment for the host compiler.
 	restore_ld_library_path_env_vars
-	set cxx "$HOSTCXX $HOSTCXXFLAGS $TEST_ALWAYS_FLAGS $warn_flags -std=c++11"
+	set cxx "$HOSTCXX $HOSTCXXFLAGS $warn_flags -std=c++11"
 	set status [remote_exec host "$cxx -o $generator $src"]
 	set status [lindex $status 0]
 	set_ld_library_path_env_vars