[FFmpeg-devel] [PATCH] Workaround Mac-OS x86_64 dynamic loader bug for Yasm generated code

Art Clarke aclarke
Wed Feb 4 21:27:05 CET 2009

See this chain for details on the problem:

The following patch takes a very conservative workaround approach.
For the code that is generated the build errors on Mac OS-X x86_64, we
move the lookup tables into the .rodata segment.  We then make sure
that only that code is put in .rodata by making sure all following
code is put back in the .text section.  Finally this change is only
applied if we're generating macho64 object files, or in other words
Mac-OS X x86_64.

Tested on Mac and Linux in 32 and 64 bit builds and everything seems to work.

- Art

xu?ggle (z?' gl) v. To freely encode, decode, and experience audio and video.

Use Xuggle to get the power of FFMPEG in Java.
-------------- next part --------------
Index: libavcodec/x86/fft_mmx.asm
--- libavcodec/x86/fft_mmx.asm	(revision 16989)
+++ libavcodec/x86/fft_mmx.asm	(working copy)
@@ -446,8 +446,16 @@
 %undef n
+%ifidn __OUTPUT_FORMAT__,macho64
+; Putting this section in .text on x86_64 darwin causes problems
+section .rodata align=16
 align 8
 dispatch_tab%3%2: pointer list_of_fft
+%ifidn __OUTPUT_FORMAT__,macho64
+; Set section back to .text
+section .text align=16
 ; On x86_32, this function does the register saving and restoring for all of fft.
 ; The others pass args in registers and don't spill anything.

More information about the ffmpeg-devel mailing list