Added IL2CPP_LARGE_EXECUTABLE_ARM_WORKAROUND to xcodebuild and the issue seems to be gone for now.
For those who are building via xcodebuild, the command would look like this:
I cannot get it to work. It seems like the flag got passed fine, but it’s not being considered by the build properly or smth
ld: B/BL out of range 182887748 (max +/-128MB) to ‘__ZN3Geo8GeoArrayIPKN9Enlighten13MaterialGuids12InstanceInfoEE11SetCapacityEi’
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is the command
xcodebuild -project Unity-iPhone.xcodeproj GCC_PREPROCESSOR_DEFINITIONS=‘IL2CPP_LARGE_EXECUTABLE_ARM_WORKAROUND=1’ -archivePath build.xcarchive archive -scheme “Unity-iPhone”
@JoshPeterson we wanted to bump this thread. We started seeing this exact issue with the macOS Sonoma and Xcode 15 upgrade on our build farm. The builds were working just fine yesterday, and post the upgrades the builds now fail with this issue.
We’re currently on 2022.3.11f1 and are seeing the following:
d: B/BL out of range 144489060 (max +/-128MB) to '__ZN3Geo8GeoArrayIPKN9Enlighten13MaterialGuids12InstanceInfoEE11SetCapacityEi'
The workaround above does not work, however if you add -ld64 to the other linker flags on the Unity target and framework allows it to build.
It was working still in 2023.1.x and maybe also 2023.2.0f and 2023.2.4f.
Changing target/scheme to default Unity-iPhone (where the Data folder is not a part of UnityFramework) makes it build for me, but this way it’s not cleanly (or perhaps at all) possible to add my Swift files of my native app, so it’s not a solution.
Thanks, you mean switching “Project Settings > Player > Android > Other Settings > IL2CPP Code Generation > Faster runtime” to “Faster (smaller) builds”?
If so, I’d rather have the default “faster runtime”.
As soon as we upgraded to unity 2022 LTS, started to get a similar issue, looks like production and development builds (without script debugging) work, however, having the script debugging enabled non of the workarounds resolved the “branch out of range” issue.
Moving the “Data” folder to the native iOS app didn’t resolve “B/BL out of range” issue.
Unity closed my bug report without resolution because they couldn’t reproduce it.
However, I noticed there are similar issues in their bug tracker already and the second one is especially relevant, but it got “WON’T FIX” status, which I think is a mistake:
What helped was switching from “faster runtime” to “smaller builds” in IL2CPP, but I’m observing significant overheating on iPhone and like 25-50% downgrade in performance compared to the same class of Android phone.
So, the issue is still there and I consider this to be a workaround.
We’re now running into the same issue after upgrading from Unity 2021.3.29f1 to Unity 2022.3.21f1 (funnily enough only for release builds, not development builds).
As suggested by Josh, activating the workaround works for us, even though I’m a bit hesitant to release version that will have worse stack traces. The file can be found here:
I found that adding GCC_PREPROCESSOR_DEFINITIONS IL2CPP_LARGE_EXECUTABLE_ARM_WORKAROUND=1 to xcodebuild didn‘t work for me,but I found a workaround to chang this symbol.
You can use sed -i -e to change the specific line in the il2cpp-config-platforms.h .
So for me , my Unity version is 2022.3 , so I can find this file from Il2CppOutputProject/IL2CPP/libil2cpp/os/c-api/ in the build folder , and change the 69 line .