File 0967-erts-Disable-the-JIT-on-x86-Macs.patch of Package erlang
From 5c9581eb409f5ef180447fbf34059bfe9b734f77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?John=20H=C3=B6gberg?= <john@erlang.org>
Date: Mon, 29 Jan 2024 22:06:18 +0100
Subject: [PATCH] erts: Disable the JIT on x86 Macs
---
erts/configure | 18 +++++++++++++++++-
erts/configure.ac | 17 ++++++++++++++++-
2 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/erts/configure b/erts/configure
index a09c84ff09..8d2083aa48 100755
--- a/erts/configure
+++ b/erts/configure
@@ -21838,7 +21838,23 @@ then :
if test ${enable_jit} != no; then
case "$ARCH" in
amd64)
- JIT_ARCH=x86
+ case "$OPSYS" in
+ darwin)
+ # MacOS Sonoma introduced some very annoying popups when
+ # dual-mapping memory through the documented APIs, and we did
+ # not wish to start using undocumented functionality in a patch
+ # release, so we have disabled the JIT on this platform.
+ #
+ # The ARM JIT is unaffected because it uses per-thread
+ # permissions instead of dual-mapped memory.
+ enable_jit=no
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: JIT disabled due to lack to support on x86 Macs" >&5
+printf "%s\n" "$as_me: WARNING: JIT disabled due to lack to support on x86 Macs" >&2;}
+ ;;
+ *)
+ JIT_ARCH=x86
+ ;;
+ esac
;;
*)
if test ${enable_jit} = yes; then
diff --git a/erts/configure.in b/erts/configure.in
index 540cc4b3cb..a684879027 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -2872,7 +2872,22 @@ AS_IF([test ${enable_jit} != no],
if test ${enable_jit} != no; then
case "$ARCH" in
amd64)
- JIT_ARCH=x86
+ case "$OPSYS" in
+ darwin)
+ # MacOS Sonoma introduced some very annoying popups when
+ # dual-mapping memory through the documented APIs, and we did
+ # not wish to start using undocumented functionality in a patch
+ # release, so we have disabled the JIT on this platform.
+ #
+ # The ARM JIT is unaffected because it uses per-thread
+ # permissions instead of dual-mapped memory.
+ enable_jit=no
+ AC_MSG_WARN([JIT disabled due to lack to support on x86 Macs])
+ ;;
+ *)
+ JIT_ARCH=x86
+ ;;
+ esac
;;
*)
if test ${enable_jit} = yes; then
--
2.35.3