[Libav-user] Unable to compile i386 compatible ffmpeg dylibs on Mac OS X

Simon Daniels simondaniels23 at gmail.com
Wed Nov 23 18:26:41 CET 2011


Thanks guys but omitting -fomit-frame-pointer in the last gcc call or
replacing it with -fno-omit-frame-pointer resulted in the same error
(trying both gcc and clang).

Here's my output of gcc -v:
Using built-in specs.
Target: i686-apple-darwin11
Configured with:
/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/src/configure
--disable-checking --enable-werror
--prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm-
--program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--with-slibdir=/usr/lib --build=i686-apple-darwin11
--enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~1/dst-llvmCore/Developer/usr/local
--program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11
--target=i686-apple-darwin11
--with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)


clang reports the same error but it provides more verbose output:

CC	libavcodec/h264_cabac.o
fatal error: error in backend: Ran out of registers during register allocation!
Cannot allocate: %vreg6948,inf = [162608u,162612d:0)  0 at 162608u
Please check your inline asm statement for invalid constraints:
INLINEASM <es:movl ${6:a}($5), $2
	movl ${7:a}($5), $1
	movzbl ($4)    , $0
	mov    $2     , $3
	and    $$0xC0       , $2
	movzbl _ff_h264_lps_range($0, $2, 2), $2
	sub    $2     , $3
	mov    $3       , %ecx
	shl    $$17         , $3
	sub    $1       , $3
	sar    $$31         , $3
	sub    %ecx       , $2
	and    $3       , $2
	add    %ecx       , $2
	shl    $$17         , %ecx
	and    $3       , %ecx
	sub    %ecx       , $1
	xor    $3       , $0
	movzbl _ff_h264_norm_shift($2), %ecx
	shl    %cl        , $2
	movzbl _ff_h264_mlps_state+128($0), $3
	mov    ${3:b}   , ($4)
	shl    %cl        , $1
	test   ${1:w}   , ${1:w}
	 jnz   1f
	mov ${8:a}($5), %ecx
	movzwl (%ecx)     , $3
	bswap  $3
	shr    $$15         , $3
	sub    $$0xFFFF     , $3
	add    $$2          , %ecx
	mov    %ecx   , ${8:a}($5)
	lea    -1($1)   , %ecx
	xor    $1       , %ecx
	shr    $$15         , %ecx
	movzbl _ff_h264_norm_shift(%ecx), %ecx
	neg    %ecx
	add    $$7          , %ecx
	shl    %cl        , $3
	add    $3       , $1
	1:
	movl $2, ${6:a}($5)
	movl $1, ${7:a}($5)
	> [sideeffect], $0:[regdef-ec], %vreg6948<earlyclobber,def>,
$1:[regdef-ec], %vreg3438<earlyclobber,def,dead>, $2:[regdef-ec],
%vreg3439<earlyclobber,def,dead>, $3:[regdef-ec],
%vreg3440<earlyclobber,def,dead>, $4:[reguse], %vreg3441<kill>,
$5:[reguse], %vreg6882<kill>, $6:[imm], 4, $7:[imm], 0, $8:[imm], 16,
$9:[clobber], %ECX<earlyclobber,imp-def,dead>, $10:[clobber],
%EFLAGS<earlyclobber,imp-def,dead>, <<badref>>;
GR32_ABCD:%vreg6948,%vreg3440
GR32:%vreg3438,%vreg3439,%vreg3441,%vreg6882
dbg:libavcodec/x86/cabac.h:93:5 @[ libavcodec/cabac.h:340:5 @[
libavcodec/h264_cabac.c:1726:13 @[ libavcodec/h264_cabac.c:1737:5 @[
libavcodec/h264_cabac.c:1762:5 @[ libavcodec/h264_cabac.c:2322:21 ] ]
] ] ]

make: *** [libavcodec/h264_cabac.o] Error 1


make V=1 of clang is:
clang -m32 -I. -I"/Users/user/Downloads/ffmpeg-0.8.7" -D_ISOC99_SOURCE
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -DHAVE_AV_CONFIG_H
-std=c99 -mdynamic-no-pic -fomit-frame-pointer -fPIC -g
-Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch
-Wdisabled-optimization -Wpointer-arith -Wredundant-decls
-Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef
-Wmissing-prototypes -Wno-pointer-to-int-cast -O3 -fno-math-errno
-fno-signed-zeros -mllvm -stack-alignment=16 -Qunused-arguments  -MMD
-c -o libavcodec/h264_cabac.o libavcodec/h264_cabac.c



At this point I'm just wiling to pay someone who can compile this for me ;-)


On Wed, Nov 23, 2011 at 2:13 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> Simon Daniels <simondaniels23 at ...> writes:
>
>> gcc -m32 -I. -I"/Users/user/Downloads/ffmpeg-0.8.7" -D_ISOC99_SOURCE
>> -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DHAVE_AV_CONFIG_H -std=c99
>> -mdynamic-no-pic -fomit-frame-pointer -g -Wdeclaration-after-statement
>> -Wall -Wno-parentheses -Wno-switch -Wdisabled-optimization
>> -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual
>> -Wwrite-strings -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast
>> -O3 -fno-math-errno -mllvm -stack-alignment=16  -MMD -MF
>> libavcodec/h264_cabac.d -MT libavcodec/h264_cabac.o -c -o
>> libavcodec/h264_cabac.o libavcodec/h264_cabac.c
>> cc1: error in backend: Ran out of registers during register allocation!
>> make: *** [libavcodec/h264_cabac.o] Error 1
>
> Afaict, this is a compiler error;-(
>
> Could you add the output of gcc-v?
> Does it make any difference if you use "./configure --cc='clang -m32'"?
>
> If you just want to compile FFmpeg, I suggest you copy above command (from gcc
> to cabac.c), paste it and remove -fomit-frame-pointer (or replace it with
> -fno-omit-frame-pointer). The compilation of h264_cabac.o should succeed and you
> can run "make" to compile the rest of the project.
>
> Carl Eugen
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>


More information about the Libav-user mailing list