[Git][ghc/ghc][master] StgCRun: Enable unwinding only on Linux
Marge Bot
gitlab at gitlab.haskell.org
Wed Apr 15 03:28:28 UTC 2020
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
5b08e0c0 by Ben Gamari at 2020-04-14T23:28:20-04:00
StgCRun: Enable unwinding only on Linux
It's broken on macOS due and SmartOS due to assembler differences
(#15207) so let's be conservative in enabling it. Also, refactor things
to make the intent clearer.
- - - - -
1 changed file:
- rts/StgCRun.c
Changes:
=====================================
rts/StgCRun.c
=====================================
@@ -29,6 +29,13 @@
#include "PosixSource.h"
#include "ghcconfig.h"
+// Enable DWARF Call-Frame Information (used for stack unwinding) on Linux.
+// This is not supported on Darwin and SmartOS due to assembler differences
+// (#15207).
+#if defined(linux_HOST_OS)
+#define ENABLE_UNWINDING
+#endif
+
#if defined(sparc_HOST_ARCH) || defined(USE_MINIINTERPRETER)
/* include Stg.h first because we want real machine regs in here: we
* have to get the value of R1 back from Stg land to C land intact.
@@ -405,7 +412,7 @@ StgRunIsImplementedInAssembler(void)
"movq %%xmm15,136(%%rax)\n\t"
#endif
-#if !defined(darwin_HOST_OS)
+#if defined(ENABLE_UNWINDING)
/*
* Let the unwinder know where we saved the registers
* See Note [Unwinding foreign exports on x86-64].
@@ -444,7 +451,7 @@ StgRunIsImplementedInAssembler(void)
#error "RSP_DELTA too big"
#endif
"\n\t"
-#endif /* !defined(darwin_HOST_OS) */
+#endif /* defined(ENABLE_UNWINDING) */
/*
* Set BaseReg
@@ -519,7 +526,7 @@ StgRunIsImplementedInAssembler(void)
"i"(RESERVED_C_STACK_BYTES + STG_RUN_STACK_FRAME_SIZE
/* rip relative to cfa */)
-#if !defined(darwin_HOST_OS)
+#if defined(ENABLE_UNWINDING)
, "i"((RSP_DELTA & 127) | (128 * ((RSP_DELTA >> 7) > 0)))
/* signed LEB128-encoded delta from rsp - byte 1 */
#if (RSP_DELTA >> 7) > 0
@@ -538,7 +545,7 @@ StgRunIsImplementedInAssembler(void)
#endif
#undef RSP_DELTA
-#endif /* !defined(darwin_HOST_OS) */
+#endif /* defined(ENABLE_UNWINDING) */
);
/*
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5b08e0c06e038448a63aa9bd7f163b23d824ba4b
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5b08e0c06e038448a63aa9bd7f163b23d824ba4b
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200414/4981a3cc/attachment-0001.html>
More information about the ghc-commits
mailing list