blob: d8283d31b1687c2ac595d652d9ff657595e1dab7 [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001From 981385237834bdf3e468421147eece68d9bfc7e7 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 25 Mar 2022 13:34:26 -0700
4Subject: [PATCH] mcontext is not a standard layout so glibc and musl differ
5
6This is already applied to libsigsegv upstream, hopefully next version
7of grep will update its internal copy and we can drop this patch
8
9Upstream-Status: Backport [https://git.savannah.gnu.org/gitweb/?p=libsigsegv.git;a=commitdiff;h=a6ff69873110c0a8ba6f7fd90532dbc11224828c]
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 lib/sigsegv.c | 4 ++--
13 1 file changed, 2 insertions(+), 2 deletions(-)
14
15diff --git a/lib/sigsegv.c b/lib/sigsegv.c
16index 998c827..b6f4841 100644
17--- a/lib/sigsegv.c
18+++ b/lib/sigsegv.c
19@@ -219,8 +219,8 @@ int libsigsegv_version = LIBSIGSEGV_VERSION;
20 # define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.gp_regs[1]
21 # else /* 32-bit */
22 /* both should be equivalent */
23-# if 0
24-# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.regs->gpr[1]
25+# if ! defined __GLIBC__
26+# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_regs->gregs[1]
27 # else
28 # define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.uc_regs->gregs[1]
29 # endif
30--
312.35.1
32