re PR testsuite/36443 (HOSTCC doesn't work with installed gcc)
authorH.J. Lu <hongjiu.lu@intel.com>
Thu, 17 Jul 2008 05:13:27 +0000 (05:13 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Thu, 17 Jul 2008 05:13:27 +0000 (22:13 -0700)
2008-07-17  H.J. Lu  <hongjiu.lu@intel.com>

PR testsuite/36443
* objc.dg/gnu-encoding/gnu-encoding.exp: Temporarily unset
GCC_EXEC_PREFIX from environment when running $HOSTCC.

From-SVN: r137909

gcc/testsuite/ChangeLog
gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp

index 76d17516bc67ad76c231a8109677da9352456cd9..0eb8eaa2bafc8e68931e2a7824b7b07a77e37241 100644 (file)
@@ -1,3 +1,9 @@
+2008-07-17  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR testsuite/36443
+       * objc.dg/gnu-encoding/gnu-encoding.exp: Temporarily unset
+       GCC_EXEC_PREFIX from environment when running $HOSTCC.
+
 2008-07-16  Dodji Seketeli  <dseketel@redhat.com>
 
        PR c++/13699
index dc4d9245a32655de82d41a919a401a96aec8a3bf..75d1dcf63166b4ab30306034bded64a9547c6a15 100644 (file)
@@ -37,8 +37,20 @@ set generator_src "$srcdir/$subdir/struct-layout-encoding-1_generate.c"
 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 $generator_src"
+# Temporarily unset GCC_EXEC_PREFIX from environment, as that might
+# confuse the $HOSTCC.
+set orig_gcc_exec_prefix_saved 0
+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 build "$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