iPhone SDK 4.3 проблема с компиляцией libav

Я столкнулся со странной проблемой. Я установил iPhone SDK 4.3 и xCode 4 и теперь не могу скомпилировать libav из ffmpeg для архитектуры ARMv6. Это мой скрипт для его компиляции (он отлично работает для 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.

Может кто сталкивался с такой проблемой? Помоги мне, пожалуйста.

Спасибо.


person VictorT    schedule 01.04.2011    source источник
comment
Кто-нибудь сталкивался с проблемой компиляции ffmpeg под iOS SDK 4.3?   -  person VictorT    schedule 08.04.2011


Ответы (1)


Обновленное сообщение

Вот обновленный скрипт, который удаляет armv6, добавляет armv7, использует SDK iOS 6.0 и устраняет проблемы с изменениями в инструменте lipo. Убедитесь, что у вас установлена ​​последняя версия gas-preprocessor.pl из github в /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

Исходное сообщение

Это создаст статические библиотеки ffmpeg для архитектур armv6, armv7 и i386 и объединит их в толстые (универсальные) файлы для iOS 4.3 (iPhoneOS4.3 и 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
person Anton    schedule 20.05.2011
comment
Перед запуском скрипта вы также можете удалить inverse.c из ./libavcodec и удалить ссылку на inverse.o из ./libavcodec/makefile, поскольку inverse.o скомпилирован в libavutil и приведет к конфликту, если вы включите оба библиотеки в вашем проекте. - person Anton; 21.05.2011
comment
@Anton должен работать, просто: 1. клонируя репозиторий git с ffmpeg.org 2. создавая новый файл сборки build_new и вставляя приведенный выше код 3. запуская ./build_new, потому что у меня возникли некоторые проблемы. - person Robin Rye; 09.08.2011
comment
@ Антон Я не получаю файлы *.a в /build/armv6/ и /build/armv7/. только в i386 я получаю файлы, поэтому lipo не работает, и поэтому он не работает. - person Robin Rye; 09.08.2011
comment
@Robin, я только что обновил последнюю копию моего скрипта сборки. Попробуйте снова. - person Anton; 09.08.2011
comment
@Антон, это все то же самое: / не знаю, почему, так как я только что получил свежий клон из репозитория, вставил код и изменил chmod + x в файле. теперь я даже не получаю подпапки для других арок (только /fat/ и /i386/) в /compiled/. Я помещу вывод в файл и опубликую его, если вы хотите взглянуть. - person Robin Rye; 09.08.2011
comment
@ Антон, просто немного поразмышлял здесь, но действительно ли нужно очищать между разными make и make install? - person Robin Rye; 11.08.2011
comment
@RobinRye, это не больно. Мне нравится быть уверенным, что если что-то и выйдет из строя, то громко. - person Anton; 21.09.2011