]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Enable __gnat_alternate_stack for most linux
authorRichard Henderson <rth@redhat.com>
Tue, 22 Apr 2014 16:51:14 +0000 (09:51 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 22 Apr 2014 16:51:14 +0000 (09:51 -0700)
* init.c [__linux__] (HAVE_GNAT_ALTERNATE_STACK): New define.
(__gnat_alternate_stack): Enable for all linux except ia64.

From-SVN: r209653

gcc/ada/ChangeLog
gcc/ada/init.c

index 96bc09b95152f7f81d46a94bb109952e05a5ddd8..0d3c7920e0e4454fd1a10642f15767f04acb3e98 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-22  Richard Henderson  <rth@redhat.com>
+
+       * init.c [__linux__] (HAVE_GNAT_ALTERNATE_STACK): New define.
+       (__gnat_alternate_stack): Enable for all linux except ia64.
+
 2014-04-22  Eric Botcazou  <ebotcazou@adacore.com>
 
        * fe.h (Compiler_Abort): Replace Fat_Pointer with String_Pointer.
index c3824ab7ef30b945ebf75e660c7716f1cf870b7e..48319d62f413262674819ec9dad43d064e32c607 100644 (file)
@@ -556,9 +556,14 @@ __gnat_error_handler (int sig, siginfo_t *si ATTRIBUTE_UNUSED, void *ucontext)
   Raise_From_Signal_Handler (exception, msg);
 }
 
-#if defined (i386) || defined (__x86_64__) || defined (__powerpc__)
-/* This must be in keeping with System.OS_Interface.Alternate_Stack_Size.  */
-char __gnat_alternate_stack[16 * 1024]; /* 2 * SIGSTKSZ */
+#ifndef __ia64__
+#define HAVE_GNAT_ALTERNATE_STACK 1
+/* This must be in keeping with System.OS_Interface.Alternate_Stack_Size.
+   It must be larger than MINSIGSTKSZ and hopefully near 2 * SIGSTKSZ.  */
+# if 16 * 1024 < MINSIGSTKSZ
+#  error "__gnat_alternate_stack too small"
+# endif
+char __gnat_alternate_stack[16 * 1024];
 #endif
 
 #ifdef __XENO__
@@ -612,7 +617,7 @@ __gnat_install_handler (void)
     sigaction (SIGBUS,  &act, NULL);
   if (__gnat_get_interrupt_state (SIGSEGV) != 's')
     {
-#if defined (i386) || defined (__x86_64__) || defined (__powerpc__)
+#ifdef HAVE_GNAT_ALTERNATE_STACK
       /* Setup an alternate stack region for the handler execution so that
         stack overflows can be handled properly, avoiding a SEGV generation
         from stack usage by the handler itself.  */