我在为iOS编译x264时遇到错误。
我有Xcode版本5.0(5A1413)和Apple LLVM版本5.0(clang-500.2.75)(基于LLVM 3.3svn)。我正在编译x264-snapshot-20130925-2245。
配置:
CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang ./configure \
--host=arm-apple-darwin \
--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk \
--prefix=armv7 \
--extra-cflags='-arch armv7' \
--extra-ldflags="-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/lib/system -arch armv7" \
--enable-pic \
--enable-static
出现错误:
common/arm/cpu-a.S:29:7: error: unknown token in expression
.align
^
common/arm/cpu-a.S:139:5: error: instruction 'suble' can not set flags, but 's' suffix specified
subles ip, ip, #1
^
最佳答案
Xcode 5工具链中的相关更改是LLVM编译器现在默认使用内置汇编程序,并且内置汇编程序需要更严格地遵守ARM统一汇编语言。
有两种方法可以使其与Xcode 5工具链一起编译:
汇编器发出许多错误,它们分为四类:
非常感谢Apple开发者论坛上的gparker!没有他/她的帮助,我无法弄清楚。 Link to forum discussion, Apple ID required.