Skip to contentSkip to conversation

x86: set fpmath to 387 to avoid gcc warnings

PATCH In review Dragos Tatulea 1 participant 2 messages Aug 8, 2012 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: set fpmath to 387 to avoid gcc warnings

If gcc has a different default fpmath set (ex: sse), many unuseful warnings will be spewed.

This can affect out of tree modules that compile with -Werror (ex: systemtap stp scripts).

Be paranoid and add -msoft-float as well to try to get an error if FP instructions are generated at all.

Change-Id If9271d7aea7371f394ede0bc5e3ed1383cdb0e1a
---
 arch/x86/Makefile |    1 +
 1 file changed, 1 insertion(+)
arch/x86/Makefile +1 -0
index b1c611e..b771d0b 100644
@@ -130,6 +130,7 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
 # prevent gcc from generating any FP code by mistake
 KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
 KBUILD_CFLAGS += $(call cc-option,-mno-avx,)
+KBUILD_CFLAGS += $(call cc-option,-mfpmath=387 -msoft-float,)
 
 KBUILD_CFLAGS += $(mflags-y)
 KBUILD_AFLAGS += $(mflags-y)
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 10 lines · Dragos Tatulea

If gcc has a different default fpmath set (ex: sse), many unuseful warnings will be spewed.

This can affect out of tree modules that compile with -Werror (ex: systemtap stp scripts).

Be paranoid and add -msoft-float as well to try to get an error if FP instructions are generated at all.

Change-Id: If9271d7aea7371f394ede0bc5e3ed1383cdb0e1a

Ooops, leaked some trash. Patch re-sent.

Thanks,
Dragos