I would like to push this libgomp patch upstream. We need it to pass sysroot to GCC when testing libgomp.
Tested on x86_64. OK for trunk? Thanks. Diego. ---------- Forwarded message ---------- From: Simon Baldwin <sim...@google.com> Date: Fri, Jan 28, 2011 at 11:30 Subject: [google] Pass CC to the libgomp testsuite to capture -sysroot To: gcc-patches@gcc.gnu.org Pass CC to the libgomp testsuite to capture -sysroot. Pass CC to the libgomp testsuite. This is required for running tests where gcc is configured with a custom sysroot, and CC therefore includes a -sysroot flag. Targeted for the google/integration branch. libgomp/ChangeLog.google: 2011-01-28 Simon Baldwin <sim...@google.com> * configure.ac: Add testsuite/gompconfig.exp to config files. * configure: Rebuild from configure.ac. * testsuite/config/default.exp: Load gompconfig.exp. * testsuite/lib/libgomp.exp (libgomp_init): Exec all of $CC_UNDER_TEST. * libgomp/testsuite/gompconfig.exp.in: New. Google ref: 39294 Index: libgomp/configure =================================================================== --- libgomp/configure (revision 169355) +++ libgomp/configure (working copy) @@ -16279,6 +16279,8 @@ ac_config_files="$ac_config_files omp.h ac_config_files="$ac_config_files Makefile testsuite/Makefile libgomp.spec" +ac_config_files="$ac_config_files testsuite/gompconfig.exp" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -17423,6 +17425,7 @@ do "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; "libgomp.spec") CONFIG_FILES="$CONFIG_FILES libgomp.spec" ;; + "testsuite/gompconfig.exp") CONFIG_FILES="$CONFIG_FILES testsuite/gompconfig.exp" ;; *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac Index: libgomp/configure.ac =================================================================== --- libgomp/configure.ac (revision 169355) +++ libgomp/configure.ac (working copy) @@ -347,4 +347,5 @@ CFLAGS="$save_CFLAGS" AC_CONFIG_FILES(omp.h omp_lib.h omp_lib.f90 libgomp_f.h) AC_CONFIG_FILES(Makefile testsuite/Makefile libgomp.spec) +AC_CONFIG_FILES(testsuite/gompconfig.exp) AC_OUTPUT Index: libgomp/testsuite/config/default.exp =================================================================== --- libgomp/testsuite/config/default.exp (revision 169355) +++ libgomp/testsuite/config/default.exp (working copy) @@ -15,3 +15,4 @@ # <http://www.gnu.org/licenses/>. load_lib "standard.exp" +load_lib "gompconfig.exp" Index: libgomp/testsuite/lib/libgomp.exp =================================================================== --- libgomp/testsuite/lib/libgomp.exp (revision 169355) +++ libgomp/testsuite/lib/libgomp.exp (working copy) @@ -110,10 +110,9 @@ proc libgomp_init { args } { append always_ld_library_path ":${gccdir}/pthread" } append always_ld_library_path ":${gccdir}" - set compiler [lindex $GCC_UNDER_TEST 0] - if { [is_remote host] == 0 && [which $compiler] != 0 } { - foreach i "[exec $compiler --print-multi-lib]" { + if { [is_remote host] == 0 } { + foreach i "[eval "exec $GCC_UNDER_TEST --print-multi-lib"]" { set mldir "" regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir set mldir [string trimright $mldir "\;@"] Index: libgomp/testsuite/gompconfig.exp.in =================================================================== --- libgomp/testsuite/gompconfig.exp.in (revision 0) +++ libgomp/testsuite/gompconfig.exp.in (revision 0) @@ -0,0 +1,2 @@ +global GCC_UNDER_TEST +set GCC_UNDER_TEST "@CC@"