From 8f3e702b4f5e481efd9da3287688988be46262de Mon Sep 17 00:00:00 2001
From: ro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 26 Sep 2001 13:22:03 +0000
Subject: [PATCH] 	* solaris_threads.c (MAX_ORIG_STACK_SIZE) [I386]:
 Provide special 	Solaris 2/Intel definition.

	* configure.in (i?86-*-solaris2.[89]*): Define
	SOLARIS25_PROC_VDB_BUG_FIXED.
	* include/private/gcconfig.h [I386 && SUNOS5]: Use it.
	* configure: Regenerate.

	* include/private/gcconfig.h [I386 && SUNOS5] (DATASTART): Use _etext.
	(DATAEND): Define using _end.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45825 138bc75d-0d04-0410-961f-82ee72b054a4
---
 boehm-gc/ChangeLog                  | 13 +++++++++++++
 boehm-gc/configure                  |  6 ++++++
 boehm-gc/configure.in               |  3 +++
 boehm-gc/include/private/gcconfig.h |  9 ++++++---
 boehm-gc/solaris_threads.c          | 11 +++++++++++
 5 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog
index d1c9c04656f0..a97a5e940376 100644
--- a/boehm-gc/ChangeLog
+++ b/boehm-gc/ChangeLog
@@ -1,3 +1,16 @@
+2001-09-26  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	* solaris_threads.c (MAX_ORIG_STACK_SIZE) [I386]: Provide special
+	Solaris 2/Intel definition.
+	
+	* configure.in (i?86-*-solaris2.[89]*): Define
+	SOLARIS25_PROC_VDB_BUG_FIXED.
+	* include/private/gcconfig.h [I386 && SUNOS5]: Use it.
+	* configure: Regenerate.
+
+	* include/private/gcconfig.h [I386 && SUNOS5] (DATASTART): Use _etext.
+	(DATAEND): Define using _end.
+
 2001-09-11  Per Bothner  <per@bothner.com>
 
 	* include/Makefile.am:  New file.  It defines include_HEADERS.
diff --git a/boehm-gc/configure b/boehm-gc/configure
index b975d0c82022..79d9655842f7 100755
--- a/boehm-gc/configure
+++ b/boehm-gc/configure
@@ -2806,6 +2806,12 @@ machdep=
 case "$host" in
  alpha*-*-*)
     machdep="alpha_mach_dep.lo"
+    ;;
+ i?86-*-solaris2.[89]*)
+    cat >> confdefs.h <<\EOF
+#define SOLARIS25_PROC_VDB_BUG_FIXED 1
+EOF
+
     ;;
  mipstx39-*-elf*)
     machdep="mips_ultrix_mach_dep.lo"
diff --git a/boehm-gc/configure.in b/boehm-gc/configure.in
index 8fc2cdffbeca..48f69908fab8 100644
--- a/boehm-gc/configure.in
+++ b/boehm-gc/configure.in
@@ -153,6 +153,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)
diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h
index e8bac1bcdc29..4e20f48ade3a 100644
--- a/boehm-gc/include/private/gcconfig.h
+++ b/boehm-gc/include/private/gcconfig.h
@@ -838,9 +838,10 @@
 #   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 DATASTART GC_SysVGetDataStart(0x1000, &_etext)
+#	define DATAEND (&_end)
 /*	# define STACKBOTTOM ((ptr_t)(&_start)) worked through 2.7,  	*/
 /*      but reportedly breaks under 2.8.  It appears that the stack	*/
 /* 	base is a property of the executable, so this should not break	*/
@@ -849,7 +850,9 @@
 #       include <sys/vmparam.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
diff --git a/boehm-gc/solaris_threads.c b/boehm-gc/solaris_threads.c
index 8cc6319cd22e..a0d034069817 100644
--- a/boehm-gc/solaris_threads.c
+++ b/boehm-gc/solaris_threads.c
@@ -621,7 +621,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;
-- 
GitLab