gpt4 book ai didi

bitcode - 如何检查构建的静态库是否包含位码?

转载 作者:行者123 更新时间:2023-12-03 08:23:17 24 4
gpt4 key购买 nike

我有一个由其他公司构建的静态库。我想知道它是否是包含bitcode的静态库,哪个命令可以在终端中检测到它?

最佳答案

正如其他答案中已经写的那样,

otool -l yourlib.a | grep __LLVM

是要走的路。

Apple engineer says使用
otool -l yourlib.a | grep bitcode

不可靠 .

Searching for a "bitcode" section is not a reliable way to detect if your files contain embedded bitcode. If you want to do that, search for the "__LLVM" segment. You should be aware that a normal build with the -fembed-bitcode-marker option will produce minimal size embedded bitcode sections without any real content. This is done as a way of testing the bitcode-related aspects of your build without slowing down the build process. The actual bitcode content is included when you do an Archive build.



另见 xCocoa 的评论.

看来, otool如果包含 iPhone 模拟器架构的代码(x86_64 或 i386),则不会报告位码。

您可以使用以下命令列出库的架构:
lipo -info yourlib.a

然后您可以分别检查每个架构的位码,例如:
otool -arch armv7 -l yourlib.a  | grep bitcode
otool -arch arm64 -l yourlib.a | grep bitcode

关于bitcode - 如何检查构建的静态库是否包含位码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32755775/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com