summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-10-04 15:31:52 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-10-05 20:28:41 +0000
commitb689d8dccd3c260e88116285b7b75e827ca9954b (patch)
tree82b5484040de6b0441d0becb82e8615ea9f1405e
parent60caec953f76b1c63ff526c84cc968b5f83eabdf (diff)
macOS: Disable PCRE JIT when running under Rosetta
Although the Apple docs claim that Rosetta can translate apps that contain just-in-time (JIT) compilers, it seems to have problems with the PCRE JIT. https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment To be on the safe side we disable the JIT explicitly when detecting that we are running under Rosetta. It's already disabled when we're running on macOS ARM natively (see 2f8df4d1a87df9dd67913b016171dac20839d16e). Fixes: QTBUG-97085 Pick-to: 6.2 Change-Id: I0e133939f28087560d4bc8354b7e49013e94a9f9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r--src/corelib/text/qregularexpression.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/text/qregularexpression.cpp b/src/corelib/text/qregularexpression.cpp
index 7a425254ab..6e7781cda3 100644
--- a/src/corelib/text/qregularexpression.cpp
+++ b/src/corelib/text/qregularexpression.cpp
@@ -52,6 +52,10 @@
#include <QtCore/qatomic.h>
#include <QtCore/qdatastream.h>
+#if defined(Q_OS_MACOS)
+#include <QtCore/private/qcore_mac_p.h>
+#endif
+
#define PCRE2_CODE_UNIT_WIDTH 16
#include <pcre2.h>
@@ -1011,6 +1015,8 @@ static bool isJitEnabled()
#ifdef QT_DEBUG
return false;
+#elif defined(Q_OS_MACOS)
+ return !qt_mac_runningUnderRosetta();
#else
return true;
#endif