This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [8/8] Tidy up testsuite handling of LD_LIBRARY_PATH (needs testsuite maintainer)
I just wanted to say a public "sorry" for all the fallout from this patch.
Something obviosly went wrong with my testing.
David Edelsohn <dje.gcc@gmail.com> writes:
> The appended patch fixes libgomp for me. I do not know if there is a
> better / cleaner way. I tried setting TARGET_OPTIONS to -pthread for
> target AIX, but that did not seem to affect the multilib directory
> choice.
libgomp stores various libgomp-specific options in a variable called
ALWAYS_CFLAGS. These options are then used in every compilation test.
The problem is that the same options aren't included when running
"$cc --print-multi-lib", so the compiler isn't aware that
we're using -fopenmp, and thus need pthreads.
The patch below "fixes" this. I sent it to David privately because the
AIX machine I use is down at the moment, and he confirms it fixes the
problem (thanks!). OK to install?
Richard
libgomp/
* testsuite/lib/libgomp.exp (libgomp_init): Use the ALWAYS_CFLAGS
options when choosing a multilib.
Index: libgomp/testsuite/lib/libgomp.exp
===================================================================
--- libgomp/testsuite/lib/libgomp.exp 2009-07-01 09:02:12.000000000 +0100
+++ libgomp/testsuite/lib/libgomp.exp 2009-07-02 18:18:12.000000000 +0100
@@ -86,9 +86,6 @@ proc libgomp_init { args } {
set CFLAGS ""
}
- set always_ld_library_path "${blddir}/.libs"
- add_path always_ld_library_path [find_libgcc_s $GCC_UNDER_TEST]
-
set ALWAYS_CFLAGS ""
if { $blddir != "" } {
lappend ALWAYS_CFLAGS "additional_flags=-B${blddir}/"
@@ -122,6 +119,16 @@ proc libgomp_init { args } {
# And, gee, turn on OpenMP.
lappend ALWAYS_CFLAGS "additional_flags=-fopenmp"
+
+ set compiler $GCC_UNDER_TEST
+ foreach flag $ALWAYS_CFLAGS {
+ if { [regexp {^(additional_flags|ldflags)=(.*)} $flag d1 d2 option] } {
+ lappend compiler $option
+ }
+ }
+
+ set always_ld_library_path "${blddir}/.libs"
+ add_path always_ld_library_path [find_libgcc_s $compiler]
}
#