From: Jakub Jelinek Date: Thu, 12 Jun 2008 11:17:05 +0000 (+0200) Subject: re PR testsuite/36443 (HOSTCC doesn't work with installed gcc) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b5a6bf2e7efa45182f8a730d0c8e845a313754c4;p=gcc.git re PR testsuite/36443 (HOSTCC doesn't work with installed gcc) PR testsuite/36443 * gcc.dg/compat/struct-layout-1.exp: Temporarily unset GCC_EXEC_PREFIX from environment when running $HOSTCC. * g++.dg/compat/struct-layout-1.exp: Likewise. From-SVN: r136698 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7155d912413..55555f770e5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2008-06-12 Jakub Jelinek + + PR testsuite/36443 + * gcc.dg/compat/struct-layout-1.exp: Temporarily unset + GCC_EXEC_PREFIX from environment when running $HOSTCC. + * g++.dg/compat/struct-layout-1.exp: Likewise. + 2008-06-12 Richard Guenther PR tree-optimization/36345 diff --git a/gcc/testsuite/g++.dg/compat/struct-layout-1.exp b/gcc/testsuite/g++.dg/compat/struct-layout-1.exp index 8aaa79eeaa3..edaf1fa34f5 100644 --- a/gcc/testsuite/g++.dg/compat/struct-layout-1.exp +++ b/gcc/testsuite/g++.dg/compat/struct-layout-1.exp @@ -128,8 +128,19 @@ set generator_src "$generator_src $srcdir/$subdir/../../gcc.dg/compat/generate-r set generator_src "$generator_src $srcdir/$subdir/../../gcc.dg/compat/generate-random_r.c" set generator_cmd "-o $generator $generator_src" +# Temporarily unset GCC_EXEC_PREFIX from environment, as that might +# confuse the $HOSTCC. +if [info exists env(GCC_EXEC_PREFIX)] { + set orig_gcc_exec_prefix "$env(GCC_EXEC_PREFIX)" + set orig_gcc_exec_prefix_saved 1 + unsetenv GCC_EXEC_PREFIX +} set status [remote_exec host "$HOSTCC $HOSTCFLAGS $generator_cmd"] set status [lindex $status 0] +if { $orig_gcc_exec_prefix_saved } { + set orig_gcc_exec_prefix_saved 0 + setenv GCC_EXEC_PREFIX "$orig_gcc_exec_prefix" +} if { $status == 0 } then { file delete -force $tstobjdir file mkdir $tstobjdir diff --git a/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp b/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp index f26abc5de0a..47588c9fe1e 100644 --- a/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp +++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1.exp @@ -90,8 +90,19 @@ set generator_src "$generator_src $srcdir/$subdir/generate-random.c" set generator_src "$generator_src $srcdir/$subdir/generate-random_r.c" set generator_cmd "-o $generator $skip_dfp $generator_src" +# Temporarily unset GCC_EXEC_PREFIX from environment, as that might +# confuse the $HOSTCC. +if [info exists env(GCC_EXEC_PREFIX)] { + set orig_gcc_exec_prefix "$env(GCC_EXEC_PREFIX)" + set orig_gcc_exec_prefix_saved 1 + unsetenv GCC_EXEC_PREFIX +} set status [remote_exec host "$HOSTCC $HOSTCFLAGS $generator_cmd"] set status [lindex $status 0] +if { $orig_gcc_exec_prefix_saved } { + set orig_gcc_exec_prefix_saved 0 + setenv GCC_EXEC_PREFIX "$orig_gcc_exec_prefix" +} if { $status == 0 } then { file delete -force $tstobjdir file mkdir $tstobjdir