Handle SIGSTKSZ no longer being a constant (bug #1943016).

This commit is contained in:
Tim Waugh 2021-04-12 11:13:23 +01:00
parent 26b96e3108
commit 775035f1b7
No known key found for this signature in database
GPG Key ID: B7C20D079491EA63
2 changed files with 32 additions and 0 deletions

25
diffutils-sigstksz.patch Normal file
View File

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

View File

@ -7,6 +7,7 @@ Source: https://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz
Patch1: diffutils-cmp-s-empty.patch
Patch2: diffutils-i18n.patch
Patch3: diffutils-fix-gnulib-tests.patch
Patch4: diffutils-sigstksz.patch
License: GPLv3+
Provides: bundled(gnulib)
BuildRequires: gcc
@ -37,6 +38,9 @@ Install diffutils if you need to compare text files.
# Fix from gnulib upstream, commit 175e0bc (bug #1863423).
%patch3 -p1 -b .fix-gnulib-tests
# Handle SIGSTKSZ no longer being a constant (bug #1943016).
%patch4 -p1 -b .sigstksz
# Run autoreconf for aarch64 support (bug #925256).
autoreconf
@ -63,6 +67,9 @@ make check
%{_infodir}/diffutils.info*
%changelog
* Mon Apr 12 2021 Tim Waugh <twaugh@redhat.com> - 3.7-9
- Handle SIGSTKSZ no longer being a constant (bug #1943016).
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.7-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild