iPhone 上奇怪的动态链接
以下代码在 Xcode 创建的模板项目中崩溃。
int main(int argc, char *argv[])
{
uint64_t t64 = 100000;
double s = (double)t64; // Crash!
...
崩溃伴随有以下控制台输出,并且发生在 2.2.1 设备上,但不会发生在 3.0.1 设备上。编译 Thumb 或 ARM 时都会发生这种情况。
dyld: lazy symbol binding failed: Symbol not found: ___floatundidf
Referenced from: /var/mobile/Applications/15E9DC65-324D-4C3A-8477-DC8CFFA67DC1/MyApp.app/MyApp
Expected in: /usr/lib/libgcc_s.1.dylib
dyld: Symbol not found: ___floatundidf
Referenced from: /var/mobile/Applications/15E9DC65-324D-4C3A-8477-DC8CFFA67DC1/MyApp.app/MyApp
Expected in: /usr/lib/libgcc_s.1.dylib
该问题仅出现在 Base SDK 3.0 上,编译 2.2.1 没问题。不幸的是我有3.0增强功能。
The following code crashes in an Xcode created template project.
int main(int argc, char *argv[])
{
uint64_t t64 = 100000;
double s = (double)t64; // Crash!
...
The crash is accompanied with the following console output and occurs on a 2.2.1 device but not on 3.0.1 devices. It occurs both compiling for Thumb or ARM.
dyld: lazy symbol binding failed: Symbol not found: ___floatundidf
Referenced from: /var/mobile/Applications/15E9DC65-324D-4C3A-8477-DC8CFFA67DC1/MyApp.app/MyApp
Expected in: /usr/lib/libgcc_s.1.dylib
dyld: Symbol not found: ___floatundidf
Referenced from: /var/mobile/Applications/15E9DC65-324D-4C3A-8477-DC8CFFA67DC1/MyApp.app/MyApp
Expected in: /usr/lib/libgcc_s.1.dylib
The problem only occurs with a Base SDK of 3.0, compiling for 2.2.1 is fine. Unfortunately I have 3.0 enhancements.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当你说它适用于一个 iPhone 项目而不是另一个项目时,你是否使用不同的设置编译相同的代码?如果是这样,我会检查两者之间的设置有何不同,以找出问题的根源。
___floatundidf
应该是libgcc
的一部分,因此它可能在 2.2.1 SDK 的该库的 ARM 版本中缺失,但在 3.0.1 中存在(因此在前者但不是后者)。您可以使用nm
工具来检查它在两者中是否存在。如果 2.2.1 中缺少它,您应该向 Apple 提交错误。When you say it works on one iPhone project and not another, are you compiling the same code with different settings? If so I'd check to see what settings differ between the two to shed light on what might be at the root of the problem.
___floatundidf
should be part oflibgcc
so it might be missing in the ARM version of that libary for the 2.2.1 SDK but present in 3.0.1 (hence the crash in the former but not the latter). You can use thenm
tool to check for its existence in both. If it is missing from 2.2.1 you should file a bug with Apple.如果你这样做的话它会起作用。诡异的
It works if you do. Weird