diff options
author | David S. Miller <davem@davemloft.net> | 2005-04-18 22:25:05 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-04-18 22:25:05 +0000 |
commit | 90a92065cbb945655892c492a4ddd52033005105 (patch) | |
tree | 4458baf079468d72396f2ab1bd5791040f795276 | |
parent | c45d5b1e32f3b14c35e556e34d571a34c95e61c1 (diff) |
* 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.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-3_3-branch@98354 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | boehm-gc/ChangeLog | 7 | ||||
-rw-r--r-- | boehm-gc/include/private/gcconfig.h | 3 | ||||
-rw-r--r-- | boehm-gc/os_dep.c | 9 |
3 files changed, 17 insertions, 2 deletions
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index e3f743e6fc6..19b8ead4e41 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,10 @@ +2005-04-17 David S. Miller <davem@davemloft.net> + + * 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 <rth@redhat.com> * 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 20768ea2dab..19825caf63d 100644 --- a/boehm-gc/include/private/gcconfig.h +++ b/boehm-gc/include/private/gcconfig.h @@ -821,12 +821,11 @@ # define SVR4 # ifdef __arch64__ /* libc_stack_end is not set reliably for sparc64 */ -# define STACKBOTTOM ((ptr_t) 0x80000000000) # define DATASTART (ptr_t)GC_SysVGetDataStart(0x100000, _etext) # else -# define LINUX_STACKBOTTOM # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, _etext) # 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 82386ec4fba..e129a7ad5a5 100644 --- a/boehm-gc/os_dep.c +++ b/boehm-gc/os_dep.c @@ -710,7 +710,16 @@ ptr_t GC_get_stack_base() /* First try the easy way. This should work for glibc 2.2 */ if (0 != &__libc_stack_end) { +# 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 } f = open("/proc/self/stat", O_RDONLY); if (f < 0 || STAT_READ(f, stat_buf, STAT_BUF_SIZE) < 2 * STAT_SKIP) { |