可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I faced with strange problem. I installed iPhone SDK 4.3 and xCode 4 and now I can't compile libav from ffmpeg for ARMv6 architecture. This is my script to compile it (it works fine for iPhone SDK 4.2):
./configure \ --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile \ --enable-encoder=rawvideo \ --enable-decoder=h264 \ --enable-decoder=mpeg4 \ --enable-encoder=mjpeg \ --enable-muxer=rawvideo \ --enable-demuxer=h264 \ --enable-parser=h264 \ --enable-cross-compile \ --arch=c \ --target-os=darwin \ --enable-libopencore-amrnb --enable-libopencore-amrwb \ --cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1 \ --as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer /usr/bin/arm-apple-darwin10-gcc-4.2.1' \ --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk \ --cpu=arm1176jzf-s --extra-cflags='-arch armv6' --extra-ldflags='-arch armv6' make clean make
as a result I get library files but when I check it with lipo -info command it shows that library was compiled for i386 architecture.
Maybe somebody faced with such problem? Help me please.
Thanks.
回答1:
Updated Post
Here is an updated script that removes armv6, adds armv7s, uses the iOS 6.0 SDK, and fixes issues with changes to the lipo tool. Make sure you have the latest gas-preprocessor.pl from github in /usr/local/bin:
rm -r ./compiled # configure for armv7 build ./configure \ --cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \ --as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \ --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk \ --extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/lib/system \ --target-os=darwin \ --arch=arm \ --cpu=cortex-a8 \ --extra-cflags='-arch armv7' \ --extra-ldflags='-arch armv7' \ --extra-cflags='-mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad' \ --prefix=compiled/armv7 \ --enable-pic \ --enable-neon \ --enable-cross-compile \ --enable-optimizations \ --disable-debug \ --disable-armv5te \ --disable-armv6 \ --disable-armv6t2 \ --disable-armvfp \ --disable-ffmpeg \ --disable-ffplay \ --disable-ffserver \ --disable-ffprobe \ --disable-doc # build for armv7 make clean make && make install # configure for armv7s build ./configure \ --cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \ --as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \ --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk \ --extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/