When disabling SSE, make sure -fpmath is not set to use SSE either

Message ID 1452047392-14393-1-git-send-email-raj.khem@gmail.com
State New, archived

Commit Message

Khem Raj Jan. 6, 2016, 2:29 a.m. UTC
  This fixes errors when we inject sse options through CFLAGS and now
that we have -Werror turned on by default this warning turns to become
error on x86

gcc -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -x c /dev/null -S
-mno-sse -mno-mmx

generates warning
/dev/null:1:0: warning: SSE instruction set disabled, using 387

where as

gcc -m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -x c /dev/null -S
-mno-sse -mno-mmx -mfpmath=387

Generates no warnings

Signed-off-by: Khem Raj <raj.khem@gmail.com>
 ChangeLog             | 5 +++++
 sysdeps/i386/Makefile | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)


Joseph Myers Jan. 6, 2016, 5:05 p.m. UTC | #1
If this fixes bug 17950, you need to include

	[BZ #17950]

in your ChangeLog entry, mention the bug number in your commit message and 
close that bug as fixed with the milestone set appropriately once the fix 
is in.

(This is not a review or approval of the patch.)


diff --git a/ChangeLog b/ChangeLog
index 2ad1b5a..bbb7199 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@ 
+2016-01-05  Khem Raj  <raj.khem@gmail.com>
+	* sysdeps/i386/Makefile [$(subdir) == elf] (CFLAGS-.os):
+	Add -mfpmath=387.
 2016-01-05  Joseph Myers  <joseph@codesourcery.com>
 	* manual/texinfo.tex: Update to version 2016-01-04.21 with
diff --git a/sysdeps/i386/Makefile b/sysdeps/i386/Makefile
index 168512f..70153b3 100644
--- a/sysdeps/i386/Makefile
+++ b/sysdeps/i386/Makefile
@@ -89,7 +89,7 @@  ifeq ($(subdir),elf)
 # the first 3 mm/xmm/ymm/zmm registers are used to pass vector parameters
 # which must be preserved.
 CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
-		   -mno-sse -mno-mmx)
+		   -mno-sse -mno-mmx -mfpmath=387)
 tests-special += $(objpfx)tst-ld-sse-use.out
 $(objpfx)tst-ld-sse-use.out: ../sysdeps/i386/tst-ld-sse-use.sh $(objpfx)ld.so