From 93024b47c4121c417aa9f748810621e3143b563e Mon Sep 17 00:00:00 2001 From: q66 Date: Mon, 28 Oct 2019 20:00:45 +0100 Subject: [PATCH] a2jmidid: fix build on musl/ppc (and also a correction on glibc) [ci skip] --- srcpkgs/a2jmidid/patches/musl-ppc.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 srcpkgs/a2jmidid/patches/musl-ppc.patch diff --git a/srcpkgs/a2jmidid/patches/musl-ppc.patch b/srcpkgs/a2jmidid/patches/musl-ppc.patch new file mode 100644 index 00000000000..c16523512ef --- /dev/null +++ b/srcpkgs/a2jmidid/patches/musl-ppc.patch @@ -0,0 +1,18 @@ +This fixes build on ppc32/musl but also fixes incorrect usage of uc_regs +on glibc (uc_regs is an mcontext_t pointer, you can't index it directly) + +--- sigsegv.c ++++ sigsegv.c +@@ -97,7 +97,11 @@ static void signal_segv(int signum, siginfo_t* info, void*ptr) { + for(i = 0; i < NGREG; i++) + a2j_error("reg[%02d] = 0x" REGFORMAT, i, + #if defined(__powerpc__) && !defined(__powerpc64__) +- ucontext->uc_mcontext.uc_regs[i] ++#if defined(__GLIBC__) ++ ucontext->uc_mcontext.uc_regs->gregs[i] ++#else ++ ucontext->uc_mcontext.gregs[i] ++#endif + #elif defined(__powerpc64__) + ucontext->uc_mcontext.gp_regs[i] + #elif defined(__sparc__) && defined(__arch64__)