[Ffmpeg-devel] [PATCH] Fixes for Darwin/x86
Dan Villiom Podlaski Christiansen
danchr
Fri Feb 17 13:36:30 CET 2006
On 08/02/2006, at 13.01, Michael Niedermayer wrote:
>> +if test "$targetos" = "Darwin"; then
>> + if "$cpu" = "x86"; then
>> + SHCFLAGS="$CFLAGS -DPIC"
>> + else
>> + SHCFLAGS="$CFLAGS"
>> + fi
>> + if test "$needmdynamicnopic" = yes; then
>> + CFLAGS="$CFLAGS -mdynamic-no-pic"
>> + elif "$cpu" = "x86"; then
>> + CFLAGS="$CFLAGS -DPIC"
>> + fi
>
> what does -mdynamic-no-pic do? the no-pic in the name suggests to
> me that no
> PIC code is generated, if so -DPIC is wrong, but this mess will set
> SHCFLAGS="$CFLAGS -DPIC" CFLAGS="$CFLAGS -mdynamic-no-pic" in some
> cases
By default, GCC will generate position-indenpendant code on Darwin,
and -mdynamic-no-pic is one of the options that disables PIC. I've
updated the patch to include the simplest possible logic for this:
Either pass -DPIC or -mdynamic-no-pic to the compiler. I've also
expanded the comment to explain this.
>> Also, the ASMALIGN() macros where moved into a defined(ARCH_X86) ||
>> defined(ARCH_X86_64) conditional, to ensure that they weren't defined
>> when not needed.
>
> rejected, i already said they are not x86 specific
I had a bit of trouble understanding how asm code could be cross-
platform, but that's because they're macros. I've changed the patch
to use the same approach as Sam Hocevar did in his submission: Change
all occurrances to the less explicit, but equally valid .p2align macro.
Also included is a change in mpegvideo_mmx.c which was in Sam
Hocevar's patch, and not mine.
I hope this is acceptable :)
--
- Dan Villiom Podlaski Christiansen
More information about the ffmpeg-devel
mailing list