From 17bafc411c35206b2f83abb1e76b159b74a81c3f Mon Sep 17 00:00:00 2001 From: jkeil Date: Mon, 9 Sep 2002 19:01:34 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7336 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/configure b/configure index ce2e29abe6..9b62de9a84 100755 --- a/configure +++ b/configure @@ -884,24 +884,35 @@ EOF 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