macos 如何将“胖”库变成“非胖”库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5352113/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 07:50:55  来源:igfitidea点击:

How do I turn a "fat" library into a "non-fat" library?

c++macoscompiler-construction

提问by tofutim

I'm trying to remove a duplicate object from a library with armv6 and armv7 architectures, i.e.,

我正在尝试从具有 armv6 和 armv7 架构的库中删除重复的对象,即,

$ lipo -info libx.a Architectures in the fat file: libx.a are: armv6 armv7

$ lipo -info libx.a 胖文件中的架构:libx.a 是:armv6 armv7

As expected, "ar d" does not work directly so I used "lipo -extract" to split the library. However, the resulting libraries are still 'fat' architecture.

正如预期的那样,“ar d”不能直接工作,所以我使用“lipo -extract”来拆分库。然而,由此产生的库仍然是“胖”架构。

$ ar d libx-armv6.a offendingduplicate.o ar: libx-armv6.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it) ar: libx-armv6.a: Inappropriate file type or format

$ lipo -info x-armv6.a Architectures in the fat file: libx.a are: armv6

$ ar d libx-armv6.a offendingduplicate.o ar:libx-armv6.a 是一个胖文件(在其上使用 libtool(1) 或 lipo(1) 和 ar(1)) ar:libx-armv6.a:不合适文件类型或格式

$ lipo -info x-armv6.a 胖文件中的架构:libx.a 是:armv6

How can I un-fattify the library? (You can imagine the sorts of links that come up when you search for 'remove lipo fat file' in Google. Help!!)

我怎样才能使图书馆脱脂?(您可以想象当您在 Google 中搜索“删除脂肪脂肪文件”时出现的各种链接。帮助!!)

回答by Jonathan

I am not familiar with lipo, but from its man page, it looks like you should be able to do this:

我不熟悉lipo,但从它的手册页看来,您应该能够做到这一点:

lipo libx.a -thin armv6 -output libx-armv6.a
lipo libx.a -thin armv7 -output libx-armv7.a