我正在使用 Xcode 4.5,部署目标为 iOS 5.1
当我编译我的应用程序时,我收到以下警告,这些方法与两个大小显着增加的特定方法有关。
ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in -[mfile method]. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
随后该应用程序在启动时抛出异常并出现以下错误:
dyld: vm_protect(0x00001000, 0x0078C000, false, 0x07) failed, result=2 for segment __TEXT in /var/mobile/Applications/8E764612-87ED-4A99-9C59-E56C934DA997/appname.app/appname
dyld dyld_fatal_error:
0x2feb20c4: trap
0x2feb20c8: nop
当我注释掉有问题的方法时,应用程序运行良好。
有什么建议?
最佳答案
以下是来自 Unity 论坛的回复:
In xcode 4.6 build settings change "Dont create position independent executables" from NO to Yes, thats it.
积分转至 阿米特柴
关于dyld - PIE 禁用。代码签名的 PIE 中不允许使用绝对寻址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14028601/