#2659(build system:new): Compiling for i386 on 64bit OSX is hard
#2659: Compiling for i386 on 64bit OSX is hard -------------------------------------+------------------------------------- Reporter: hendrik | Type: defect Status: new | Priority: normal Component: build | Version: git- system | master Keywords: i386 OSX | Blocked By: Darwin | Reproduced by developer: 0 Blocking: | Analyzed by developer: 0 | -------------------------------------+------------------------------------- Summary of the bug: When building on OS X 10.7.5 (64bit), it is hard to build a ''small'' or ''shared'' 32bit version. How to reproduce: Specifying `--arch=i386` has no effect, as `configure` differentiates between 32 and 64 bit by compiling some code. Forcing 32bit via `--cc="clang -m32"` works, but then the flag `--enable- small` leads to a compilation error: {{{ CC libavcodec/h264_cabac.o In file included from libavcodec/h264_cabac.c:43: libavcodec/x86/h264_i386.h:137:9: error: ran out of registers during register allocation "mov %1, %6 \n\t" }}} Since the failing code is assembler, specifying `--disable-asm` avoids the failure. What if we use gcc instead of clang? Well, that works partially. I.e. it does not work with shared libs enabled: `--enable-small --enable-shared --disable-static --arch=i386 --cc="gcc -m32"` again leads to {{{ CC libavcodec/h264_cabac.o cc1: error in backend: Ran out of registers during register allocation! make: *** [libavcodec/h264_cabac.o] Error 1 }}} $ gcc --version i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00) $ clang --version Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn) Target: x86_64-apple-darwin11.4.2 Thread model: posix -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2659> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2659: Compiling for i386 on 64bit OSX is hard -------------------------------------+------------------------------------- Reporter: hendrik | Owner: Type: defect | Status: new Priority: normal | Component: build Version: git-master | system Keywords: i386 OSX | Resolution: Darwin | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by hendrik): It looks like the issue has been discussed before in https://lists.ffmpeg.org/pipermail/ffmpeg-user/2012-June/006886.html - but, given that the discussion is old, the issue has not been fixed, yet. -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2659#comment:1> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2659: Compiling for i386 on 64bit OSX is hard -------------------------------------+------------------------------------- Reporter: hendrik | Owner: Type: defect | Status: new Priority: normal | Component: build Version: git-master | system Keywords: i386 OSX | Resolution: Darwin | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by cehoyos): Do I understand correctly that only building with {{{--enable-small}}} is "hard", {{{--enable-shared}}} (alone) works fine? -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2659#comment:2> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2659: Compiling for i386 on 64bit OSX is hard -------------------------------------+------------------------------------- Reporter: hendrik | Owner: Type: defect | Status: new Priority: normal | Component: build Version: git-master | system Keywords: i386 OSX | Resolution: Darwin | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by hendrik): Sorry for being unclear. The answer is: No. It depends on the used compiler. `./configure --enable-shared --disable-static --arch=i386 --cc="gcc -m32"` also leads to {{{ CC libavcodec/h264_cabac.o cc1: error in backend: Ran out of registers during register allocation! make: *** [libavcodec/h264_cabac.o] Error 1 }}} `./configure --enable-shared --disable-static --arch=i386 --cc="clang -m32"` works. But `./configure --enable-shared --disable-static --arch=i386 --cc="clang -m32" --enable-small` leads to {{{ CC libavcodec/h264_cabac.o In file included from libavcodec/h264_cabac.c:43: libavcodec/x86/h264_i386.h:137:9: error: ran out of registers during register allocation "mov %1, %6 \n\t" ^ }}} But in any case, whoever attempts to build ffmpeg for i386 on OSX has to know, that `--arch=i386` is ignored. AFAIK, this is not documented anywhere that's easily accessible. And probably it shouldn't be ignored to begin with. One apparently has to specify `--cc` somehow to get this to build for i386 at all. And when you do, some things still don't work. That's what makes it ''hard'', as in: it takes a few hours to achieve a working result. Thank you for looking into this. -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2659#comment:3> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2659: Compiling for i386 on 64bit OSX is hard -------------------------------------+------------------------------------- Reporter: hendrik | Owner: Type: defect | Status: new Priority: normal | Component: build Version: git-master | system Keywords: i386 OSX | Resolution: Darwin | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by michael): Is this still reproduceable ? (there was a change in the cabac asm code since then) if it still happens maybe another function has to be added under #if BROKEN_COMPILER -- Ticket URL: <https://trac.ffmpeg.org/ticket/2659#comment:4> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2659: Compiling for i386 on 64bit OSX is hard -------------------------------------+------------------------------------- Reporter: hendrik | Owner: Type: defect | Status: closed Priority: normal | Component: build Version: git-master | system Keywords: i386 OSX | Resolution: Blocking: | worksforme Analyzed by developer: 0 | Blocked By: | Reproduced by developer: 0 -------------------------------------+------------------------------------- Changes (by cehoyos): * keywords: i386 OSX Darwin => i386 OSX * status: new => closed * resolution: => worksforme Comment: I tested the following configure lines successfully: {{{ $ ./configure --enable-small --cc='cc -m32' $ ./configure --enable-shared --disable-static --cc='cc -m32' $ ./configure --enable-shared --disable-static --enable-small --cc='cc -m32' }}} The used compiler was: {{{ $ cc -v Apple LLVM version 5.0 (clang-500.2.75) (based on LLVM 3.3svn) Target: x86_64-apple-darwin12.5.0 Thread model: posix }}} -- Ticket URL: <https://trac.ffmpeg.org/ticket/2659#comment:5> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg