]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcconfig.h (sparc-linux): Use LINUX_STACKBOTTOM.
authorDavid S. Miller <davem@davemloft.net>
Mon, 18 Apr 2005 22:23:46 +0000 (22:23 +0000)
committerDavid S. Miller <davem@gcc.gnu.org>
Mon, 18 Apr 2005 22:23:46 +0000 (15:23 -0700)
* 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

boehm-gc/ChangeLog
boehm-gc/include/private/gcconfig.h
boehm-gc/os_dep.c

index 9f6653d37b1627d4d7a51a202e23c5ca19a24808..ac20a553819ab37fa444529e326f990acd5deb03 100644 (file)
@@ -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.
index 1510089abf717fb1c9ad95a5d15de468c1e82b70..586f31daf41bd98a9c34f5964b299b03b7695293 100644 (file)
       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"
index fd195e1c806c6b9acdfa775fd4d0b4a5d584b984..0e51d75db281091b5b2632095eb9547f35b7f539 100644 (file)
@@ -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);