We cannot build our iOS app in Xcode with Optimisation Level set to "None":
Xcode gives a error on linker stage:
ld: b(l) ARM64 branch out of range (138312952 max is +/-128MB): from _main (0x100006F10) to __Unwind_Resume@0x00000000 (0x1083EED14) in '_main' from /Users/user/Library/Developer/Xcode/DerivedData/OurApp-banhncbunovfpngtiwyxnvvokvnc/Build/Intermediates.noindex/OurApp.build/ReleaseForRunning-iphoneos/OurApp.build/Objects-normal/arm64/main.o
We think this is because our binary is too large.
We can build with Optimization Level set to Fastest, Smallest:
But we cannot debug and stop in breakpoints - they are broken with tthis optimization level.
With "Fastest, smallest" our binary file size is about 660 MBs.
We think that with "None" optimization level binary size exceeds some clang/ld limit, and this cause
ARM64 branch out of range
error.
We cannot easily remove a lot of code from our project now. And even if we do so, our codebase grows very fast.
So even if we remove some code now, the problem will soon appear again.
We tried to look for a some option that enlarges max file size in clang/ld, but cannot find it.
Also we have found that our adhoc builds release have binary file size much smaller - its about 230 MBs.
We think this is related to debug info that Xcode places to debug builds.
Are there any way to make debug builds in Xcode again?
May be some setting in Xcode/clang/ld that changes binary file size limit.
Or maybe another (more compact) format of debug info, to make our Debug binaries smaller.
Update 1:
We found that we can run on non-64bit devices, when set Build Active Architecture Only to YES. But these devices are very weak for our app, and we cannot debug all features that we want - device crashes by low memory condition before we can debug it.
Update 2:
Xcode does not allow to run armv7-only app on devices with 64 bit support. If someone knows a way to run armv7-only build on 64-bit device, please share. Such solution will be appropriate for us - we will build armv7-only build which is much smaller than armv7+arm64 build.
User contributions licensed under CC BY-SA 3.0