Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current version of UnityDoorstop supports only x86 CPU architecture on MacOS. This patch adds support for arm64, which was enabled by integrating the latest version of plthook upstream into
plthook_osx.c
and re-adding the UnityDoorstop-specific public function,... which appears to work just fine after pulling in the changes from plthook upstream.
The build system has been updated to produce a MacOS Universal Binary, by first compiling the x86_64 and arm64 versions of the library, then smashing them together into a single file. You can distribute the Universal Binary as the only MacOS distributable for both Intel and Apple Silicon architectures, and it will automatically "do the right thing" when the user tries to use it, irrespective of their CPU architecture.
NOTE: due to MonoMod#90, game mod loaders that leverage UnityDoorstop as their entry point but use HarmonyX as their managed code patching library will still fail to work on Apple Silicon. This is an issue unrelated to UnityDoorstop, which by all accounts, appears to correctly load and hand over control to the mod loader.
Tested with BepInEx; confirmed that BepInEx's managed code starts running successfully, and it only crashes because of the MonoMod#90 issue mentioned above, which again isn't UnityDoorstop's fault.
Resolving this issue is a prerequisite to one day getting mod loaders to work with Apple Silicon on MacOS.
Resolves bug #61.