From 9ad40791fe66d4eb430d1b54b29d274d631e9433 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 9 Mar 2022 23:53:34 -0800 Subject: m4: Fix build on musl/ppc (From OE-Core rev: 41ccf5b38506608032754beaff393f74e0403fd1) Signed-off-by: Khem Raj Signed-off-by: Richard Purdie --- .../m4/m4/0001-sigsegv-Fix-build-on-ppc-musl.patch | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 meta/recipes-devtools/m4/m4/0001-sigsegv-Fix-build-on-ppc-musl.patch (limited to 'meta/recipes-devtools/m4/m4') diff --git a/meta/recipes-devtools/m4/m4/0001-sigsegv-Fix-build-on-ppc-musl.patch b/meta/recipes-devtools/m4/m4/0001-sigsegv-Fix-build-on-ppc-musl.patch new file mode 100644 index 0000000000..04320de63a --- /dev/null +++ b/meta/recipes-devtools/m4/m4/0001-sigsegv-Fix-build-on-ppc-musl.patch @@ -0,0 +1,37 @@ +From 36d5e26f606e070553eb0fff1f738e61970be5d7 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 9 Mar 2022 20:22:20 -0800 +Subject: [PATCH] sigsegv: Fix build on ppc/musl + +mcontext is not a standard layout so glibc and musl differ sadly. + +Fixes +../../m4-1.4.19/lib/sigsegv.c: In function 'sigsegv_handler': ../../m4-1.4.19/lib/sigsegv.c:223:75: error: 'mcontext_t' has no member named 'uc_regs'; did you mean 'gregs'? 223 | # define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.uc_regs->gregs[1] | ^~~~~~~ + +Upstream-Status: Submitted [https://lists.gnu.org/archive/html/m4-patches/2022-03/msg00000.html] +Signed-off-by: Khem Raj +--- + lib/sigsegv.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/lib/sigsegv.c b/lib/sigsegv.c +index 696a152..fa0c465 100644 +--- a/lib/sigsegv.c ++++ b/lib/sigsegv.c +@@ -217,10 +217,10 @@ int libsigsegv_version = LIBSIGSEGV_VERSION; + # define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.gp_regs[1] + # else /* 32-bit */ + /* both should be equivalent */ +-# if 0 +-# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.regs->gpr[1] ++# if ! defined __GLIBC__ ++# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_regs->gregs[1] + # else +-# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.uc_regs->gregs[1] ++# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.uc_regs->gregs[1] + # endif + # endif + +-- +2.35.1 + -- cgit v1.2.3-54-g00ecf