iPhone SDK 4.3 libav编译问题

发布于 2024-10-28 06:38:49 字数 1041 浏览 1 评论 0 原文

我遇到了奇怪的问题。我安装了 iPhone SDK 4.3 和 xCode 4,现在无法从 ffmpeg 为 ARMv6 架构编译 libav。这是我编译它的脚本(它适用于 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   

结果我得到了库文件,但是当我使用 lipo -info 命令检查它时,它显示该库是为 i386 架构编译的。

也许有人遇到过这样的问题?请帮助我。

谢谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怪我太投入 2024-11-04 06:38:49

更新的帖子

这是一个更新的脚本,删除了armv6,添加了armv7s,使用iOS 6.0 SDK,并修复了lipo工具的更改问题。确保您拥有来自 gas-preprocessor.pl /usr/local/bin 中的“nofollow">github

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/iPhoneOS6.0.sdk/usr/lib/system \
--target-os=darwin \
--arch=arm \
--cpu=cortex-a8 \
--extra-cflags='-arch armv7s' \
--extra-ldflags='-arch armv7s' \
--extra-cflags='-mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad' \
--prefix=compiled/armv7s \
--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 armv7s
make clean
make && make install

# configure for i386 build
./configure \
--cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' \
--sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/lib/system \
--target-os=darwin \
--arch=i386 \
--cpu=i386 \
--extra-cflags='-arch i386' \
--extra-ldflags='-arch i386' \
--prefix=compiled/i386 \
--enable-cross-compile \
--disable-mmx \
--disable-armv5te \
--disable-armv6 \
--disable-armv6t2 \
--disable-armvfp \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc

# build for i386
make clean
make && make install

# make fat (universal) libs
mkdir -p ./compiled/fat/lib

lipo -output ./compiled/fat/lib/libavcodec.a  -create \
./compiled/armv7s/lib/libavcodec.a \
./compiled/armv7/lib/libavcodec.a \
./compiled/i386/lib/libavcodec.a

lipo -output ./compiled/fat/lib/libavdevice.a  -create \
./compiled/armv7s/lib/libavdevice.a \
./compiled/armv7/lib/libavdevice.a \
./compiled/i386/lib/libavdevice.a

lipo -output ./compiled/fat/lib/libavfilter.a  -create \
./compiled/armv7s/lib/libavfilter.a \
./compiled/armv7/lib/libavfilter.a \
./compiled/i386/lib/libavfilter.a

lipo -output ./compiled/fat/lib/libavformat.a  -create \
./compiled/armv7s/lib/libavformat.a \
./compiled/armv7/lib/libavformat.a \
./compiled/i386/lib/libavformat.a

lipo -output ./compiled/fat/lib/libavutil.a  -create \
./compiled/armv7s/lib/libavutil.a \
./compiled/armv7/lib/libavutil.a \
./compiled/i386/lib/libavutil.a

lipo -output ./compiled/fat/lib/libswresample.a  -create \
./compiled/armv7s/lib/libswresample.a \
./compiled/armv7/lib/libswresample.a \
./compiled/i386/lib/libswresample.a

lipo -output ./compiled/fat/lib/libswscale.a  -create \
./compiled/armv7s/lib/libswscale.a \
./compiled/armv7/lib/libswscale.a \
./compiled/i386/lib/libswscale.a

原始帖子

这将为armv6、armv7和i386架构构建ffmpeg静态库并将它们组合起来进入 iOS 4.3(iPhoneOS4.3 和 iPhoneSimulator4.3)的 fat(通用)文件:

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/iPhoneOS4.3.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/system \
--target-os=darwin \
--arch=arm \
--cpu=cortex-a8 \
--extra-cflags='-arch armv7' \
--extra-ldflags='-arch armv7' \
--prefix=compiled/armv7 \
--enable-pic \
--enable-cross-compile \
--disable-armv5te \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc

# build for armv7
make clean
make && make install

# configure for armv6 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/iPhoneOS4.3.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/system \
--target-os=darwin \
--arch=arm \
--cpu=arm1176jzf-s \
--extra-cflags='-arch armv6' \
--extra-ldflags='-arch armv6' \
--prefix=compiled/armv6 \
--enable-cross-compile \
--disable-armv5te \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc

# build for armv6
make clean
make && make install

# configure for i386 build
./configure \
--cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' \
--sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/system \
--target-os=darwin \
--arch=i386 \
--cpu=i386 \
--extra-cflags='-arch i386' \
--extra-ldflags='-arch i386' \
--prefix=compiled/i386 \
--enable-cross-compile \
--disable-armv5te \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc

# build for i386
make clean
make && make install

# make fat (universal) libs
mkdir -p ./compiled/fat/lib

lipo -output ./compiled/fat/lib/libavcodec.a  -create \
-arch armv6 ./compiled/armv6/lib/libavcodec.a \
-arch armv7 ./compiled/armv7/lib/libavcodec.a \
-arch i386 ./compiled/i386/lib/libavcodec.a

lipo -output ./compiled/fat/lib/libavdevice.a  -create \
-arch armv6 ./compiled/armv6/lib/libavdevice.a \
-arch armv7 ./compiled/armv7/lib/libavdevice.a \
-arch i386 ./compiled/i386/lib/libavdevice.a

lipo -output ./compiled/fat/lib/libavfilter.a  -create \
-arch armv6 ./compiled/armv6/lib/libavfilter.a \
-arch armv7 ./compiled/armv7/lib/libavfilter.a \
-arch i386 ./compiled/i386/lib/libavfilter.a

lipo -output ./compiled/fat/lib/libavformat.a  -create \
-arch armv6 ./compiled/armv6/lib/libavformat.a \
-arch armv7 ./compiled/armv7/lib/libavformat.a \
-arch i386 ./compiled/i386/lib/libavformat.a

lipo -output ./compiled/fat/lib/libavutil.a  -create \
-arch armv6 ./compiled/armv6/lib/libavutil.a \
-arch armv7 ./compiled/armv7/lib/libavutil.a \
-arch i386 ./compiled/i386/lib/libavutil.a

lipo -output ./compiled/fat/lib/libpostproc.a  -create \
-arch armv6 ./compiled/armv6/lib/libpostproc.a \
-arch armv7 ./compiled/armv7/lib/libpostproc.a \
-arch i386 ./compiled/i386/lib/libpostproc.a

lipo -output ./compiled/fat/lib/libswscale.a  -create \
-arch armv6 ./compiled/armv6/lib/libswscale.a \
-arch armv7 ./compiled/armv7/lib/libswscale.a \
-arch i386 ./compiled/i386/lib/libswscale.a

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/iPhoneOS6.0.sdk/usr/lib/system \
--target-os=darwin \
--arch=arm \
--cpu=cortex-a8 \
--extra-cflags='-arch armv7s' \
--extra-ldflags='-arch armv7s' \
--extra-cflags='-mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad' \
--prefix=compiled/armv7s \
--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 armv7s
make clean
make && make install

# configure for i386 build
./configure \
--cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' \
--sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/lib/system \
--target-os=darwin \
--arch=i386 \
--cpu=i386 \
--extra-cflags='-arch i386' \
--extra-ldflags='-arch i386' \
--prefix=compiled/i386 \
--enable-cross-compile \
--disable-mmx \
--disable-armv5te \
--disable-armv6 \
--disable-armv6t2 \
--disable-armvfp \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc

# build for i386
make clean
make && make install

# make fat (universal) libs
mkdir -p ./compiled/fat/lib

lipo -output ./compiled/fat/lib/libavcodec.a  -create \
./compiled/armv7s/lib/libavcodec.a \
./compiled/armv7/lib/libavcodec.a \
./compiled/i386/lib/libavcodec.a

lipo -output ./compiled/fat/lib/libavdevice.a  -create \
./compiled/armv7s/lib/libavdevice.a \
./compiled/armv7/lib/libavdevice.a \
./compiled/i386/lib/libavdevice.a

lipo -output ./compiled/fat/lib/libavfilter.a  -create \
./compiled/armv7s/lib/libavfilter.a \
./compiled/armv7/lib/libavfilter.a \
./compiled/i386/lib/libavfilter.a

lipo -output ./compiled/fat/lib/libavformat.a  -create \
./compiled/armv7s/lib/libavformat.a \
./compiled/armv7/lib/libavformat.a \
./compiled/i386/lib/libavformat.a

lipo -output ./compiled/fat/lib/libavutil.a  -create \
./compiled/armv7s/lib/libavutil.a \
./compiled/armv7/lib/libavutil.a \
./compiled/i386/lib/libavutil.a

lipo -output ./compiled/fat/lib/libswresample.a  -create \
./compiled/armv7s/lib/libswresample.a \
./compiled/armv7/lib/libswresample.a \
./compiled/i386/lib/libswresample.a

lipo -output ./compiled/fat/lib/libswscale.a  -create \
./compiled/armv7s/lib/libswscale.a \
./compiled/armv7/lib/libswscale.a \
./compiled/i386/lib/libswscale.a

Original Post

This will build ffmpeg static libraries for armv6, armv7, and i386 architectures and combine them into fat (universal) files for iOS 4.3 (iPhoneOS4.3 and iPhoneSimulator4.3):

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/iPhoneOS4.3.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/system \
--target-os=darwin \
--arch=arm \
--cpu=cortex-a8 \
--extra-cflags='-arch armv7' \
--extra-ldflags='-arch armv7' \
--prefix=compiled/armv7 \
--enable-pic \
--enable-cross-compile \
--disable-armv5te \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc

# build for armv7
make clean
make && make install

# configure for armv6 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/iPhoneOS4.3.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/lib/system \
--target-os=darwin \
--arch=arm \
--cpu=arm1176jzf-s \
--extra-cflags='-arch armv6' \
--extra-ldflags='-arch armv6' \
--prefix=compiled/armv6 \
--enable-cross-compile \
--disable-armv5te \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc

# build for armv6
make clean
make && make install

# configure for i386 build
./configure \
--cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' \
--sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk \
--extra-ldflags=-L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib/system \
--target-os=darwin \
--arch=i386 \
--cpu=i386 \
--extra-cflags='-arch i386' \
--extra-ldflags='-arch i386' \
--prefix=compiled/i386 \
--enable-cross-compile \
--disable-armv5te \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-doc

# build for i386
make clean
make && make install

# make fat (universal) libs
mkdir -p ./compiled/fat/lib

lipo -output ./compiled/fat/lib/libavcodec.a  -create \
-arch armv6 ./compiled/armv6/lib/libavcodec.a \
-arch armv7 ./compiled/armv7/lib/libavcodec.a \
-arch i386 ./compiled/i386/lib/libavcodec.a

lipo -output ./compiled/fat/lib/libavdevice.a  -create \
-arch armv6 ./compiled/armv6/lib/libavdevice.a \
-arch armv7 ./compiled/armv7/lib/libavdevice.a \
-arch i386 ./compiled/i386/lib/libavdevice.a

lipo -output ./compiled/fat/lib/libavfilter.a  -create \
-arch armv6 ./compiled/armv6/lib/libavfilter.a \
-arch armv7 ./compiled/armv7/lib/libavfilter.a \
-arch i386 ./compiled/i386/lib/libavfilter.a

lipo -output ./compiled/fat/lib/libavformat.a  -create \
-arch armv6 ./compiled/armv6/lib/libavformat.a \
-arch armv7 ./compiled/armv7/lib/libavformat.a \
-arch i386 ./compiled/i386/lib/libavformat.a

lipo -output ./compiled/fat/lib/libavutil.a  -create \
-arch armv6 ./compiled/armv6/lib/libavutil.a \
-arch armv7 ./compiled/armv7/lib/libavutil.a \
-arch i386 ./compiled/i386/lib/libavutil.a

lipo -output ./compiled/fat/lib/libpostproc.a  -create \
-arch armv6 ./compiled/armv6/lib/libpostproc.a \
-arch armv7 ./compiled/armv7/lib/libpostproc.a \
-arch i386 ./compiled/i386/lib/libpostproc.a

lipo -output ./compiled/fat/lib/libswscale.a  -create \
-arch armv6 ./compiled/armv6/lib/libswscale.a \
-arch armv7 ./compiled/armv7/lib/libswscale.a \
-arch i386 ./compiled/i386/lib/libswscale.a
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文