Ios 适配64位,arm64编译错误

项目适配64位,指令集添加了“arm64”。

Build Active Architecture Only选为YES

连机调试,iphone4编译OK,iphone5s编译报错:

final section layout:
__TEXT/__text addr=0x1000044B4, size=0x0AC5D808, fileOffset=0x000044B4, type=1
…与上面类似

ld: b(l) ARM64 branch out of range (180743200 max is +/-128MB): from __ZN10ClassNameEv (0x100004560) to __Unwind_Resume@0x00000000 (0x10AC6351C)
in ‘__ZN10ClassNameC2Ev’ from /Users/Name/Desktop/Project路径/Debug-iphoneos/Project.build/Objects-normal/arm64/ClassName.o for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

经过试验,应该要编译的文件太多,生成的目标文件太大。之前Compile Sources有将近900个,就会报错。我去掉了几个大功能,Compile Sources数量为600多。编译链接通过并且在真机上运行了。尝试再加入一些类,将近700的时候,又报错了。