Patchwork [libgomp] Link libgomp with -lpthread on IRIX 6

login
register
mail settings
Submitter Rainer Orth
Date Nov. 30, 2010, 4:07 p.m.
Message ID <yddwrnu3idf.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/73621/
State New
Headers show

Comments

Rainer Orth - Nov. 30, 2010, 4:07 p.m.
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.

Patch

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"
+	;;
   *)
 	;;