Patchwork [V2] Ensure -fpmath != sse when SSE is disabled [BZ #17950]

login
register
mail settings
Submitter Khem Raj
Date Jan. 13, 2016, 1:48 a.m.
Message ID <1452649735-11069-1-git-send-email-raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/10356/
State New
Headers show

Comments

Khem Raj - Jan. 13, 2016, 1:48 a.m.
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
arithmetics

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
---
Changes since v1:

- Add BZ enry to ChangeLog and commit message

 ChangeLog             | 6 ++++++
 sysdeps/i386/Makefile | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
Roland McGrath - March 4, 2016, 7:04 p.m.
Looks OK but it would be better with a comment.
Roland McGrath - March 4, 2016, 10:35 p.m.
> On Mar 5, 2016 3:04 AM, "Roland McGrath" <roland@hack.frob.com> wrote:
> >
> > Looks OK but it would be better with a comment.
> 
> Comment in source file ? Should we summarise the commit message

Yes, a comment in the code explaining why the code is the way it is.

Patch

diff --git a/ChangeLog b/ChangeLog
index 600c3dd..a44f877 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@ 
+2016-01-12  Khem Raj  <raj.khem@gmail.com>
+
+	[BZ #17950]
+	* sysdeps/i386/Makefile [$(subdir) == elf] (CFLAGS-.os):
+	Add -mfpmath=387.
+
 2016-01-11  Andreas Schwab  <schwab@suse.de>
 
 	[BZ #19253]
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