diff mbox

[build] Link libgcjgc with -lrt on Solaris > 8

Message ID yddr5bt9npx.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Jan. 31, 2011, 2:01 p.m. UTC
Testing my boehm-gc testsuite patch

	[testsuite, build] Convert boehm-gc testsuite to DejaGnu (PR boehm-gc/11412)
        http://gcc.gnu.org/ml/gcc-patches/2011-01/msg01638.html

on Solaris < 11 revealed that my last cleanup

	PATCH: Only use /usr/lib/lwp in boehm-gc on Solaris 8
        http://gcc.gnu.org/ml/gcc-patches/2010-03/msg00128.html

has been over-eager in removing -lrt beyond Solaris 8: all tests failed
because libgcjgc.so references sched_yield and sem_* functions, which
only live in librt before Solaris 11.

This patch fixes this and lets the boehm-gc DejaGnu testsuite pass on
Solaris 8 to 11, SPARC and x86.

Installed.

	Rainer


2011-01-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* configure.ac (*-*-solaris2*): Add -lrt to THREADLIBS.
	* configure: Regenerate.
diff mbox

Patch

diff -r e5d3f67cc78f boehm-gc/configure.ac
--- a/boehm-gc/configure.ac	Sat Jan 08 01:34:09 2011 +0100
+++ b/boehm-gc/configure.ac	Sat Jan 08 02:17:03 2011 +0100
@@ -193,7 +193,9 @@ 
 	# The alternate thread library was only introduced in Solaris 8 and
 	# became the default in Solaris 9, so no need for the special code
 	# above otherwise.
-	THREADLIBS=-lpthread
+	# nanosleep, sched_yield, and sem_* only live in librt before
+	# Solaris 11.
+	THREADLIBS="-lpthread -lrt"
 	;;
      *-*-irix*)
 	AC_DEFINE(GC_IRIX_THREADS,1,[support for Irix pthreads])