This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

Re: 4.1/4.2/4.3 PATCH: Switch boehm-gc to pthreads on Solaris (boehm-gc/21940, boehm-gc/21942)


Rainer Orth wrote:
As described in PR boehm-gc/21940, gctest fails on Solaris 10/x86.  PR
boehm-gc/21942 describes that the 64-bit version of boehm-gc doesn't build
at all.  Hans Boehm had long ago suggested to switch from the Solaris
threads support to pthreads, and the hacky patch in the PR demonstrated
that this works.

I've finally cleaned up the patch and tested it on both sparc and x86.  gc
7.0 alpha already includes the Solaris 2/amd64 clause in gcconfig.h and
made the switch to pthreads.  Unlike that version, I had to use
GC_SOLARIS_PTHREADS to mean pthreads on Solaris because it turned out to
be quite invasive to untangle all uses of GC_SOLARIS_THREADS.

With this patch, gctest works in both 32 and 64 bit versions on Solaris 10
(both sparc and x86).

The patch massively improves libjava testsuite results on both platforms,
which makes the switch even more desirable.

Right now, mainline libjava fails to build on x86 since several object
files contain non-PIC code.  I still need to investigate this, but it might
be related to the libtool upgrade.

Bootstrapped without regressions on sparc-sun-solaris2.10 and
i386-pc-solaris2.10 (mainline and 4.2 branch on sparc, 4.2 branch only on
x86).   Ok for both (mainline after the lockdown)?

I might also test the patch on the 4.1 branch if there's interest.


I tried this patch on solaris8 sparc and I saw an improvement in the libgcj test (32 and 64 bit). But I hang in the gctest. I might debug next week.


Index: pthread_support.c
===================================================================
--- pthread_support.c	(revision 125718)
+++ pthread_support.c	(working copy)
@@ -883,7 +883,8 @@ void GC_thr_init()
 #       if defined(GC_HPUX_THREADS)
 	  GC_nprocs = pthread_num_processors_np();
 #       endif
-#	if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS)
+#	if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS) || \
+	   defined(GC_SOLARIS_PTHREADS)

Minor nit, please put the logical operator on the next line:


#	if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS) \
	   || defined(GC_SOLARIS_PTHREADS)


Thanks, Andreas


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