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