From b689d8dccd3c260e88116285b7b75e827ca9954b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 4 Oct 2021 15:31:52 +0200 Subject: 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 --- src/corelib/text/qregularexpression.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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 #include +#if defined(Q_OS_MACOS) +#include +#endif + #define PCRE2_CODE_UNIT_WIDTH 16 #include @@ -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 -- cgit v1.2.3