summaryrefslogtreecommitdiff
path: root/system/musl/ppc64-regs.patch
diff options
context:
space:
mode:
Diffstat (limited to 'system/musl/ppc64-regs.patch')
-rw-r--r--system/musl/ppc64-regs.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/system/musl/ppc64-regs.patch b/system/musl/ppc64-regs.patch
new file mode 100644
index 000000000..4deb979ba
--- /dev/null
+++ b/system/musl/ppc64-regs.patch
@@ -0,0 +1,45 @@
+From ea183d9b727ac7e3ccfdcb89242566857d7182c8 Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Tue, 12 Feb 2019 09:31:34 -0600
+Subject: [PATCH] powerpc64: use a type for mcontext_t regs field
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+GCC Go dereferences `regs` for `nip`. Without this change, compilation
+fails with the following message:
+
+../../../libgo/runtime/go-signal.c: In function ‘getSiginfo’:
+../../../libgo/runtime/go-signal.c:225:56: warning: dereferencing ‘void *’ pointer
+ ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
+ ^~
+../../../libgo/runtime/go-signal.c:225:56: error: request for member ‘nip’ in something not a structure or union
+---
+ arch/powerpc64/bits/signal.h | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
+index 34693a68..6736c69a 100644
+--- a/arch/powerpc64/bits/signal.h
++++ b/arch/powerpc64/bits/signal.h
+@@ -8,6 +8,8 @@
+
+ #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+
++#include <bits/user.h>
++
+ typedef unsigned long greg_t, gregset_t[48];
+
+ typedef struct {
+@@ -29,7 +31,7 @@ typedef struct sigcontext {
+ int _pad0;
+ unsigned long handler;
+ unsigned long oldmask;
+- void *regs;
++ struct pt_regs *regs;
+ gregset_t gp_regs;
+ fpregset_t fp_regs;
+ vrregset_t *v_regs;
+--
+2.19.2
+