From 2ae421dd9bed6eb2f8bb6b1c9906577755682618 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 17 Jul 2008 05:13:27 +0000 Subject: [PATCH] re PR testsuite/36443 (HOSTCC doesn't work with installed gcc) 2008-07-17 H.J. Lu 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 | 6 ++++++ gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 76d17516bc6..0eb8eaa2baf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2008-07-17 H.J. Lu + + 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 PR c++/13699 diff --git a/gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp b/gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp index dc4d9245a32..75d1dcf6316 100644 --- a/gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp +++ b/gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp @@ -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 -- 2.30.2