[FFmpeg-devel] Build problem (on Os X)

Diego Biurrun diego
Wed Feb 11 17:14:22 CET 2009


On Wed, Feb 04, 2009 at 12:08:23PM -0800, David DeHaven wrote:
>
> On Feb 4, 2009, at 11:34 AM, David Conrad wrote:
>> On Feb 4, 2009, at 2:04 PM, Art Clarke wrote:
>>> On Wed, Feb 4, 2009 at 10:47 AM, David DeHaven <dave at sagetv.com> wrote:
>>>> Putting dispatch_tabxxx in .rodata seems to skirt the issue, but
>>>> generates heaps of warnings on 32 bit. No idea if that works on 64
>>>> bit as I don't have access to a 64 bit machine at the moment. Maybe
>>>> make the added section .rodata/.text lines conditional with "%ifidn
>>>> __OUTPUT_FORMAT__,macho64", that avoids the warnings and allows the
>>>> system to cache the dylib code on 32 bit. Someone with more x86
>>>> assembly experience could probably find a better solution... I'm
>>>> just kinda hacking in the dark here. I was able to build 64 bit
>>>> dylibs though.
>>>
>>> yeah; me too.
>>
>> <fft-rodata.diff>
>
> +SECTION .rodata align=16
>
> The section uses the previous alignment argument, yasm spits a warning  
> out for me.
>
> I also made the following change to x86inc.asm, but it assumes yasm  
> isn't broken. Ideally configure needs to be modified to check if yasm  
> aligns sections properly or not, but I haven't figured out a clean way  
> of doing that while allowing cross-compilation except by adding a tool  
> that parses the mach-o object file (ugh-ly!).
>
> I suppose if someone is cross-compiling for Mac OS X, they should have  
> otool or an appropriate objdump available...
>
> --- libavcodec/x86/x86inc.asm	(revision 16966)
> +++ libavcodec/x86/x86inc.asm	(working copy)
> @@ -29,14 +29,10 @@
>  ; Kludge: Something on OS X fails to align .rodata even given an align attribute,
>  ; so use a different read-only section.
>  %macro SECTION_RODATA 0
> -    %ifidn __OUTPUT_FORMAT__,macho64
> -        SECTION .text align=16
> -    %elifidn __OUTPUT_FORMAT__,macho
> -        SECTION .text align=16
> +    %ifidn __OUTPUT_FORMAT__,macho
>          fakegot:
> -    %else
> -        SECTION .rodata align=16
>      %endif
> +    SECTION .rodata align=16
>  %endmacro

What about this?

Diego




More information about the ffmpeg-devel mailing list