775035f
diff -up diffutils-3.7/lib/c-stack.c.sigstksz diffutils-3.7/lib/c-stack.c
775035f
--- diffutils-3.7/lib/c-stack.c.sigstksz	2021-04-12 10:58:48.892279388 +0100
775035f
+++ diffutils-3.7/lib/c-stack.c	2021-04-12 11:04:59.488695551 +0100
775035f
@@ -52,12 +52,18 @@ typedef struct sigaltstack stack_t;
775035f
 #endif
775035f
 #ifndef SIGSTKSZ
775035f
 # define SIGSTKSZ 16384
775035f
-#elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384
775035f
+#elif HAVE_LIBSIGSEGV
775035f
 /* libsigsegv 2.6 through 2.8 have a bug where some architectures use
775035f
    more than the Linux default of an 8k alternate stack when deciding
775035f
    if a fault was caused by stack overflow.  */
775035f
-# undef SIGSTKSZ
775035f
-# define SIGSTKSZ 16384
775035f
+# if defined _SC_SIGSTKSZ && _SC_SIGSTKSZ < 16384
775035f
+   /* glibc 2.34 defines SIGSTKSZ to sysconf (_SC_SIGSTKSZ) */
775035f
+#  undef SIGSTKSZ
775035f
+#  define SIGSTKSZ 16384
775035f
+# elif SIGSTKSZ < 16384
775035f
+#  undef SIGSTKSZ
775035f
+#  define SIGSTKSZ 16384
775035f
+# endif
775035f
 #endif
775035f
 
775035f
 #include <stdlib.h>