[testsuite] Don't explicitly link libgomp tests with -lgomp (PR target/49541)

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Mon Jul 18 12:20:00 GMT 2011


As described in the PR, the fact that the libgomp testsuite always links
with -lgomp, even with -fno-openmp, causes testsuite failures on targets
(like Solaris) that need special options when linking libgomp.  With
-fgomp, this is taken care of by the relevant specs (like adding
-pthread), but not so otherwise.

I found no reason for that explicit -lgomp since this is already dealt
with by -fopenmp.

The following patch fixes the failures on Solaris 8 and was tested with
make check in libgomp on sparc-sun-solaris2.8, i386-pc-solaris2.10, and
x86_64-unknown-linux-gnu.

Ok for mainline and 4.6 branch?

	Rainer


2011-07-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR target/49541
	* testsuite/lib/libgomp.exp (libgomp_init): Don't add -lgomp to
	ldflags.

diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -137,7 +137,6 @@ proc libgomp_init { args } {
         lappend ALWAYS_CFLAGS "ldflags=-L${blddir}/.libs"
     }
     lappend ALWAYS_CFLAGS "additional_flags=-I${srcdir}/.."
-    lappend ALWAYS_CFLAGS "ldflags=-lgomp"
 
     # We use atomic operations in the testcases to validate results.
     if { ([istarget i?86-*-*] || [istarget x86_64-*-*])


-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University



More information about the Gcc-patches mailing list