+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.
#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
# Written by Paul Eggert.
-# serial 21
+# serial 22
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
#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
# 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
-# 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
# 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
#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