public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BK/PATCH] better i386 compiler flags
@ 2003-01-11  1:26 Jeff Garzik
  2003-01-12  0:06 ` Dave Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2003-01-11  1:26 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: arjanv, Alan Cox, linux-kernel

[this kills scads of warnings with CONFIG_MCYRIXIII and gcc 3.2,
 also starts using -march=pentium3/4/athlon when available.  I've been
 doing that for a while now without problems.]



Marcelo, please do a

	bk pull bk://kernel.bkbits.net/jgarzik/misc-2.4

This will update the following files:

 arch/i386/Makefile |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

through these ChangeSets:

<jgarzik@redhat.com> (03/01/10 1.994)
   arch/i386/Makefile: improved support for gcc 3.2 compiler flags
   
   * Adds useful 'check_gcc' makefile function
   * stop using the deprecated -malign* arguments when -falign* is available
   * call -march={pentium3,pentium4,k6,athlon,c3,winchip*} when available





--- 1.4/arch/i386/Makefile	Mon Sep 30 12:45:01 2002
+++ edited/arch/i386/Makefile	Fri Jan 10 19:49:03 2003
@@ -23,8 +23,10 @@
 
 CFLAGS += -pipe
 
+check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
+
 # prevent gcc from keeping the stack 16 byte aligned
-CFLAGS += $(shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; fi)
+CFLAGS += $(call check_gcc,-mpreferred-stack-boundary=2,)
 
 ifdef CONFIG_M386
 CFLAGS += -march=i386
@@ -51,19 +53,19 @@
 endif
 
 ifdef CONFIG_MPENTIUMIII
-CFLAGS += -march=i686
+CFLAGS += $(call check_gcc,-march=pentium3,-march=i686)
 endif
 
 ifdef CONFIG_MPENTIUM4
-CFLAGS += -march=i686
+CFLAGS += $(call check_gcc,-march=pentium4,-march=i686)
 endif
 
 ifdef CONFIG_MK6
-CFLAGS += $(shell if $(CC) -march=k6 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6"; else echo "-march=i586"; fi)
+CFLAGS += $(call check_gcc,-march=k6,-march=i586)
 endif
 
 ifdef CONFIG_MK7
-CFLAGS += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon"; else echo "-march=i686 -malign-functions=4"; fi) 
+CFLAGS += $(call check_gcc,-march=athlon,-march=i686 -malign-functions=4)
 endif
 
 ifdef CONFIG_MCRUSOE
@@ -71,11 +73,11 @@
 endif
 
 ifdef CONFIG_MWINCHIPC6
-CFLAGS += -march=i586
+CFLAGS += $(call check_gcc,-march=winchip-c6,-march=i586)
 endif
 
 ifdef CONFIG_MWINCHIP2
-CFLAGS += -march=i586
+CFLAGS += $(call check_gcc,-march=winchip2,-march=i586)
 endif
 
 ifdef CONFIG_MWINCHIP3D
@@ -83,7 +85,8 @@
 endif
 
 ifdef CONFIG_MCYRIXIII
-CFLAGS += -march=i486 -malign-functions=0 -malign-jumps=0 -malign-loops=0
+CFLAGS += $(call check_gcc,-march=c3,-march=i486)
+CFLAGS += $(call check_gcc,-falign-functions=0 -falign-jumps=0 -falign-loops=0,-malign-functions=0 -malign-jumps=0 -malign-loops=0)
 endif
 
 HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o

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

* Re: [BK/PATCH] better i386 compiler flags
  2003-01-11  1:26 [BK/PATCH] better i386 compiler flags Jeff Garzik
@ 2003-01-12  0:06 ` Dave Jones
  2003-01-12  7:29   ` Richard Henderson
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Jones @ 2003-01-12  0:06 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Marcelo Tosatti, arjanv, Alan Cox, linux-kernel

On Fri, Jan 10, 2003 at 08:26:46PM -0500, Jeff Garzik wrote:
 > [this kills scads of warnings with CONFIG_MCYRIXIII and gcc 3.2,
 >  also starts using -march=pentium3/4/athlon when available.  I've been
 >  doing that for a while now without problems.]

As a heads up, judging from gcc-patches, it seems that the gcc folks are
changing -march over to -mtune at some point soon. I can't fathom the
reasoning behind this other than causing a PITA for users.

		Dave

-- 
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs

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

* Re: [BK/PATCH] better i386 compiler flags
  2003-01-12  0:06 ` Dave Jones
@ 2003-01-12  7:29   ` Richard Henderson
  2003-01-12 14:52     ` Dave Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Henderson @ 2003-01-12  7:29 UTC (permalink / raw)
  To: Dave Jones, Jeff Garzik, Marcelo Tosatti, arjanv, Alan Cox,
	linux-kernel

On Sun, Jan 12, 2003 at 12:06:02AM +0000, Dave Jones wrote:
> As a heads up, judging from gcc-patches, it seems that the gcc folks are
> changing -march over to -mtune at some point soon. I can't fathom the
> reasoning behind this other than causing a PITA for users.

No, -mcpu -> -mtune.  Reason: mcpu means different things
to different targets, and it's confusing.


r~

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

* Re: [BK/PATCH] better i386 compiler flags
  2003-01-12  7:29   ` Richard Henderson
@ 2003-01-12 14:52     ` Dave Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Jones @ 2003-01-12 14:52 UTC (permalink / raw)
  To: Jeff Garzik, Marcelo Tosatti, arjanv, Alan Cox, linux-kernel

On Sat, Jan 11, 2003 at 11:29:39PM -0800, Richard Henderson wrote:
 > On Sun, Jan 12, 2003 at 12:06:02AM +0000, Dave Jones wrote:
 > > As a heads up, judging from gcc-patches, it seems that the gcc folks are
 > > changing -march over to -mtune at some point soon. I can't fathom the
 > > reasoning behind this other than causing a PITA for users.
 > No, -mcpu -> -mtune.  Reason: mcpu means different things
 > to different targets, and it's confusing.

Ah, right. It's still going to make the checkgcc macros in
arch/i386/Makefile get even more 'interesting' though 8-)

		Dave

-- 
| Dave Jones.        http://www.codemonkey.org.uk

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

end of thread, other threads:[~2003-01-12 14:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-11  1:26 [BK/PATCH] better i386 compiler flags Jeff Garzik
2003-01-12  0:06 ` Dave Jones
2003-01-12  7:29   ` Richard Henderson
2003-01-12 14:52     ` Dave Jones

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