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
iOS 13 + 14 arm64e fixes: support for architecture-specific schemas and schema-specific toolchains #574
base: master
Are you sure you want to change the base?
Conversation
This allows users to specify schema-specific toolchains
Whilst I’m happy to leave it online for now, the patched lipo probably wants hosting somewhere a bit safer than Dropbox. Long term I believe the idea should be that is handled by something a bit less hacky? |
For sure, sorry if that wasn't clear – I do want to figure out a more long-term solution for lipo before merging. I'll add that to the list of to-dos in the PR. |
Looks great 👍 This is the list that seems to be good to add as todo for after discuss architecture phase.
|
@r-plus it turns out iOS 13 arm64e libraries (including tweaks) might work on iOS 14 so if that's the case we probably won't update the template. We're still investigating the matter. @danpashin thanks for the report, I'll look into the issue. |
Fixes FINALPACKAGE builds
@danpashin I believe 85a8cd6 should fix your issue; could you please confirm that this is indeed the case? |
@kabiroberai yup, works fine. Thanks :) |
nicely works on M1 mac! (Rosetta; patched lipo binary contains only x86_64 for now) Makefile
result confirmations
|
@kabiroberai Is it necessary to have both Xcode 11 and 12 installed to build a tweak? I have Xcode 12 installed but have an Xcode 11 toolchain in my theos directory. How can i specify theos to use that toolchain to compile the v1 slice?
but it fails:
@r-plus How do you manage to run
|
@foxfortmobile using a default Xcode toolchain outside the host Xcode app is not supported and is prone to breakage. You should have both Xcode versions installed if you want to build two arm64e slices. Like I said before though, there's a chance Xcode 11 alone should be enough to build tweaks for both iOS 13 and 14, which is something we'll try to confirm soon. If that's indeed the case, dual-toolchain support will only be required for apps and command line tools that need to use arm64e for whatever reason. |
@foxfortmobile You may be able to make it work by creating a structure like:
But no guarantees whether xcrun will understand that. |
You could also set |
Some time ago there was the issue that many devs were having regarding Xcode 12 compiled tweaks were not working on A12+ devices. One workaround suggested on r/jailbreakdevelopers was to use an xcode 11 toolchain as theos prefix I tried doing the following but it had same errror. So i set it to full Xcode 11 developer as advised and it compiled successfully.
How do verify it using otool?
By the way i have some tweaks linked against frameworks like |
You might want to include an Xcode 11 arm64e slice in the framework. |
@foxfortmobile FYI about otool
arm64arm64e version of
So we can confirm it by $ otool -f .theos/obj/debug/DeleteCut.dylib
x64x64 version of otool can confirm it simply by $ otool -h .theos/obj/debug/DeleteCut.dylib
intel x64But yes, otool on intel mac display error you showed. Update: BigSur contained otool version cctools-977.1 executable for this purpose on intel mac. |
@kabiroberai Surely there's a way to do this for the next several without requiring two copies of Xcode? 😕 (Such as using an OSS toolchain like you said and mentioned to me) I guess that's the feedback that I have on this feature:
|
@NSExceptional see #563 (comment) and the comments prior to that |
Xcode11 can not running on macOS Monterey. |
You can still use its command line tools by using |
I used the lipo on https://www.dropbox.com/s/6h85hlc4sm14zeg/lipo?dl=0. tested on macOS Monterey 12.0.1, Xcode 13.1, Xcode 11.5. When compiling the tweak, it failed: My makefile added: Please help me to fix this error? |
My DEV Environment: Device: 16" M1 Max, 10C/32C GPU Operating System: macOS 12.0.1 Platform: macOS Target Platform: iOS (arm64, arm64e iOS 13, arm64e iOS 14) Toolchain Version: Xcode 11.7 + Xcode 13.1 SDK Version: iOS 13.7 + iOS 15 Issue 1:
The entire code is available here along with all MakeFiles. Issue 2: The generated dylibs are not compatible on iOS 13.5 (iPhone 11 Pro Max). I'm not certain the linked patched lipo is causing trouble or something else. I see below long on console from my device:
|
(Thanks for sending a pull request! Please make sure you click the link above to view the contribution guidelines, then fill out the blanks below.)
What does this implement/fix? Explain your changes.
This PR adds support for modifying the Theos schema depending on the architecture, including the ability to build a single architecture multiple times using different schemas. It also makes variables like
PREFIX
,SDKBINPATH
,THEOS_PLATFORM_SDK_ROOT
respect schema overrides, so you can specify a custom toolchain based on the schema+arch combination.Does this close any currently open issues?
Closes #563.
Any relevant logs, error output, etc?
(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)
Nope
Any other comments?
You do unfortunately need to use a patched
lipo
if you're building the multiple schemas for the same architecture. As a temporary solution, the patched binary linked here should work: #563 (comment).Using these changes, you can build a binary containing slices with both the iOS 13 and iOS 14 arm64e ABIs by putting something like this at the top of your Makefile (note that the older toolchain must correspond to the schema that's listed first for that cpu subtype in
ARCHS
, so, e.g.ARCHS = arm64 arm64e:v2 arm64e:v1
would not work – at least for apps if not for libraries):A few things we should do before merging this:
SDKBINPATH
/SWIFTBINPATH
/PREFIX
variables).Where has this been tested?
Operating System: macOS 11.1 (20C69)
Platform: macOS
Target Platform: iOS (arm64, arm64e iOS 13, arm64e iOS 14)
Toolchain Version: Xcode 11.7 + Xcode 12.3
SDK Version: iOS 13.7 + iOS 14.3