From 111d56abbd843d6890302d6dd349c94313c39a28e1ae7200a19051dc08797de3 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 21 Jul 2021 14:52:16 +0000 Subject: [PATCH] Accepting request 907544 from home:Andreas_Schwab:glibc:rebuild - sigsegv-stack.patch: Port alternate signal stack to upcoming glibc 2.34 OBS-URL: https://build.opensuse.org/request/show/907544 OBS-URL: https://build.opensuse.org/package/show/editors/emacs?expand=0&rev=311 --- emacs.changes | 5 +++++ emacs.spec | 2 ++ sigsegv-stack.patch | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 sigsegv-stack.patch diff --git a/emacs.changes b/emacs.changes index 54cedf4..b7f3e2b 100644 --- a/emacs.changes +++ b/emacs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jul 21 09:22:45 UTC 2021 - Andreas Schwab + +- sigsegv-stack.patch: Port alternate signal stack to upcoming glibc 2.34 + ------------------------------------------------------------------- Fri Jun 11 10:24:47 UTC 2021 - Dr. Werner Fink diff --git a/emacs.spec b/emacs.spec index 935bfde..3300f8c 100644 --- a/emacs.spec +++ b/emacs.spec @@ -181,6 +181,7 @@ Patch29: emacs-27.1-Xauthority4server.patch # This patch allows vte based terminals like gnome-terminal to get 24bit colors # without setting a custom terminfo, honouring COLORTERM=truecolor Patch30: emacs-27.2-COLORTERM-24bit.patch +Patch39: sigsegv-stack.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %{expand: %%global include_info %(test -s /usr/share/info/info.info* && echo 0 || echo 1)} @@ -298,6 +299,7 @@ and most assembler-like syntaxes. %patch26 -p0 -b .fmt %patch29 -p0 -b .xauth %patch30 -p1 -b .colorterm +%patch39 -p1 %patch -p0 -b .0 %if %{without tex4pdf} pushd etc/refcards/ diff --git a/sigsegv-stack.patch b/sigsegv-stack.patch new file mode 100644 index 0000000..69c7117 --- /dev/null +++ b/sigsegv-stack.patch @@ -0,0 +1,40 @@ +From f97e07ea807cc6d38774a3888a15091b20645ac6 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Tue, 9 Mar 2021 11:22:59 -0800 +Subject: [PATCH] Port alternate signal stack to upcoming glibc 2.34 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +* src/sysdep.c (sigsegv_stack): Increase size to 64 KiB and align +it to max_align_t. This copies from Gnulib’s c-stack.c, and works +around a portability bug in draft glibc 2.34, which no longer +defines SIGSTKSZ when _GNU_SOURCE is defined. +--- + src/sysdep.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/src/sysdep.c b/src/sysdep.c +index 941b4e2fa2..24d8832b2f 100644 +--- a/src/sysdep.c ++++ b/src/sysdep.c +@@ -1785,7 +1785,15 @@ handle_arith_signal (int sig) + + /* Alternate stack used by SIGSEGV handler below. */ + +-static unsigned char sigsegv_stack[SIGSTKSZ]; ++/* Storage for the alternate signal stack. ++ 64 KiB is not too large for Emacs, and is large enough ++ for all known platforms. Smaller sizes may run into trouble. ++ For example, libsigsegv 2.6 through 2.8 have a bug where some ++ architectures use more than the Linux default of an 8 KiB alternate ++ stack when deciding if a fault was caused by stack overflow. */ ++static max_align_t sigsegv_stack[(64 * 1024 ++ + sizeof (max_align_t) - 1) ++ / sizeof (max_align_t)]; + + + /* Return true if SIGINFO indicates a stack overflow. */ +-- +2.32.0 +