[MPlayer-dev-eng] [PATCH] configure and altivec

Magnus Damm damm at opensource.se
Mon Aug 25 14:48:20 CEST 2003


Hi,

Yesterday I used crosstool to setup an extra compiler on my powerpc box.
The compiled toolchain is based on binutils-2.11.2, gcc-2.95.3, glibc-2.2.2.
All hosted on a powerpc box running Gentoo Linux.

Then today I tried to use the new toolchain to compile mplayer (CVS main).
Sadly, the configure script doesn't check if CC supports Altivec,
so I end up with the flags "-maltivec -mabi=altivec" passed to my gcc-2.95.3
and that results in errors because Altivec is not supported under this
compiler.

The attached patch is a remedy for the following problems:

*  CC is not checked for Altivec support (see above).
   The patch adds checks for FSF-style flags and Darwin-style flags.
   The check is performed regardless of the gcc version.

*  Disabling of Altivec. 
   --disable-altivec is broken today if /proc/cpuinfo shows that your cpu 
   supports altivec. The patch takes care of that.

*  "GCC & CPU optimization abilities" always show that it is optimizing
   for the cpu configure is running on, it should show the optimization that
   is enabled for gcc instead. Cosmetic change only, but confusing as it is 
   today IMHO.

*  Runtime CPU-detection now enables altivec for powerpc.

Now with the patch it should be possible to use --enable-altivec, 
--disable-altivec, --enable-runtime-cpudetection regardless of powerpc cpu type.

The configure script handles altivec support in the following order:

1. Altivec is enabled by default if your cpu supports it. 
2. --enable-runtime-cpudetection will enable altivec support.
3. If you have forced altivec on/off with --enable-altivec/--disable-altivec, then
   your selection will override the previous altivec configuration.
4. If altivec is enabled but the compiler doesn't support it, altivec gets turned off.

Check the "Optimizing for"-output from configure to see if altivec is enabled.
   
I've tested the patched configure under Linux with gcc-2.95.3 (FSF), gcc-3.2.3 
(FSF, altivec bug-workaround). No Mac OS X / Darwin tests has been made.
Please test under Darwin. Comments are very welcome.

/ magnus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-cvs_main_20030825-configure-altivec.patch
Type: application/octet-stream
Size: 5125 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030825/9a74280f/attachment.obj>


More information about the MPlayer-dev-eng mailing list