From: David S. Miller Date: Mon, 18 Apr 2005 22:23:46 +0000 (+0000) Subject: gcconfig.h (sparc-linux): Use LINUX_STACKBOTTOM. X-Git-Tag: releases/gcc-3.4.4~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=021e066bb3c26e318dc9b0f448786d23d4a681c7;p=thirdparty%2Fgcc.git gcconfig.h (sparc-linux): Use LINUX_STACKBOTTOM. * include/private/gcconfig.h (sparc-linux): Use LINUX_STACKBOTTOM. * os_dep.c (GC_linux_stack_base): Check for bug present in some Sparc glibc variants where __libc_stack_end is erroneously set to "1". Fallback to procfs code in that case. From-SVN: r98353 --- diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index 9f6653d37b16..ac20a553819a 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,10 @@ +2005-04-17 David S. Miller + + * include/private/gcconfig.h (sparc-linux): Use LINUX_STACKBOTTOM. + * os_dep.c (GC_linux_stack_base): Check for bug present in some + Sparc glibc variants where __libc_stack_end is erroneously set + to "1". Fallback to procfs code in that case. + 2005-04-11 Richard Henderson * include/private/gcconfig.h (alpha-linux): Use LINUX_STACKBOTTOM. diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h index 1510089abf71..586f31daf41b 100644 --- a/boehm-gc/include/private/gcconfig.h +++ b/boehm-gc/include/private/gcconfig.h @@ -897,12 +897,10 @@ extern ptr_t GC_SysVGetDataStart(); # ifdef __arch64__ # define DATASTART GC_SysVGetDataStart(0x100000, _etext) - /* libc_stack_end is not set reliably for sparc64 */ -# define STACKBOTTOM ((ptr_t) 0x80000000000ULL) # else # define DATASTART GC_SysVGetDataStart(0x10000, _etext) -# define LINUX_STACKBOTTOM # endif +# define LINUX_STACKBOTTOM # endif # ifdef OPENBSD # define OS_TYPE "OPENBSD" diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c index fd195e1c806c..0e51d75db281 100644 --- a/boehm-gc/os_dep.c +++ b/boehm-gc/os_dep.c @@ -912,7 +912,16 @@ ptr_t GC_get_stack_base() } /* Otherwise it's not safe to add 16 bytes and we fall */ /* back to using /proc. */ # else +# ifdef SPARC + /* Older versions of glibc for 64-bit Sparc do not set + * this variable correctly, it gets set to either zero + * or one. + */ + if (__libc_stack_end != (ptr_t) (unsigned long)0x1) + return __libc_stack_end; +# else return __libc_stack_end; +# endif # endif } f = open("/proc/self/stat", O_RDONLY);