This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[libgomp] Link libgomp with -lpthread on IRIX 6
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 30 Nov 2010 17:07:24 +0100
- Subject: [libgomp] Link libgomp with -lpthread on IRIX 6
Four libgomp testcases are currently failing on mips-sgi-irix6.5:
FAIL: libgomp.fortran/condinc2.f -O execution test
FAIL: libgomp.fortran/condinc4.f90 -O execution test
FAIL: libgomp.fortran/omp_cond2.f -O execution test
FAIL: libgomp.fortran/omp_cond4.F90 -O execution test
The failure is like this:
342447:./condinc2.exe: rld: Error: unresolvable symbol in /var/gcc/regression/trunk/6.5-gcc/build/mips-sgi-irix6.5/./libgomp/.libs/libgomp.so.2: pthread_setspecific
342447:./condinc2.exe: rld: Error: unresolvable symbol in /var/gcc/regression/trunk/6.5-gcc/build/mips-sgi-irix6.5/./libgomp/.libs/libgomp.so.2: pthread_attr_getstacksize
342447:./condinc2.exe: rld: Error: unresolvable symbol in /var/gcc/regression/trunk/6.5-gcc/build/mips-sgi-irix6.5/./libgomp/.libs/libgomp.so.2: pthread_key_create
342447:./condinc2.exe: rld: Error: unresolvable symbol in /var/gcc/regression/trunk/6.5-gcc/build/mips-sgi-irix6.5/./libgomp/.libs/libgomp.so.2: pthread_key_delete
342447:./condinc2.exe: rld: Error: unresolvable symbol in /var/gcc/regression/trunk/6.5-gcc/build/mips-sgi-irix6.5/./libgomp/.libs/libgomp.so.2: pthread_getspecific
342447:./condinc2.exe: rld: Fatal Error: this executable has unresolvable symbols
While IRIX 6 has many pthread functions in libc, some are missing and
one needs to link with -lpthread to get them. This is exactly what the
following patch does.
Tested by rebuilding libgomp and running make check for both multilibs.
Will install on mainline shortly, and backport to the 4.5 and eventually
4.4 branches after testing.
Rainer
2010-11-27 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* configure.tgt (mips-sgi-irix6*): Add -lpthread to XLDFLAGS.
diff -r 6fa06fdbdfaa libgomp/configure.tgt
--- a/libgomp/configure.tgt Mon Nov 22 21:05:42 2010 +0100
+++ b/libgomp/configure.tgt Tue Nov 30 17:02:20 2010 +0100
@@ -124,6 +124,10 @@
config_path="bsd posix"
;;
+ mips-sgi-irix6*)
+ # Need to link with -lpthread so libgomp.so is self-contained.
+ XLDFLAGS="${XLDFLAGS} -lpthread"
+ ;;
*)
;;
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University