changeset 7335:8db0cba91b6c

When we're compiling/running on a kernel without sse/sse2 support, we have to be careful when using gcc-3.x. gcc-3.x is able to emit sse/sse2 instructions for normal C code when we compile for maximum performance with something like the -march=athlon-xp switch. So, if the kernel does not support the sse/sse2 instruction set extension, we have to tell gcc-3.x to not emit see/sse2 instructions for regular C code, otherwise mplayer might crash with a SIGILL signal.
author jkeil
date Mon, 09 Sep 2002 19:01:34 +0000
parents d5bd28edf486
children b1346d1789ef
files configure
diffstat 1 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Mon Sep 09 16:18:47 2002 +0000
+++ b/configure	Mon Sep 09 19:01:34 2002 +0000
@@ -884,24 +884,35 @@
         echores "failed"
         echo "It seems that your kernel does not correctly support $2."
         echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
-        return 1
+	return 1
       fi
     fi
-    return 1
+    return 0
   }
 
   extcheck $_mmx "mmx" "emms" || _mmx=no
   extcheck $_mmx2 "mmx2" "sfence" || _mmx2=no
   extcheck $_3dnow "3dnow" "femms" || _3dnow=no
   extcheck $_3dnowex "3dnowex" "pswapd %%mm0, %%mm0" || _3dnowex=no
-  extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _sse=no
-  extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _sse2=no
+  extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _sse=no _gcc3_ext="$_gcc3_ext -mno-sse"
+  extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _sse2=no _gcc3_ext="$_gcc3_ext -mno-sse2"
   echocheck "mtrr support"
   echores "$_mtrr"
 
   if test "$_mtrr" = yes ; then
     _optimizing="$_optimizing mtrr"
   fi
+
+  if test "$_gcc3_ext" != ""; then
+    # if we had to disable sse/sse2 because the active kernel does not
+    # support this instruction set extension, we also have to tell
+    # gcc3 to not generate sse/sse2 instructions for normal C code
+    cat > $TMPC << EOF
+int main(void) { return 0; }
+EOF
+    cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
+  fi
+
 fi