Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to compile i386 compatible ffmpeg dylibs on Mac OS X

I'm running 64-bit Lion but I need to compile a 32-bit version of ffmpeg because another library I'm using is only available as 32-bit. I've tried a number of different configurations but they're all giving me errors. Here's what I've tried:

./configure --disable-static --enable-shared --disable-outdev=sdl --disable-bzlib --disable-libfreetype --disable-libopenjpeg --enable-zlib --enable-runtime-cpudetect --arch=i386 --extra-cflags="-arch i386" --extra-ldflags="-arch i386" --target-os=darwin --enable-cross-compile

./configure --disable-static --enable-shared --disable-outdev=sdl --disable-bzlib --disable-libfreetype --disable-libopenjpeg --enable-zlib --enable-runtime-cpudetect --arch=i386 --extra-cflags="-arch i386" --extra-ldflags="-arch i386"

./configure --disable-static --enable-shared --disable-outdev=sdl --disable-bzlib --disable-libfreetype --disable-libopenjpeg --enable-zlib --enable-runtime-cpudetect --arch=x86_32

I either get a "ran out of registers during register allocation" error during make or gcc complains that cross-compile is not active.

like image 743
simon.d Avatar asked Nov 22 '11 02:11

simon.d


2 Answers

I was able to get this working on ffmpeg build 08d2cee4 by using clang instead of gcc. So here was configure line that worked:

./configure --disable-static --enable-shared --disable-outdev=sdl --enable-runtime-cpudetect --disable-bzlib --disable-libfreetype --disable-libopenjpeg --enable-zlib --cc="clang -m32"

Thanks to Carl on libav-user!

Here was my thread in case it helps anyone: http://ffmpeg.org/pipermail/libav-user/2011-December/001013.html

like image 169
simon.d Avatar answered Nov 02 '22 14:11

simon.d


You might try using the -m32 flag which tells gcc to compile for 32-bit only.

like image 31
Jerry Avatar answered Nov 02 '22 14:11

Jerry