This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Only use /usr/lib/lwp in boehm-gc on Solaris 8


I've recently had to look at boehm-gc (gctest crashes with a SEGV and
all libgcj tests hang when boehm-gc was built with CVS GNU as and ld),
and noticed the following snippet, which, though harmless, is
superfluous on anything but Solaris 8:

     *-*-solaris*)
	AC_DEFINE(GC_SOLARIS_PTHREADS,1,[support for Solaris pthreads])
	# Need to use alternate thread library, otherwise gctest hangs
	# on Solaris 8.
	multi_os_directory=`$CC -print-multi-os-directory`
	THREADLIBS="-L/usr/lib/lwp/$multi_os_directory \
		    -R/usr/lib/lwp/$multi_os_directory -lpthread -lthread -lrt"
	;;

This alternate thread library was introduced in Solaris 8, but became
the default in Solaris 9 and up, so on those versions the change is
pointless.  /usr/lib/lwp contains just a libthread.so.1 ->
../libthread.so.1 symlink there, and is thus has no effect at compile
time, and the -L/-R combo isn't needed as well.

Ok for mainline?

	Rainer

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


2010-02-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	boehm-gc:
	* configure.ac (*-*-solaris2.8*): Only usr alternate thread
	library on Solaris 8.
	(*-*-solaris2*): Use regular thread library otherwise.
	* configure: Regenerate.

diff -r 6eb2373e8848 boehm-gc/configure.ac
--- a/boehm-gc/configure.ac	Sun Feb 28 02:38:25 2010 +0100
+++ b/boehm-gc/configure.ac	Sun Feb 28 08:15:45 2010 +0100
@@ -1,4 +1,5 @@
-# Copyright (c) 1999, 2000, 2001, 2002, 2003, 2006 by Red Hat, Inc. All rights reserved.
+# Copyright (c) 1999, 2000, 2001, 2002, 2003, 2006, 2010 by Red Hat, Inc.
+# All rights reserved.
 # Copyright 2004 Nathanael Nerode
 # 
 # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
@@ -179,7 +180,7 @@
 	AM_CPPFLAGS="$AM_CPPFLAGS -pthread"
 	THREADLIBS=-pthread
       	;;
-     *-*-solaris*)
+     *-*-solaris2.8*)
 	AC_DEFINE(GC_SOLARIS_PTHREADS,1,[support for Solaris pthreads])
 	# Need to use alternate thread library, otherwise gctest hangs
 	# on Solaris 8.
@@ -187,6 +188,13 @@
 	THREADLIBS="-L/usr/lib/lwp/$multi_os_directory \
 		    -R/usr/lib/lwp/$multi_os_directory -lpthread -lthread -lrt"
 	;;
+     *-*-solaris2*)
+	AC_DEFINE(GC_SOLARIS_PTHREADS,1,[support for Solaris pthreads])
+	# 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
+	;;
      *-*-irix*)
 	AC_DEFINE(GC_IRIX_THREADS,1,[support for Irix pthreads])
 	;;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]