summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-12-16 19:10:07 -0500
committerBen Gamari <ben@smart-cactus.org>2018-12-17 12:44:49 -0500
commit1ebe8438cd29448291229d5ce23c9f73216e9650 (patch)
tree3a52ca4f885ee3b141628227d27997ec0cb5ba45
parentf61fc508bd5216fe325c23b32dfbb65c62a49060 (diff)
downloadhaskell-1ebe8438cd29448291229d5ce23c9f73216e9650.tar.gz
StgCRun: Disable unwinding on Darwin
See #15207.
-rw-r--r--rts/StgCRun.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/rts/StgCRun.c b/rts/StgCRun.c
index 92b0696c2b..e1b9a09359 100644
--- a/rts/StgCRun.c
+++ b/rts/StgCRun.c
@@ -405,9 +405,13 @@ StgRunIsImplementedInAssembler(void)
"movq %%xmm15,136(%%rax)\n\t"
#endif
+#if !defined(darwin_HOST_OS)
/*
* Let the unwinder know where we saved the registers
* See Note [Unwinding foreign exports on x86-64].
+ *
+ * N.B. We don't support unwinding on Darwin due to
+ * various toolchain insanity.
*/
".cfi_def_cfa rsp, 0\n\t"
".cfi_offset rbx, %c2\n\t"
@@ -440,6 +444,7 @@ StgRunIsImplementedInAssembler(void)
#error "RSP_DELTA too big"
#endif
"\n\t"
+#endif /* !defined(darwin_HOST_OS) */
/*
* Set BaseReg
@@ -512,8 +517,10 @@ StgRunIsImplementedInAssembler(void)
"i"(RESERVED_C_STACK_BYTES + 32 /* r14 relative to cfa (rsp) */),
"i"(RESERVED_C_STACK_BYTES + 40 /* r15 relative to cfa (rsp) */),
"i"(RESERVED_C_STACK_BYTES + STG_RUN_STACK_FRAME_SIZE
- /* rip relative to cfa */),
- "i"((RSP_DELTA & 127) | (128 * ((RSP_DELTA >> 7) > 0)))
+ /* rip relative to cfa */)
+
+#if !defined(darwin_HOST_OS)
+ , "i"((RSP_DELTA & 127) | (128 * ((RSP_DELTA >> 7) > 0)))
/* signed LEB128-encoded delta from rsp - byte 1 */
#if (RSP_DELTA >> 7) > 0
, "i"(((RSP_DELTA >> 7) & 127) | (128 * ((RSP_DELTA >> 14) > 0)))
@@ -530,6 +537,9 @@ StgRunIsImplementedInAssembler(void)
/* signed LEB128-encoded delta from rsp - byte 4 */
#endif
#undef RSP_DELTA
+
+#endif /* !defined(darwin_HOST_OS) */
+
);
/*
* See Note [Stack Alignment on X86]