Work around QRegularExpression crashes on macOS with Rosetta

Looks like the regular expression jitting is not reentrant when running
under Rosetta for some reason. It was crashing when loading bigger
subdir .pro files which regular expressions in it, like qtcreator.pro.

Disable JIT if we run under Rosetta.

Task-number: QTBUG-97085
Change-Id: Icbab1ca8f62afa9cc86045983e84087a7694b5ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Eike Ziller
2021-10-04 15:31:30 +02:00
parent b07e29eb79
commit ab16f2984b

View File

@@ -492,6 +492,11 @@ int main(int argc, char **argv)
QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar);
}
if (Utils::HostOsInfo::isRunningUnderRosetta()) {
// work around QTBUG-97085: QRegularExpression jitting is not reentrant under Rosetta
qputenv("QT_ENABLE_REGEXP_JIT", "0");
}
Utils::TemporaryDirectory::setMasterTemporaryDirectory(QDir::tempPath() + "/" + Core::Constants::IDE_CASED_ID + "-XXXXXX");
#ifdef Q_OS_MACOS