[Ffmpeg-devel] [PATCH] Fixes for Darwin/x86

Michael Niedermayer michaelni
Fri Feb 17 15:28:59 CET 2006


Hi

On Fri, Feb 17, 2006 at 01:36:30PM +0100, Dan Villiom Podlaski Christiansen wrote:
> 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.

rejected .p2align & .balign are gas directives and gas supports a very large
number of platforms, not only x86

add a ASMALIGN or ASMALIGNXY macro which produces the correct GAS directive
in a string which can be put in a asm() block to make GAS align the code

this must not be under ANY #if* FOOBAR_PLATFORM

[...]
-- 
Michael





More information about the ffmpeg-devel mailing list