aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc/os_dep.c
diff options
context:
space:
mode:
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 fd195e1c806..0e51d75db28 100644
--- a/boehm-gc/os_dep.c
+++ b/boehm-gc/os_dep.c
@@ -912,8 +912,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) {