-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apple M1 Support for MacOS #9441
Commits on May 22, 2021
-
This commit adds support for compiling Dolphin for ARM on MacOS so that it can run natively on the M1 processors without running through Rosseta2 emulation providing a 30-50% performance speedup and less hitches from Rosseta2. It consists of several key changes: - Adding support for W^X allocation(MAP_JIT) for the ARM JIT - Adding the machine context and config info to identify the M1 processor - Additions to the build system and docs to support building universal binaries - Adding code signing entitlements to access the MAP_JIT functionality - Updating the MoltenVK libvulkan.dylib to a newer version with M1 support
Configuration menu - View commit details
-
Copy full SHA for 4ecb308 - Browse repository at this point
Copy the full SHA 4ecb308View commit details -
Apple M1: Build, Analytics, and Memory Management
Analytics: - Incorporated fix to allow the full set of analytics that was recommended by spotlightishere BuildMacOSUniversalBinary: - The x86_64 slice for a universal binary is now built for 10.12 - The universal binary build script now can be configured though command line options instead of modifying the script itself. - os.system calls were replaced with equivalent subprocess calls - Formatting was reworked to be more PEP 8 compliant - The script was refactored to make it more modular - The com.apple.security.cs.disable-library-validation entitlement was removed Memory Management: - Changed the JITPageWrite*Execute*() functions to incorporate support for nesting Other: - Fixed several small lint errors - Fixed doc and formatting mistakes - Several small refactors to make things clearer
Configuration menu - View commit details
-
Copy full SHA for 948764d - Browse repository at this point
Copy the full SHA 948764dView commit details -
Apple M1: OS version checking for MAP_JIT
- Added MacOS version checking around MAP_JIT to prepare code for x86 MAP_JIT
Configuration menu - View commit details
-
Copy full SHA for 4542038 - Browse repository at this point
Copy the full SHA 4542038View commit details -
Apple M1: Refactor ArmCPUDetect.cpp
Merges two nested #ifndefs into a single #if around hw cap includes.
Configuration menu - View commit details
-
Copy full SHA for 61448a9 - Browse repository at this point
Copy the full SHA 61448a9View commit details -
Apple M1: Enable hardened runtime
- Fixed error that was causing the hardened runtime from being enabled - Refactored BuildMacOSUniversalBinary.py based on code style recommendations
Configuration menu - View commit details
-
Copy full SHA for 8cb86e7 - Browse repository at this point
Copy the full SHA 8cb86e7View commit details -
Apple M1: MacOS 11.2 mprotect restrictions
In MacOS 11.2 mprotect can no longer change the access protection settings of pages that were previously marked as executable to anything but PROT_NONE. This commit works around this new restriction by bypassing the mprotect based write protection and instead relying on the write protection provided by MAP_JIT.
Configuration menu - View commit details
-
Copy full SHA for 4ff4292 - Browse repository at this point
Copy the full SHA 4ff4292View commit details -
Apple M1: More robust build for universal binaries
- Fixed a typo in the Readme.md - Made the recursiveMergeBinaries function handle divergent binary file trees better.
Configuration menu - View commit details
-
Copy full SHA for 0851693 - Browse repository at this point
Copy the full SHA 0851693View commit details -
- Enabled MAP_JIT on x86_64 after confirming that pthread_jit* calls are only required for MAP_JIT pages on Apple Silicon
Configuration menu - View commit details
-
Copy full SHA for 38861f6 - Browse repository at this point
Copy the full SHA 38861f6View commit details -
Apple M1: Fix bug that could cause crash with MMU
Added a Common::JITPageWriteDisableExecuteEnable() that could be missed when a memory exception is triggered by the running game.
Configuration menu - View commit details
-
Copy full SHA for f92ccd5 - Browse repository at this point
Copy the full SHA f92ccd5View commit details -
Apple M1: Removed unavailable CPU core dialog box
Removed the unavailable CPU core dialog box that asked users to change their selected CPU core to one that is available. Instead, Dolphin now just overrides the core to the default, and logs that it performed the override.
Configuration menu - View commit details
-
Copy full SHA for f567fd9 - Browse repository at this point
Copy the full SHA f567fd9View commit details -
- Updated MoltenVK library in external to 1.2.170.0 (fixes swapchain crash)
Configuration menu - View commit details
-
Copy full SHA for bcb3c7d - Browse repository at this point
Copy the full SHA bcb3c7dView commit details -
Apple M1: Only add x86 compile flags to x86 builds
- Removed -mssse3 flag from arm64 builds - Removed -march=core2 from arm64 builds
Configuration menu - View commit details
-
Copy full SHA for 12c4398 - Browse repository at this point
Copy the full SHA 12c4398View commit details -
Apple M1: Support non-Xcode based universal builds
This change adds the -G and --build_type arguments to the BuildMacOSUniversalBinaray.py build script to allow the CMake generator and build type to be specified for universal binary builds. The defaults are: -G "Unix Makefiles" --build_type "Release"
Configuration menu - View commit details
-
Copy full SHA for 9163312 - Browse repository at this point
Copy the full SHA 9163312View commit details -
Readme: Update macOS build instructions
1) Place information about universal builds after single architecture builds since universal builds are harder to setup the environment for. 2) Specify that new arguments should be provided instead of direct script modification for universal builds.
Configuration menu - View commit details
-
Copy full SHA for 7a44a7e - Browse repository at this point
Copy the full SHA 7a44a7eView commit details -
Apple M1: Enable CMake cross compilation
Modify the build script to use CMake's cross compilation infrastructure instead of running CMake natively in x86_64 and arm64 mode to configure the two project files. This should fix the builds with CMake executables installed through homebrew and should pave the way for building universal binaries on x86_64 systems.
Configuration menu - View commit details
-
Copy full SHA for b72c47f - Browse repository at this point
Copy the full SHA b72c47fView commit details -
Apple M1: Improved handling of paths
Incorporated changes suggested by Kode54 to use the CMake prefix path, instead of relying on pkg-config directory paths. Added the prefix paths from the other architectures build to the CMake ignore path so that CMake doesn't pick up libraries from the wrong architecture if they are in the user's search path.
Configuration menu - View commit details
-
Copy full SHA for 1015cdc - Browse repository at this point
Copy the full SHA 1015cdcView commit details -
Apple M1: Fix code signing regression
This commit fixes a regression in 2ba88d5 that would cause an app bundle to not be resigned after merging the two single architecture builds. Also, applies formatting suggestions from Leo Lam
Configuration menu - View commit details
-
Copy full SHA for 76130d8 - Browse repository at this point
Copy the full SHA 76130d8View commit details -
Apple M1: RAII Wrapper for JITPageWrite*Execute*()
Added RAII wrapper around the the JITPageWriteEnableExecuteDisable() and JITPageWriteDisableExecuteEnable() to make it so that it is harder to forget to pair the calls in all code branches as suggested by leoetlino.
Configuration menu - View commit details
-
Copy full SHA for 76ed931 - Browse repository at this point
Copy the full SHA 76ed931View commit details -
Apple M1: Detect incompatible universal merges
Adds a step to detect when the Intel and arm64 build trees cannot be merged safely. This can occur when each side has files/folders that are named the same but are of different types or symlinks that are the same name but need to point to different locations for each architecture. Before this change, this would just fail silently.
Configuration menu - View commit details
-
Copy full SHA for abea411 - Browse repository at this point
Copy the full SHA abea411View commit details
Commits on May 24, 2021
-
Apple M1: Update AutoUpdate PlatformID
Adds a new PlatformID for universal builds. This will allow single architecture builds to be updated through the single architecture path, and universal builds to be updated with universal builds.
Configuration menu - View commit details
-
Copy full SHA for 210f6e7 - Browse repository at this point
Copy the full SHA 210f6e7View commit details