summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-11-19 10:10:50 -0500
committerBen Gamari <ben@smart-cactus.org>2019-11-19 10:10:50 -0500
commitc6fca740a708ad9db5fdb595ad06f727289cdc07 (patch)
tree676e33a7f78b1fd97260793170326606045ed1b1
parent28aec5ff09aecaf0e1420d251230003fb789c2a5 (diff)
downloadhaskell-c6fca740a708ad9db5fdb595ad06f727289cdc07.tar.gz
rts: Don't use MAP_32BIT on Darwin
As noted in #17353, Catalina added support for MAP_32BIT but disallows W|X mappings when it's enabled. Since we still use W|X mappins we can't use MAP_32BIT.
-rw-r--r--rts/Linker.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index 7f6c816e98..ebd99bd708 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -190,9 +190,10 @@ int ocTryLoad( ObjectCode* oc );
* small memory model on this architecture (see gcc docs,
* -mcmodel=small).
*
- * MAP_32BIT not available on OpenBSD/amd64
+ * MAP_32BIT not available on OpenBSD/amd64.
+ * Also, MAP_32BIT does not permit W|X mappings on Darwin (see #17353).
*/
-#if defined(x86_64_HOST_ARCH) && defined(MAP_32BIT)
+#if defined(x86_64_HOST_ARCH) && !defined(darwin_HOST_OS) && defined(MAP_32BIT)
#define TRY_MAP_32BIT MAP_32BIT
#else
#define TRY_MAP_32BIT 0