【问题标题】:Compiling XZ Utils for iOS为 iOS 编译 XZ Utils
【发布时间】:2016-02-15 19:16:35
【问题描述】:

我正在尝试为 iOS 编译 XZ Utils。

我是如何运行的 ./configure:

CC="clang -arch armv7 -arch armv7s -arch arm64 \
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk" \
./configure --disable-dependency-tracking \
--host=arm-apple-darwin15.0.0 --build=x86_64-apple-darwin15.3.0

如果我只指定一种架构,它编译得很好。

configure:6216: clang -arch armv7 -arch armv7s -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -E  conftest.c
clang: error: cannot use 'cpp-output' output with multiple -arch options

我想要编译包含 armv7、armv7s 和 arm64 切片的胖二进制文件。有什么办法可以绕过clang这个限制?

【问题讨论】:

标签: c++ ios clang clang++ lzma


【解决方案1】:

您只能使用一种架构作为目标,您必须使用lipo 来创建胖库。

举个例子:

lipo -create -output fat.a thin1.a thin2.a

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-19
    • 2014-04-17
    • 2012-10-19
    • 2023-03-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多