为armv6和armv7构建iPhone静态库,其中包括另一个静态库

发布于 2024-08-25 22:51:43 字数 797 浏览 7 评论 0原文

我有一个 Xcode 项目,它有一个“主”静态库目标,其中包括/链接到其他 Xcode 项目中的一堆其他静态库。

构建“Optimized (armv6 armv7)”的主库目标时,在最后阶段的 CreateUniversalBinary 步骤中发生错误。对于主库包含的库的每个 .o 文件,都会报告以下错误(例如 FBConnectGlobal.o 文件):

warning for architecture: armv6 same member name (FBConnectGlobal.o) 
in output file used for input files: /Developer_Beta/Builds/MTToolbox/MTToolbox.build/Debug-iphoneos/MTToolbox.build/Objects-normal/armv6/libMTToolbox.a(FBConnectGlobal.o) 
and: /Developer_Beta/Builds/MTToolbox/MTToolbox.build/Debug-iphoneos/MTToolbox.build/Objects-normal/armv7/libMTToolbox.a(FBConnectGlobal.o) 
due to use of basename, truncation and blank padding

最后,Xcode 告知构建已成功。但是,当在应用程序项目中使用最终静态库时,它不会构建,因为它在构建的一个部分(armv6)中发现了重复的符号,而在构建的另一部分(armv7)中遗漏了符号。

有什么想法如何解决这个问题吗?

中号

I have an Xcode project that has a "master" static library target, that includes/links to a bunch of other static libraries from other Xcode projects.

When building the master library target for "Optimized (armv6 armv7)", an error occurs in the last phase, during the CreateUniversalBinary step. For each .o file of the libraries that is included by the master library, the following error is reported (for example, the FBConnectGlobal.o file):

warning for architecture: armv6 same member name (FBConnectGlobal.o) 
in output file used for input files: /Developer_Beta/Builds/MTToolbox/MTToolbox.build/Debug-iphoneos/MTToolbox.build/Objects-normal/armv6/libMTToolbox.a(FBConnectGlobal.o) 
and: /Developer_Beta/Builds/MTToolbox/MTToolbox.build/Debug-iphoneos/MTToolbox.build/Objects-normal/armv7/libMTToolbox.a(FBConnectGlobal.o) 
due to use of basename, truncation and blank padding

In the end, Xcode tells that the build has succeeded. However, when using the final static library in an application project, it won't build because it finds duplicate symbols in one part of build (armv6) and misses symbols in the other part of the build (armv7).

Any ideas how to fix this?

M

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

盛夏尉蓝 2024-09-01 22:51:43

我认为这根本不是答案。如果你没有两种架构,它完全可以工作。在链接中给出的示例中,可以将库 a、b 和 c 链接到一个库中,并与其链接。

Carl 遇到的问题是库中有两种不同的体系结构(arm6 和 arm7),并且链接器无法正确解析它们。

我发现了问题。据我所知,这是 libtool 中的一个错误。请参阅我的帖子以获取解决方案:

https://binaryfinery.wordpress.com/2010/06/11/universal-static-library-problem-in-iphone-sdk/

I dont think that's the answer at all. It will totally work if you don't have two architectures in there. In the example given in the link, it is possible to link libraries a, b, and c into one library, and link with that.

The problem that Carl is having is that there are two different architectures in the library (arm6 and arm7) and the linker is failing to resolve them correctly.

I found the problem. Its a bug in libtool as far as I can tell. See my post for a solution:

https://binaryfinery.wordpress.com/2010/06/11/universal-static-library-problem-in-iphone-sdk/

何时共饮酒 2024-09-01 22:51:43

我发现的另一个修复是将架构设置为“armv6”。 ARCHS_STANDARD_32_BIT 从 armv6 更改为“armv6 armv7”,这加剧了您上面描述的 libtool 错误。显然它不会生成armv7优化的二进制文件,但它在iPhone 4上应该仍然可以正常工作。

Another fix I found is to set Architectures to "armv6". ARCHS_STANDARD_32_BIT changed from armv6 to "armv6 armv7" which aggravates the libtool bug you describe above. Obviously it won't be producing armv7 optimized binaries, but it should still work fine on iPhone 4.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文