From 0106c5e573e0b1b690001d090e0190a58a13010b Mon Sep 17 00:00:00 2001 From: Peter Wang Date: Thu, 16 Jun 2016 12:16:05 +0300 Subject: [PATCH] Fix STACKBOTTOM for Solaris 11/x86 (Apply commit 81cae56 from 'master' branch.) * include/private/gcconfig.h [I386 && SOLARIS] (STACKBOTTOM, HEURISTIC2): Define conditionally depening on USERLIMIT - use HEURISTIC2 if USERLIMIT is undefined (workaround similar to that for Solaris/sparc and Solaris/x64); include sys/vmparam.h instead of sys/vm.h; update comment. --- include/private/gcconfig.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 3f682f47..b4fddc94 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -1201,8 +1201,16 @@ /* base is a property of the executable, so this should not break */ /* old executables. */ /* HEURISTIC2 probably works, but this appears to be preferable. */ -# include -# define STACKBOTTOM ((ptr_t) USRSTACK) +/* Apparently USRSTACK is defined to be USERLIMIT, but in some */ +/* installations that's undefined. We work around this with a */ +/* gross hack: */ +# include +# ifdef USERLIMIT + /* This should work everywhere, but doesn't. */ +# define STACKBOTTOM ((ptr_t)USRSTACK) +# else +# define HEURISTIC2 +# endif /* At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */ /* It appears to be fixed in 2.8 and 2.9. */ # ifdef SOLARIS25_PROC_VDB_BUG_FIXED -- 2.40.0