From 7b29ed8d9a93f7d55b3f6efae07617829013f2eb40a3d311025b7837d7f25faa Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 3 Aug 2021 12:27:57 +0000 Subject: [PATCH] Accepting request 909987 from home:Andreas_Schwab:Factory - gnulib-c-stack.patch: Fix AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC configure check OBS-URL: https://build.opensuse.org/request/show/909987 OBS-URL: https://build.opensuse.org/package/show/Base:System/grep?expand=0&rev=113 --- gnulib-c-stack.patch | 170 +++++++++++++++++++++++++++++++++++++++++++ grep.changes | 6 ++ grep.spec | 5 +- 3 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 gnulib-c-stack.patch diff --git a/gnulib-c-stack.patch b/gnulib-c-stack.patch new file mode 100644 index 0000000..05c6c40 --- /dev/null +++ b/gnulib-c-stack.patch @@ -0,0 +1,170 @@ +Index: grep-3.6/configure +=================================================================== +--- grep-3.6.orig/configure ++++ grep-3.6/configure +@@ -8603,13 +8603,11 @@ else + # include + # include + #endif +- #ifndef SIGSTKSZ +- # define SIGSTKSZ 16384 +- #endif ++ #define alt_SIGSTKSZ 16384 + + static union + { +- char buffer[2 * SIGSTKSZ]; ++ char buffer[2 * alt_SIGSTKSZ]; + long double ld; + long u; + void *p; +@@ -8630,8 +8628,8 @@ else + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ +- st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; +- st.ss_size = SIGSTKSZ; ++ st.ss_sp = alternate_signal_stack.buffer + alt_SIGSTKSZ; ++ st.ss_size = alt_SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; +@@ -8721,9 +8719,7 @@ else + #if HAVE_SYS_SIGNAL_H + # include + #endif +-#ifndef SIGSTKSZ +-# define SIGSTKSZ 16384 +-#endif ++#define alt_SIGSTKSZ 16384 + volatile char *stack_lower_bound; + volatile char *stack_upper_bound; + static void check_stack_location (volatile char *addr) +@@ -8740,12 +8736,12 @@ static void stackoverflow_handler (int s + } + int main () + { +- char mystack[2 * SIGSTKSZ]; ++ char mystack[2 * alt_SIGSTKSZ]; + stack_t altstack; + struct sigaction action; + /* Install the alternate stack. */ +- altstack.ss_sp = mystack + SIGSTKSZ; +- altstack.ss_size = SIGSTKSZ; ++ altstack.ss_sp = mystack + alt_SIGSTKSZ; ++ altstack.ss_size = alt_SIGSTKSZ; + stack_lower_bound = (char *) altstack.ss_sp; + stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1; + altstack.ss_flags = 0; /* no SS_DISABLE */ +@@ -8809,13 +8805,11 @@ else + # include + # include + #endif +- #ifndef SIGSTKSZ +- # define SIGSTKSZ 16384 +- #endif ++ #define alt_SIGSTKSZ 16384 + + static union + { +- char buffer[2 * SIGSTKSZ]; ++ char buffer[2 * alt_SIGSTKSZ]; + long double ld; + long u; + void *p; +@@ -8865,8 +8859,8 @@ else + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ +- st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; +- st.ss_size = SIGSTKSZ; ++ st.ss_sp = alternate_signal_stack.buffer + alt_SIGSTKSZ; ++ st.ss_size = alt_SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; +Index: grep-3.6/m4/c-stack.m4 +=================================================================== +--- grep-3.6.orig/m4/c-stack.m4 ++++ grep-3.6/m4/c-stack.m4 +@@ -44,13 +44,11 @@ AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEUR + # include + # include + #endif +- #ifndef SIGSTKSZ +- # define SIGSTKSZ 16384 +- #endif ++ #define alt_SIGSTKSZ 16384 + + static union + { +- char buffer[2 * SIGSTKSZ]; ++ char buffer[2 * alt_SIGSTKSZ]; + long double ld; + long u; + void *p; +@@ -71,8 +69,8 @@ AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEUR + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ +- st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; +- st.ss_size = SIGSTKSZ; ++ st.ss_sp = alternate_signal_stack.buffer + alt_SIGSTKSZ; ++ st.ss_size = alt_SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; +@@ -149,9 +147,7 @@ AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEUR + #if HAVE_SYS_SIGNAL_H + # include + #endif +-#ifndef SIGSTKSZ +-# define SIGSTKSZ 16384 +-#endif ++#define alt_SIGSTKSZ 16384 + volatile char *stack_lower_bound; + volatile char *stack_upper_bound; + static void check_stack_location (volatile char *addr) +@@ -168,12 +164,12 @@ static void stackoverflow_handler (int s + } + int main () + { +- char mystack[2 * SIGSTKSZ]; ++ char mystack[2 * alt_SIGSTKSZ]; + stack_t altstack; + struct sigaction action; + /* Install the alternate stack. */ +- altstack.ss_sp = mystack + SIGSTKSZ; +- altstack.ss_size = SIGSTKSZ; ++ altstack.ss_sp = mystack + alt_SIGSTKSZ; ++ altstack.ss_size = alt_SIGSTKSZ; + stack_lower_bound = (char *) altstack.ss_sp; + stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1; + altstack.ss_flags = 0; /* no SS_DISABLE */ +@@ -223,13 +219,11 @@ int main () + # include + # include + #endif +- #ifndef SIGSTKSZ +- # define SIGSTKSZ 16384 +- #endif ++ #define alt_SIGSTKSZ 16384 + + static union + { +- char buffer[2 * SIGSTKSZ]; ++ char buffer[2 * alt_SIGSTKSZ]; + long double ld; + long u; + void *p; +@@ -279,8 +273,8 @@ int main () + + st.ss_flags = 0; + /* Use the midpoint to avoid Irix sigaltstack bug. */ +- st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ; +- st.ss_size = SIGSTKSZ; ++ st.ss_sp = alternate_signal_stack.buffer + alt_SIGSTKSZ; ++ st.ss_size = alt_SIGSTKSZ; + r = sigaltstack (&st, 0); + if (r != 0) + return 1; diff --git a/grep.changes b/grep.changes index 21db552..5df875e 100644 --- a/grep.changes +++ b/grep.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Aug 3 12:17:24 UTC 2021 - Andreas Schwab + +- gnulib-c-stack.patch: Fix AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC configure + check + ------------------------------------------------------------------- Sat Nov 28 09:48:12 UTC 2020 - Andreas Stieger diff --git a/grep.spec b/grep.spec index 39a9ef0..50d7b10 100644 --- a/grep.spec +++ b/grep.spec @@ -1,7 +1,7 @@ # # spec file for package grep # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -29,6 +29,7 @@ Source3: https://savannah.gnu.org/project/memberlist-gpgkeys.php?group=gr Source4: profile.sh Source5: %{name}-rpmlintrc Patch0: werror-return-type.patch +Patch1: gnulib-c-stack.patch BuildRequires: fdupes BuildRequires: makeinfo BuildRequires: pcre-devel @@ -43,6 +44,8 @@ match to a specified pattern. By default, grep prints the matching lines. %prep %autosetup -p1 +touch aclocal.m4 configure Makefile.in config.hin + %build %configure \ --disable-silent-rules \