]> Savannah Git Hosting - gnulib.git/commitdiff
sigsegv, c-stack: Avoid compilation error with glibc >= 2.34.
authorBruno Haible <bruno@clisp.org>
Mon, 17 May 2021 00:13:12 +0000 (02:13 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 17 May 2021 00:19:22 +0000 (02:19 +0200)
* lib/sigsegv.in.h (SIGSTKSZ): On glibc systems, redefine to a suitable
constant.
* m4/sigaltstack.m4 (SV_SIGALTSTACK): Likewise.
* m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Likewise.

ChangeLog
lib/sigsegv.in.h
m4/c-stack.m4
m4/sigaltstack.m4

index 88f7944268a7c40eb5eb6f62a757dba0b1f84bb0..e3ab1ff0615ba3d3ad7800f68075079f75c678af 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2021-05-16  Bruno Haible  <bruno@clisp.org>
+
+       sigsegv, c-stack: Avoid compilation error with glibc >= 2.34.
+       * lib/sigsegv.in.h (SIGSTKSZ): On glibc systems, redefine to a suitable
+       constant.
+       * m4/sigaltstack.m4 (SV_SIGALTSTACK): Likewise.
+       * m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Likewise.
+
 2021-05-16  Bruno Haible  <bruno@clisp.org>
 
        sigsegv: Add tests.
index 1c87acc11141dd311541e25fa70bda620696426b..e442f4dfa5d9e14c1b12092f8b1fb82011b1b630 100644 (file)
 #endif
 
 /* Correct the value of SIGSTKSZ on some systems.
+   glibc >= 2.34: When _GNU_SOURCE is defined, SIGSTKSZ is no longer a
+   compile-time constant.  But most programs need a simple constant.
    AIX 64-bit: original value 4096 is too small.
    HP-UX: original value 8192 is too small.
    Solaris 11/x86_64: original value 8192 is too small.  */
+#include <signal.h>
+#if __GLIBC__ >= 2
+# undef SIGSTKSZ
+# if defined __ia64__
+#  define SIGSTKSZ 262144
+# else
+#  define SIGSTKSZ 65536
+# endif
+#endif
 #if defined _AIX && defined _ARCH_PPC64
-# include <signal.h>
 # undef SIGSTKSZ
 # define SIGSTKSZ 8192
 #endif
 #if defined __hpux || (defined __sun && (defined __x86_64__ || defined __amd64__))
-# include <signal.h>
 # undef SIGSTKSZ
 # define SIGSTKSZ 16384
 #endif
index 06b2594d430c406bb4e54d65d2696519a457197b..3131dd5475263ebe4000794aa2f8ce300abb39fd 100644 (file)
@@ -7,7 +7,7 @@
 
 # Written by Paul Eggert.
 
-# serial 21
+# serial 22
 
 AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
   [
@@ -44,6 +44,17 @@ AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
             # include <sys/time.h>
             # include <sys/resource.h>
             #endif
+            /* In glibc >= 2.34, when _GNU_SOURCE is defined, SIGSTKSZ is
+               no longer a compile-time constant.  But we need a simple
+               constant here.  */
+            #if __GLIBC__ >= 2
+            # undef SIGSTKSZ
+            # if defined __ia64__
+            #  define SIGSTKSZ 262144
+            # else
+            #  define SIGSTKSZ 16384
+            # endif
+            #endif
             #ifndef SIGSTKSZ
             # define SIGSTKSZ 16384
             #endif
@@ -149,6 +160,16 @@ AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
 #if HAVE_SYS_SIGNAL_H
 # include <sys/signal.h>
 #endif
+/* In glibc >= 2.34, when _GNU_SOURCE is defined, SIGSTKSZ is no longer a
+   compile-time constant.  But we need a simple constant here.  */
+#if __GLIBC__ >= 2
+# undef SIGSTKSZ
+# if defined __ia64__
+#  define SIGSTKSZ 262144
+# else
+#  define SIGSTKSZ 16384
+# endif
+#endif
 #ifndef SIGSTKSZ
 # define SIGSTKSZ 16384
 #endif
@@ -233,6 +254,17 @@ int main ()
                 # include <sys/time.h>
                 # include <sys/resource.h>
                 #endif
+                /* In glibc >= 2.34, when _GNU_SOURCE is defined, SIGSTKSZ is
+                   no longer a compile-time constant.  But we need a simple
+                   constant here.  */
+                #if __GLIBC__ >= 2
+                # undef SIGSTKSZ
+                # if defined __ia64__
+                #  define SIGSTKSZ 262144
+                # else
+                #  define SIGSTKSZ 16384
+                # endif
+                #endif
                 #ifndef SIGSTKSZ
                 # define SIGSTKSZ 16384
                 #endif
index 212e9d36a7d67db15315d3fa00362e49baede1ee..837191e5f13a855a35e08d685d999081f8a9af59 100644 (file)
@@ -1,4 +1,4 @@
-# sigaltstack.m4 serial 12
+# sigaltstack.m4 serial 13
 dnl Copyright (C) 2002-2021 Bruno Haible <bruno@clisp.org>
 dnl Copyright (C) 2008 Eric Blake <ebb9@byu.net>
 dnl This file is free software, distributed under the terms of the GNU
@@ -53,6 +53,16 @@ AC_DEFUN([SV_SIGALTSTACK],
 # include <sys/time.h>
 # include <sys/resource.h>
 #endif
+/* In glibc >= 2.34, when _GNU_SOURCE is defined, SIGSTKSZ is no longer a
+   compile-time constant.  But we need a simple constant here.  */
+#if __GLIBC__ >= 2
+# undef SIGSTKSZ
+# if defined __ia64__
+#  define SIGSTKSZ 262144
+# else
+#  define SIGSTKSZ 16384
+# endif
+#endif
 #ifndef SIGSTKSZ
 # define SIGSTKSZ 16384
 #endif
@@ -138,6 +148,16 @@ int main ()
 #if HAVE_SYS_SIGNAL_H
 # include <sys/signal.h>
 #endif
+/* In glibc >= 2.34, when _GNU_SOURCE is defined, SIGSTKSZ is no longer a
+   compile-time constant.  But we need a simple constant here.  */
+#if __GLIBC__ >= 2
+# undef SIGSTKSZ
+# if defined __ia64__
+#  define SIGSTKSZ 262144
+# else
+#  define SIGSTKSZ 16384
+# endif
+#endif
 #ifndef SIGSTKSZ
 # define SIGSTKSZ 16384
 #endif