[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] sigsegv: Fix build on ppc/musl
From: |
Eric Blake |
Subject: |
Re: [PATCH] sigsegv: Fix build on ppc/musl |
Date: |
Thu, 10 Mar 2022 08:12:19 -0600 |
User-agent: |
NeoMutt/20211029-410-d8ee8c |
On Wed, Mar 09, 2022 at 11:37:14PM -0800, Khem Raj wrote:
> 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]
> |
> ^~~~~~~
Thanks for the report. As this file comes from gnulib, the fix needs
to go there first.
>
> ---
> 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
>
>
> _______________________________________________
> M4-patches mailing list
> M4-patches@gnu.org
> https://lists.gnu.org/mailman/listinfo/m4-patches
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- Re: [PATCH] sigsegv: Fix build on ppc/musl,
Eric Blake <=