This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
3.0.2 PATCH: Fix Solaris 2/Intel support in boehm-gc
- To: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Subject: 3.0.2 PATCH: Fix Solaris 2/Intel support in boehm-gc
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- Date: Tue, 25 Sep 2001 17:59:58 +0200 (MEST)
- Cc: Hans Boehm <hans_boehm at hp dot com>, Richard Henderson <rth at redhat dot com>
This patch is a companion to
http://gcc.gnu.org/ml/gcc-patches/2001-09/msg01071.html
and makes boehm-gc work on Solaris 2/Intel (i386-pc-solaris2.9). With this
patch, gctest works both in the statically and dynamically linked cases,
and the libjava testsuite passes (provided
http://gcc.gnu.org/ml/java/2001-06/msg00247.html or an equivalent patch to
make the libjava testsuite to work on Solaris 2 is applied):
=== libjava Summary ===
# of expected passes 1660
# of unexpected failures 8
# of unexpected successes 10
# of expected failures 14
# of untested testcases 24
The patch contains three parts:
* With lots of debugging help from Hans Boehm, it turned out that the
DATASTART and DATAEND definitions were wrong: neither etext nor end do
exist, but _etext and _end do. The STACKBOTTOM change is already on the
trunk.
* Using PROC_VDB reduces gctest runtime from 27.8 to 6.9 seconds, so it is
very desirable performance-wise. I can confirm that it works in Solaris
8 and 9, so I statically enable it for those releases. If anyone can
confirm that it works in 2.6 and/or 7, or knows a Sun Bug Id or testcase,
this could be extended to other releases.
* Solaris 2/Intel uses a default stack size limit slighly larger than 8 MB,
thus triggering a warning for any program linked with libgcjgc.
Originally, this caused a large part of the libjava testsuite to fail, so
I enable the warning only if a non-default limit is used.
Ok for branch and mainline?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Email: ro@TechFak.Uni-Bielefeld.DE
Tue Sep 25 15:09:03 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* solaris_threads.c (MAX_ORIG_STACK_SIZE) [I386]: Provide special
Solaris 2/Intel definition.
(GC_get_orig_stack_size): NL-terminate warning message.
* configure.in (i?86-*-solaris2.[89]*): Define
SOLARIS25_PROC_VDB_BUG_FIXED.
* gcconfig.h [I386 && SUNOS5]: Use it.
* configure: Regenerate.
* gcconfig.h [I386 && SUNOS5] (DATASTART): Use _etext.
(DATAEND): Define using _end.
(STACKBOTTOM): Define.
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/configure.in,v
retrieving revision 1.21.4.2
diff -u -p -r1.21.4.2 configure.in
--- configure.in 2001/06/08 17:59:15 1.21.4.2
+++ configure.in 2001/09/25 13:42:25
@@ -105,6 +105,9 @@ case "$host" in
# alpha*-*-*)
# machdep="alpha_mach_dep.lo"
# ;;
+ i?86-*-solaris2.[[89]]*)
+ AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED)
+ ;;
mipstx39-*-elf*)
machdep="mips_ultrix_mach_dep.lo"
AC_DEFINE(STACKBASE, __stackbase)
Index: gcconfig.h
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/Attic/gcconfig.h,v
retrieving revision 1.15.4.2
diff -u -p -r1.15.4.2 gcconfig.h
--- gcconfig.h 2001/04/05 00:13:13 1.15.4.2
+++ gcconfig.h 2001/09/25 13:42:25
@@ -722,12 +722,16 @@
# endif
# ifdef SUNOS5
# define OS_TYPE "SUNOS5"
- extern int etext, _start;
+ extern int _etext, _end;
extern char * GC_SysVGetDataStart();
-# define DATASTART GC_SysVGetDataStart(0x1000, &etext)
-# define STACKBOTTOM ((ptr_t)(&_start))
+# define DATASTART GC_SysVGetDataStart(0x1000, &_etext)
+# define DATAEND (&_end)
+# include <sys/vm.h>
+# define STACKBOTTOM USRSTACK
/** At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
-/*# define PROC_VDB*/
+# ifdef SOLARIS25_PROC_VDB_BUG_FIXED
+# define PROC_VDB
+# endif
# define DYNAMIC_LOADING
# ifndef USE_MMAP
# define USE_MMAP
Index: solaris_threads.c
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/solaris_threads.c,v
retrieving revision 1.4
diff -u -p -r1.4 solaris_threads.c
--- solaris_threads.c 2000/04/19 10:09:58 1.4
+++ solaris_threads.c 2001/09/25 13:42:25
@@ -616,7 +616,18 @@ GC_thread GC_lookup_thread(thread_t id)
return(p);
}
+/* Solaris 2/Intel uses an initial stack size limit slightly bigger than the
+ SPARC default of 8 MB. Account for this to warn only if the user has
+ raised the limit beyond the default.
+
+ This is identical to DFLSSIZ defined in <sys/vm_machparam.h>. This file
+ is installed in /usr/platform/`uname -m`/include, which is not in the
+ default include directory list, so copy the definition here. */
+#ifdef I386
+# define MAX_ORIG_STACK_SIZE (8 * 1024 * 1024 + ((USRSTACK) & 0x3FFFFF))
+#else
# define MAX_ORIG_STACK_SIZE (8 * 1024 * 1024)
+#endif
word GC_get_orig_stack_size() {
struct rlimit rl;
@@ -627,7 +638,7 @@ word GC_get_orig_stack_size() {
result = (word)rl.rlim_cur & ~(HBLKSIZE-1);
if (result > MAX_ORIG_STACK_SIZE) {
if (!warned) {
- WARN("Large stack limit(%ld): only scanning 8 MB", result);
+ WARN("Large stack limit(%ld): only scanning 8 MB\n", result);
warned = 1;
}
result = MAX_ORIG_STACK_SIZE;