[Ffmpeg-devel] [RFC] Support building universal binaries of FFmpeg on Darwin

Dan Villiom Podlaski Christiansen danchr
Wed Jun 22 18:49:12 CEST 2005


Hi,

Attached below is an initial patch to allow building a universal, or 
fat, binary of FFmpeg on Darwin 8.0 and later using GCC 4.0. The 
generated binary will contain 4 architectures: G3, G4, G5 and x86. 
Having the three PowerPC architectures allows GCC to tune for the 
specified CPU, and possibly vectorize code.

The configure script needed a lot of hackery to defer detection of e.g. 
AltiVec to compile-time. Source code changes mainly involve ensuring 
that files in libavcodec/ppc and libavcodec/i386 compile with both PPC 
and x86 compilers. A few cases where CONFIG_DARWIN was incorrectly 
assumed to mean Motorola AltiVec syntax was also fixed.

However, I ran into a major issue: The Darwin assembler is an old 
version of GNU as, and it does not support the i386 syntax used in 
FFmpeg. I believe the issues boil down to:

- The asm macro syntax used in Darwin[1] is different from the currently 
used syntax. It appears to not support named arguments and use 
".endmacro" instead of ".endm". Perhaps using C macros would be better? 
(In i386/fdct_mmx.c)
- The .balign pseudo-op doesn't exist. The best substitute I could find 
was .align[2]. (In i386/dsputil_mmx.c)
- I get a lot of errors about "Junk character 47 (/)". I don't know what 
that means :/ (In i386/simple_idct_mmx.c)

I don't know x86 assembly, so I have no idea how to fix this. I was 
hoping someone else might be able to help. All other files compile fine.

- Dan Christiansen

P.S. Please Cc any replies directly to me, as I'm not subscribed to 
either of these lists. Alex Beregszaszi said on IRC that this might be 
of interest to MPlayer developers as well, so this mail is Cc'ed there.

[1] 
<http://developer.apple.com/documentation/DeveloperTools/Reference/Assembler/ASMDirectives/chapter_5_section_3.html#//apple_ref/doc/uid/TP30000851-//apple_ref/doc/uid/TP30000823-TPXREF146>
[2] 
<http://developer.apple.com/documentation/DeveloperTools/Reference/Assembler/ASMDirectives/chapter_5_section_7.html#//apple_ref/doc/uid/TP30000851-//apple_ref/doc/uid/TP30000823-TPXREF174>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ffmpeg-fat.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20050622/c61f88d4/attachment.txt>



More information about the ffmpeg-devel mailing list