summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-extended/diffutils/diffutils/0001-c-stack-stop-using-SIGSTKSZ.patch84
-rw-r--r--meta/recipes-extended/diffutils/diffutils_3.8.bb (renamed from meta/recipes-extended/diffutils/diffutils_3.7.bb)9
2 files changed, 5 insertions, 88 deletions
diff --git a/meta/recipes-extended/diffutils/diffutils/0001-c-stack-stop-using-SIGSTKSZ.patch b/meta/recipes-extended/diffutils/diffutils/0001-c-stack-stop-using-SIGSTKSZ.patch
deleted file mode 100644
index 50e627fa30..0000000000
--- a/meta/recipes-extended/diffutils/diffutils/0001-c-stack-stop-using-SIGSTKSZ.patch
+++ /dev/null
@@ -1,84 +0,0 @@
1From 87b3a8f9ceb2cf0a5c8b72e460465fb9ff2d62d9 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 30 Apr 2021 17:40:36 -0700
4Subject: [PATCH] c-stack: stop using SIGSTKSZ
5
6This patch is required with glibc 2.34+
7based on gnulib [1]
8
9[1] https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=f9e2b20a12a230efa30f1d479563ae07d276a94b
10
11Upstream-Status: Pending
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 lib/c-stack.c | 22 +++++++++++++---------
15 1 file changed, 13 insertions(+), 9 deletions(-)
16
17diff --git a/lib/c-stack.c b/lib/c-stack.c
18index 9bbe6fe..e0874c9 100644
19--- a/lib/c-stack.c
20+++ b/lib/c-stack.c
21@@ -51,13 +51,14 @@
22 typedef struct sigaltstack stack_t;
23 #endif
24 #ifndef SIGSTKSZ
25-# define SIGSTKSZ 16384
26-#elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384
27+#define get_sigstksz() (16384)
28+#elif HAVE_LIBSIGSEGV
29 /* libsigsegv 2.6 through 2.8 have a bug where some architectures use
30 more than the Linux default of an 8k alternate stack when deciding
31 if a fault was caused by stack overflow. */
32-# undef SIGSTKSZ
33-# define SIGSTKSZ 16384
34+#define get_sigstksz() ((SIGSTKSZ) < 16384 ? 16384 : (SIGSTKSZ))
35+#else
36+#define get_sigstksz() ((SIGSTKSZ))
37 #endif
38
39 #include <stdlib.h>
40@@ -136,7 +137,8 @@ die (int signo)
41 /* Storage for the alternate signal stack. */
42 static union
43 {
44- char buffer[SIGSTKSZ];
45+ /* allocate buffer with size from get_sigstksz() */
46+ char *buffer;
47
48 /* These other members are for proper alignment. There's no
49 standard way to guarantee stack alignment, but this seems enough
50@@ -208,10 +210,11 @@ c_stack_action (void (*action) (int))
51 program_error_message = _("program error");
52 stack_overflow_message = _("stack overflow");
53
54+ alternate_signal_stack.buffer = malloc(get_sigstksz());
55 /* Always install the overflow handler. */
56 if (stackoverflow_install_handler (overflow_handler,
57 alternate_signal_stack.buffer,
58- sizeof alternate_signal_stack.buffer))
59+ get_sigstksz()))
60 {
61 errno = ENOTSUP;
62 return -1;
63@@ -284,14 +287,15 @@ c_stack_action (void (*action) (int))
64 stack_t st;
65 struct sigaction act;
66 st.ss_flags = 0;
67+ alternate_signal_stack.buffer = malloc(get_sigstksz());
68 # if SIGALTSTACK_SS_REVERSED
69 /* Irix mistakenly treats ss_sp as the upper bound, rather than
70 lower bound, of the alternate stack. */
71- st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ - sizeof (void *);
72- st.ss_size = sizeof alternate_signal_stack.buffer - sizeof (void *);
73+ st.ss_sp = alternate_signal_stack.buffer + get_sigstksz() - sizeof (void *);
74+ st.ss_size = get_sigstksz() - sizeof (void *);
75 # else
76 st.ss_sp = alternate_signal_stack.buffer;
77- st.ss_size = sizeof alternate_signal_stack.buffer;
78+ st.ss_size = get_sigstksz();
79 # endif
80 r = sigaltstack (&st, NULL);
81 if (r != 0)
82--
832.31.1
84
diff --git a/meta/recipes-extended/diffutils/diffutils_3.7.bb b/meta/recipes-extended/diffutils/diffutils_3.8.bb
index 7b4ae160f9..a6522967d4 100644
--- a/meta/recipes-extended/diffutils/diffutils_3.7.bb
+++ b/meta/recipes-extended/diffutils/diffutils_3.8.bb
@@ -6,14 +6,15 @@ require diffutils.inc
6SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.xz \ 6SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.xz \
7 file://run-ptest \ 7 file://run-ptest \
8 file://0001-Skip-strip-trailing-cr-test-case.patch \ 8 file://0001-Skip-strip-trailing-cr-test-case.patch \
9 file://0001-c-stack-stop-using-SIGSTKSZ.patch \ 9 "
10"
11 10
12SRC_URI[md5sum] = "4824adc0e95dbbf11dfbdfaad6a1e461" 11SRC_URI[sha256sum] = "a6bdd7d1b31266d11c4f4de6c1b748d4607ab0231af5188fc2533d0ae2438fec"
13SRC_URI[sha256sum] = "b3a7a6221c3dc916085f0d205abf6b8e1ba443d4dd965118da364a1dc1cb3a26"
14 12
15EXTRA_OECONF += "ac_cv_path_PR_PROGRAM=${bindir}/pr --without-libsigsegv-prefix" 13EXTRA_OECONF += "ac_cv_path_PR_PROGRAM=${bindir}/pr --without-libsigsegv-prefix"
16 14
15# latest gnulib is no longer able to handle this - I dare not try to fix that maze of abstractions and generators
16CFLAGS:mingw32 = " -DSA_RESTART=0"
17
17# Fix "Argument list too long" error when len(TMPDIR) = 410 18# Fix "Argument list too long" error when len(TMPDIR) = 410
18acpaths = "-I ./m4" 19acpaths = "-I ./m4"
19 20