re PR testsuite/36443 (HOSTCC doesn't work with installed gcc)
authorJakub Jelinek <jakub@redhat.com>
Thu, 12 Jun 2008 11:17:05 +0000 (13:17 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 12 Jun 2008 11:17:05 +0000 (13:17 +0200)
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

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/compat/struct-layout-1.exp
gcc/testsuite/gcc.dg/compat/struct-layout-1.exp

index 7155d9124137be87702b1e7541abed272ea5be48..55555f770e599f39504dceb0007f0704a6ed961c 100644 (file)
@@ -1,3 +1,10 @@
+2008-06-12  Jakub Jelinek  <jakub@redhat.com>
+
+       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  <rguenther@suse.de>
 
        PR tree-optimization/36345
index 8aaa79eeaa3867fc38332757ec5eac69ad4cb7c8..edaf1fa34f53b66a0200be914c2671007f38c017 100644 (file)
@@ -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
index f26abc5de0a34ce69e72f193a2c5ab8a02203535..47588c9fe1edc1dd0cae93c606704527c6a527d4 100644 (file)
@@ -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