aboutsummaryrefslogtreecommitdiffstats
path: root/community/ocaml/fix-mcontext-fields.patch
diff options
context:
space:
mode:
authorShiz <hi@shiz.me>2017-05-13 06:14:23 +0200
committerShiz <hi@shiz.me>2017-05-13 06:17:47 +0200
commitde243a0b7a494f2cd02fde83179d68105df447a2 (patch)
treec1136c97dca3006317dd4f11fe03af354f42791a /community/ocaml/fix-mcontext-fields.patch
parenta5c9034d9b328371a02550b581ee0e9f322ec07b (diff)
downloadaports-de243a0b7a494f2cd02fde83179d68105df447a2.tar.bz2
aports-de243a0b7a494f2cd02fde83179d68105df447a2.tar.xz
community/ocaml: attempt to fix ppc64le build
Diffstat (limited to 'community/ocaml/fix-mcontext-fields.patch')
-rw-r--r--community/ocaml/fix-mcontext-fields.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/community/ocaml/fix-mcontext-fields.patch b/community/ocaml/fix-mcontext-fields.patch
new file mode 100644
index 0000000000..846a0d88d3
--- /dev/null
+++ b/community/ocaml/fix-mcontext-fields.patch
@@ -0,0 +1,49 @@
+diff -Nru a/asmrun/signals_osdep.h b/asmrun/signals_osdep.h
+--- a/asmrun/signals_osdep.h 2016-11-04 16:08:24.000000000 +0000
++++ b/asmrun/signals_osdep.h 2017-05-13 03:16:28.749615533 +0000
+@@ -314,11 +314,11 @@
+ sigact.sa_flags = 0
+
+ typedef unsigned long context_reg;
+- #define CONTEXT_PC (context->sregs->regs.psw.addr)
+- #define CONTEXT_EXCEPTION_POINTER (context->sregs->regs.gprs[13])
+- #define CONTEXT_YOUNG_LIMIT (context->sregs->regs.gprs[10])
+- #define CONTEXT_YOUNG_PTR (context->sregs->regs.gprs[11])
+- #define CONTEXT_SP (context->sregs->regs.gprs[15])
++ #define CONTEXT_PC (context->sregs->psw.addr)
++ #define CONTEXT_EXCEPTION_POINTER (context->sregs->gregs[13])
++ #define CONTEXT_YOUNG_LIMIT (context->sregs->gregs[10])
++ #define CONTEXT_YOUNG_PTR (context->sregs->gregs[11])
++ #define CONTEXT_SP (context->sregs->gregs[15])
+
+ /****************** PowerPC, BSD */
+
+diff -Nru a/asmrun/signals_osdep.h b/asmrun/signals_osdep.h
+--- a/asmrun/signals_osdep.h 2017-05-13 03:19:52.863954544 +0000
++++ b/asmrun/signals_osdep.h 2017-05-13 04:10:48.417194351 +0000
+@@ -297,11 +297,20 @@
+ sigact.sa_flags = 0
+
+ typedef unsigned long context_reg;
+- #define CONTEXT_PC (context->regs->nip)
+- #define CONTEXT_EXCEPTION_POINTER (context->regs->gpr[29])
+- #define CONTEXT_YOUNG_LIMIT (context->regs->gpr[30])
+- #define CONTEXT_YOUNG_PTR (context->regs->gpr[31])
+- #define CONTEXT_SP (context->regs->gpr[1])
++
++ #ifdef __powerpc64__
++ #define CONTEXT_PC (context->regs->gp_regs[32])
++ #define CONTEXT_EXCEPTION_POINTER (context->regs->gp_regs[29])
++ #define CONTEXT_YOUNG_LIMIT (context->regs->gp_regs[30])
++ #define CONTEXT_YOUNG_PTR (context->regs->gp_regs[31])
++ #define CONTEXT_SP (context->regs->gp_regs[1])
++ #else
++ #define CONTEXT_PC (context->regs->nip)
++ #define CONTEXT_EXCEPTION_POINTER (context->regs->gpr[29])
++ #define CONTEXT_YOUNG_LIMIT (context->regs->gpr[30])
++ #define CONTEXT_YOUNG_PTR (context->regs->gpr[31])
++ #define CONTEXT_SP (context->regs->gpr[1])
++ #endif
+
+ /****************** s390x, ELF (Linux) */
+ #elif defined(TARGET_s390x) && defined(SYS_elf)