public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: set fpmath to 387 to avoid gcc warnings
@ 2012-08-06 11:36 dragos.tatulea
  2012-08-06 18:30 ` H. Peter Anvin
  0 siblings, 1 reply; 5+ messages in thread
From: dragos.tatulea @ 2012-08-06 11:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: hpa, Dragos Tatulea

From: Dragos Tatulea <dragos.tatulea@intel.com>

If gcc has a different default fpmath set (e.g. sse),
many unuseful warnings will be spewed when compiling on an
architecture that doesn't support it.

An example would be Google's Android 4.1 x86 toochain which
is compiled with -mfpmath=sse.

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

Signed-off-by: Dragos Tatulea <dragos.tatulea@intel.com>
---
 arch/x86/Makefile |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index b1c611e..f4fefb8 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -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,)
 
 KBUILD_CFLAGS += $(mflags-y)
 KBUILD_AFLAGS += $(mflags-y)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86: set fpmath to 387 to avoid gcc warnings
  2012-08-06 11:36 [PATCH] x86: set fpmath to 387 to avoid gcc warnings dragos.tatulea
@ 2012-08-06 18:30 ` H. Peter Anvin
  0 siblings, 0 replies; 5+ messages in thread
From: H. Peter Anvin @ 2012-08-06 18:30 UTC (permalink / raw)
  To: dragos.tatulea; +Cc: linux-kernel

On 08/06/2012 04:36 AM, dragos.tatulea@intel.com wrote:
> From: Dragos Tatulea <dragos.tatulea@intel.com>
> 
> If gcc has a different default fpmath set (e.g. sse),
> many unuseful warnings will be spewed when compiling on an
> architecture that doesn't support it.
> 
> An example would be Google's Android 4.1 x86 toochain which
> is compiled with -mfpmath=sse.
> 
> This can affect out of tree modules that compile with
> -Werror (ex: systemtap stp scripts).
> 
> Signed-off-by: Dragos Tatulea <dragos.tatulea@intel.com>
> ---
>  arch/x86/Makefile |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index b1c611e..f4fefb8 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -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,)
>  
>  KBUILD_CFLAGS += $(mflags-y)
>  KBUILD_AFLAGS += $(mflags-y)
> 

I guess we should do -msoft-float as well to try to get an error if FP
instructions are generated at all...

	-hpa

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] x86: set fpmath to 387 to avoid gcc warnings
@ 2012-08-08  6:27 Dragos Tatulea
  2012-08-08  6:27 ` Tatulea, Dragos
  0 siblings, 1 reply; 5+ messages in thread
From: Dragos Tatulea @ 2012-08-08  6:27 UTC (permalink / raw)
  To: hpa; +Cc: linux-kernel, 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
Signed-off-by: Dragos Tatulea <dragos.tatulea@intel.com>
---
 arch/x86/Makefile |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index b1c611e..b771d0b 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -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)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86: set fpmath to 387 to avoid gcc warnings
  2012-08-08  6:27 Dragos Tatulea
@ 2012-08-08  6:27 ` Tatulea, Dragos
  0 siblings, 0 replies; 5+ messages in thread
From: Tatulea, Dragos @ 2012-08-08  6:27 UTC (permalink / raw)
  To: hpa; +Cc: linux-kernel, Dragos Tatulea

On Wed, Aug 8, 2012 at 9:27 AM, Dragos Tatulea <dragos.tatulea@intel.com> wrote:
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] x86: set fpmath to 387 to avoid gcc warnings
@ 2012-08-08  6:27 Dragos Tatulea
  0 siblings, 0 replies; 5+ messages in thread
From: Dragos Tatulea @ 2012-08-08  6:27 UTC (permalink / raw)
  To: hpa; +Cc: linux-kernel, 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.

Signed-off-by: Dragos Tatulea <dragos.tatulea@intel.com>
---
 arch/x86/Makefile |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index b1c611e..b771d0b 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -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)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-08-08  6:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-06 11:36 [PATCH] x86: set fpmath to 387 to avoid gcc warnings dragos.tatulea
2012-08-06 18:30 ` H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2012-08-08  6:27 Dragos Tatulea
2012-08-08  6:27 ` Tatulea, Dragos
2012-08-08  6:27 Dragos Tatulea

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox