[MPlayer-dev-eng] [PATCH] fix compilation on Darwin

Guillaume POIRIER poirierg at gmail.com
Sun Apr 12 18:48:01 CEST 2009


Hi,

On Sun, Apr 12, 2009 at 5:47 PM, Diego Biurrun <diego at biurrun.de> wrote:
> On Sun, Apr 12, 2009 at 04:43:32PM +0100, vmrsss wrote:
>> On 12 Apr 2009, at 09:44, Guillaume POIRIER wrote:
>> >Well, that doesn't fix the problem entirely, since it'll still lack a
>> >few other flags that optimize compilation, such as -march=...
>>
>> well, configure rightly identify the processor as core2, but you're
>> right it does not seem to add the -march=core2 flag anymore.
>
> What flag changed exactly and with which revision of configure?

I'm not passing any flag to configure, just running a plain "./configure"

The problem is that $CFLAGS is set too soon on Darwin, at:
 if darwin; then
  CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -shared-libgcc"
  _timer=timer-darwin.c
fi

Then later on configure, CFLAGS is checked to ensure that it's not set:

elif test -z "$CFLAGS" ; then
  if test "$cc_vendor" = "intel" ; then
    CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
  elif test "$cc_vendor" != "gnu" ; then
    CFLAGS="-O2 $_march $_mcpu $_pipe"
  else
    CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mc
pu $_pipe -ffast-math -fomit-frame-pointer"
    extra_ldflags="$extra_ldflags -ffast-math"
  fi
else
  _warn_CFLAGS=yes
fi


In the end, not only does this trigger this warning after configure completes:
MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
but:

    *** ***  DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK!  *** ***


Also, the compile lacks compilation options -O4 and
-fomit-frame-pointer, which are required to compile most of the
assembly code...

I'm experiencing this on Leoard, on MacIntel. PPC compilation does
work, but it's not surprising since it doesn't compile these assembly
code, and has twice to four times more registers to play with anyway.

On PPC, the compilation of ppc/h264_altivec.c looks as follows:
gcc-4.2 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-I.. -I.. -Wundef -Wdisabled-optimization -Wno-pointer-sign
-Wdeclaration-after-statement -std=gnu99  -mdynamic-no-pic
-falign-loops=16 -shared-libgcc -maltivec -mabi=altivec
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I.
-I/usr/X11/include -Ilibdvdread4 -I/usr/X11/include/freetype2
-I/usr/X11/include   -c -o ppc/h264_altivec.o ppc/h264_altivec.c

Note that it lacks at least -O4 and -fomit-frame-pointer.

Does that help?

Guillaume
-- 
Only a very small fraction of our DNA does anything; the rest is all
comments and ifdefs.

Norman Mailer  - &quot;Writing books is the closest men ever come to
childbearing.&quot; -
http://www.brainyquote.com/quotes/authors/n/norman_mailer.html



More information about the MPlayer-dev-eng mailing list