Since June, 22nd 2020, Apple released Xcode 12, that introduced an internal change to Xcode, breaking arm64e compilation for tweak developers. This is due to the update of clang/LLVM (AFAIK) in Xcode 12.
More specifically:
- compiling code for arm64e with Xcode 11 Toolchain will allow this code to run
only on iOS 13 and lowerfor all versions!. - compiling code for arm64e with Xcode 12 Toolchain will allow this code to run only for iOS 14 (and up).
No error is produced during compilation. arm64 slices are not concerned and will always work.
Apps and other "classic" stuff are not impacted by this change, because they only need to be compiled for arm64, which is not impacted by this change. Only IPAs, debs, and "system" stuff that need to be compiled for arm64e are impacted.
Methods to allow arm64e compiling. Tested on macOS Catalina & Big Sur.
This method consists on swapping the Xcode 12 toolchain with the one of Xcode 11:
- Execute the script below (please take a look at it and change variables as needed) if your setup is similar to mine.
- If you have Xcode 11 installed too, go to
Xcode 12 › Xcode › Preferences › Locations › Command Line Tools
and change to Xcode 11.x in the dropdown menu.
Although it's not recommended by theos maintainers, it works well and is less constraining that switching between Xcode installations (which it not even possible anymore with Apple Silicon Macs). If you cannot get Xcode 11, download its toolchain here.
To proceed, add this in your tweak's Makefile:
PREFIX="/path/to/xcode-11-xctoolchain/usr/bin/"
OR
compile your tweak like this:
make package PREFIX="/path/to/xcode-11-xctoolchain/usr/bin/"
Painful and only for Intel Macs, but the best solution according to @kabiroberai. Depending on your configuration/available storage, you can:
- Stay with Xcode 11 and don't update
- Use Xcode 11 as main but sideload Xcode 12 for other purposes (thanks to this awesome tool)
- Use Xcode 12 as main but switch installations each time you want to compile for arm64e too (similar to above):
sudo xcode-select -s /path/to/Xcode_11.app
,make package
, then againsudo xcode-select -s /path/to/Xcode_12.app
Waiting for the fix within theos to support both arm64e slices in only one package, there is a "bypass" available to create this type of package. To do so, simply use opa334's script to compile your code with the patched lipo binary by Matchstic (called plipo
).
- This Twitter thread, devs feedbacks and my observations (and my pain).
- This update from @opa334, thanks to @sbingner.
- theos opened issue
Disclaimer: I may be not perfectly exact on the terms I use, correct me if I'm wrong!
Update 1: clarified a bit, added double slices part, fixed typo
Update 2: fixed link
Update 3: rollback to previous system, bye "double slices"!
Update 4: mentioned "the best" solution, improved some points
Update 5: add mention of M1 Macs and link to Xcode 11 toolchain