Andreas Schwab
7b29ed8d9a
- 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
171 lines
5.8 KiB
Diff
171 lines
5.8 KiB
Diff
Index: grep-3.6/configure
|
|
===================================================================
|
|
--- grep-3.6.orig/configure
|
|
+++ grep-3.6/configure
|
|
@@ -8603,13 +8603,11 @@ else
|
|
# include <sys/time.h>
|
|
# include <sys/resource.h>
|
|
#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 <sys/signal.h>
|
|
#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 <sys/time.h>
|
|
# include <sys/resource.h>
|
|
#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 <sys/time.h>
|
|
# include <sys/resource.h>
|
|
#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 <sys/signal.h>
|
|
#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 <sys/time.h>
|
|
# include <sys/resource.h>
|
|
#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;
|