-all_load 链接器标志有什么作用? [英] What does the -all_load linker flag do?

查看:26
本文介绍了-all_load 链接器标志有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在编译 Objective-C 代码时,我在任何地方都找不到 -all_load 标志的作用.

I can't find anywhere what the -all_load flag do when compiling Objective-C code.

我在将二进制文件上传到 Apple 时遇到了一些问题,他们说这是因为我没有使用这个标志,但我的代码即使没有它也能编译.

I have some issues uploading binaries to Apple, the they say it's because I didn't use this flag, but my code compiles even without it.

有人可以帮我吗?

谢谢

推荐答案

可能和这个技术说明有关 https://developer.apple.com/library/content/qa/qa1490/_index.html

It is probably related to this technical note https://developer.apple.com/library/content/qa/qa1490/_index.html

重要提示:对于 64 位和 iPhone 操作系统应用程序,存在一个链接器错误,该错误会阻止 -ObjC 从仅包含类别而不包含类的静态库加载对象文件.解决方法是使用 -all_load 或 -force_load 标志.-all_load 强制链接器从它看到的每个存档中加载所有目标文件,即使是那些没有 Objective-C 代码的文件.-force_load 在 Xcode 3.2 及更高版本中可用.它允许对存档加载进行更精细的控制.每个 -force_load 选项都必须跟一个存档路径,并且该存档中的每个目标文件都将被加载.

IMPORTANT: For 64-bit and iPhone OS applications, there is a linker bug that prevents -ObjC from loading objects files from static libraries that contain only categories and no classes. The workaround is to use the -all_load or -force_load flags. -all_load forces the linker to load all object files from every archive it sees, even those without Objective-C code. -force_load is available in Xcode 3.2 and later. It allows finer grain control of archive loading. Each -force_load option must be followed by a path to an archive, and every object file in that archive will be loaded.

这篇关于-all_load 链接器标志有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆