diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2021-10-04 15:31:52 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-10-05 22:27:16 +0000 |
commit | 9b80b06ed43249c0b169f4258c44862f01f34929 (patch) | |
tree | c42b9283ea66f7e021886386057ff3d8cfc292c8 /src/corelib | |
parent | 4901e9215b9a406ca45e6efe676cf21961f7d774 (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
Change-Id: I0e133939f28087560d4bc8354b7e49013e94a9f9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit b689d8dccd3c260e88116285b7b75e827ca9954b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/text/qregularexpression.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/text/qregularexpression.cpp b/src/corelib/text/qregularexpression.cpp index e055ae064a..52134e3240 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 |