Block Rosetta on macOS 14.0, 14.1, and 14.2 (#15237)

This commit is contained in:
nastys 2024-02-24 15:15:19 +01:00 committed by GitHub
parent ac8e914a25
commit 2b385f28f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -60,6 +60,13 @@ DYNAMIC_IMPORT("ntdll.dll", NtSetTimerResolution, NTSTATUS(ULONG DesiredResoluti
#if defined(__APPLE__)
#include <dispatch/dispatch.h>
// sysinfo_darwin.mm
namespace Darwin_Version
{
extern int getNSmajorVersion();
extern int getNSminorVersion();
extern int getNSpatchVersion();
}
#endif
#include "Utilities/Config.h"
@ -519,6 +526,13 @@ int main(int argc, char** argv)
}
#endif
#ifdef __APPLE__
if ((Darwin_Version::getNSmajorVersion() == 14 && Darwin_Version::getNSminorVersion() < 3) && (utils::get_cpu_brand().rfind("VirtualApple", 0) == 0))
{
report_fatal_error("Unsupported Rosetta version.\nPlease update macOS to a supported version.");
}
#endif
ensure(thread_ctrl::is_main(), "Not main thread");
// Initialize TSC freq (in case it isn't)