[Libav-user] Unable to compile i386 compatible ffmpeg dylibs on Mac OS X
Simon Daniels
simondaniels23 at gmail.com
Thu Nov 24 19:44:33 CET 2011
Hi Carl,
Apologies - I had tried without -fomit-frame-pointer and replacing it
with -fno-omit-frame-pointer but that wasn't what I pasted in the
email. I'll be more detailed this time.
Here's what I did this time. I'm sticking to ffmpeg-0.8.7 because I am
a distributor.
1. Ran ./configure --cc="gcc -m32" --disable-decoder=h264
2. Ran make. Resulted in:
CC libavcodec/h264_cabac.o
cc1: error in backend: Ran out of registers during register allocation!
make: *** [libavcodec/h264_cabac.o] Error 1
3. Ran make V=1. Resulted in:
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
4. Added -fno-omit-frame-pointer to end and ran 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 -fno-omit-frame-pointer
libavcodec/h264_cabac.c
Resulted in:
cc1: error in backend: Ran out of registers during register allocation!
5. Tried removing -fomit-frame-pointer from original command and ran
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 -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
Resulted in:
cc1: error in backend: Ran out of registers during register allocation!
6. Tried replacing -fomit-frame-pointer with -fno-omit-frame-pointer
and ran 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 -fno-omit-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
Resulted in:
cc1: error in backend: Ran out of registers during register allocation!
7. I'm repeating steps 1-6 now using clang. Ran ./configure
--cc="clang -m32" --disable-decoder=h264
8. Run make. Resulted in:
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
9. Ran make V=1. Resulted in:
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
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
10. Added -fno-omit-frame-pointer to end and ran 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 -fno-omit-frame-pointer
libavcodec/h264_cabac.c
Resulted in:
fatal error: error in backend: Ran out of registers during register allocation!
Cannot allocate: %vreg5942,inf = [162608u,162616d: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], %vreg5942<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], %vreg392, $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:%vreg5942,%vreg3440
GR32:%vreg3438,%vreg3439,%vreg3441,%vreg392
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 ] ]
] ] ]
11. Tried removing -fomit-frame-pointer from original command and ran
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 -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
Resulted in:
fatal error: error in backend: Ran out of registers during register allocation!
Cannot allocate: %vreg5942,inf = [162608u,162616d: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], %vreg5942<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], %vreg392, $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:%vreg5942,%vreg3440
GR32:%vreg3438,%vreg3439,%vreg3441,%vreg392
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 ] ]
] ] ]
12. Tried replacing -fomit-frame-pointer with -fno-omit-frame-pointer
and ran 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 -fno-omit-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
Resulted in:
fatal error: error in backend: Ran out of registers during register allocation!
Cannot allocate: %vreg5942,inf = [162608u,162616d: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], %vreg5942<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], %vreg392, $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:%vreg5942,%vreg3440
GR32:%vreg3438,%vreg3439,%vreg3441,%vreg392
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 ] ]
] ] ]
Hope that was thorough enough ;-). Looking forward to your other ideas. Thanks!
On Thu, Nov 24, 2011 at 2:19 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> Simon Daniels <simondaniels23 at ...> writes:
>
>> 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).
>
> [...]
>
>> 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
>
> This does not look as if you omitted -fomit-frame-pointer or replaced it with
> -fno-omit-frame-pointer ;-(
>
> Please:
> Configure with one of the mentioned configure lines (either gcc or clang, it is
> possible that one of them fails at another point in the compilation, to save
> time you can test this preliminary with configure --disable-decoder=h264)
>
> Run make (it fails)
>
> Run make V=1
>
> Copy everything from "gcc"/"clang" to "libavcodec/h264_cabac.c" and paste it
> into your shell. Add -fno-omit-frame-pointer to the end (this should be
> sufficient since iirc later compiling options overwrite earlier ones) / remove
> -fomit-frame-pointer from the pasted command (this may actually not work because
> I believe -O3 implies -fomit-frame-pointer) / replace -fomit-frame-pointer with
> -fno-omit-frame-pointer. Press enter. If the compilation does not succeed,
> report back, there are other things you can try.
>
> Run make.
>
> Carl Eugen
>
> PS: Please use current git head, the releases are only for distributors, and I
> suspect you are a user.
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
More information about the Libav-user
mailing list