summaryrefslogtreecommitdiff
path: root/boehm-gc/os_dep.c
diff options
context:
space:
mode:
authordavem <davem@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-17 22:01:21 +0000
committerdavem <davem@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-17 22:01:21 +0000
commit96e1a4c2e481e7f7868cc3e8e4769729bf99b7a4 (patch)
tree6070b7e1958a3b47be4d8b147bcdb1497807a8f2 /boehm-gc/os_dep.c
parent908c697e9e419d3f9d870eafcf400a7b9f927695 (diff)
downloadgcc-96e1a4c2e481e7f7868cc3e8e4769729bf99b7a4.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98303 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'boehm-gc/os_dep.c')
-rw-r--r--boehm-gc/os_dep.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c
index 21d05635ab8..30c2b8bc4ab 100644
--- a/boehm-gc/os_dep.c
+++ b/boehm-gc/os_dep.c
@@ -945,8 +945,17 @@ 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);
if (f < 0 || STAT_READ(f, stat_buf, STAT_BUF_SIZE) < 2 * STAT_SKIP) {