public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arch/i386/Makefile,scripts/gcc-version.sh,Makefile small fixes
@ 2004-01-24 14:04 Serge Belyshev
  2004-01-24 18:17 ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Serge Belyshev @ 2004-01-24 14:04 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

[This patch is against 2.6.2-rc1-mm2]

arch/i386/Makefile:
*  omitted $(KBUILD_SRC)/ in script call.

scripts/gcc-version.sh:
*  GNU tail no longer supports 'tail -1' syntax.

Makefile: 
*  There is no point in adding -funit-at-a-time option because it is
   enabled by default at levels -Os, -O2 and -O3.

*  Consider adding -fweb option:

   vanilla:
   $ size vmlinux
      text    data     bss     dec     hex filename
   3056270  526780  386056 3969106  3c9052 vmlinux

   with -fweb:
   $ size vmlinux
      text    data     bss     dec     hex filename
   3049523  526780  386056 3962359  3c75f7 vmlinux

   Also note 0.1 ... 1.0% speedup in various benchmarks.
   This option is not enabled by default at -O2 because it
   (like -fomit-frame-pointer) makes debugging impossible.

diff -urN vanilla-2.6.2-rc1-mm2/arch/i386/Makefile hack/arch/i386/Makefile
--- vanilla-2.6.2-rc1-mm2/arch/i386/Makefile	Sat Jan 24 15:49:56 2004
+++ hack/arch/i386/Makefile	Sat Jan 24 15:32:13 2004
@@ -70,7 +70,7 @@
 
 # -mregparm=3 works ok on gcc-3.0 and later
 #
-GCC_VERSION			:= $(shell $(CONFIG_SHELL) scripts/gcc-version.sh $(CC))
+GCC_VERSION			:= $(shell $(CONFIG_SHELL) $(KBUILD_SRC)/scripts/gcc-version.sh $(CC))
 cflags-$(CONFIG_REGPARM) 	+= $(shell if [ $(GCC_VERSION) -ge 0300 ] ; then echo "-mregparm=3"; fi ;)
 
 CFLAGS += $(cflags-y)
diff -urN vanilla-2.6.2-rc1-mm2/scripts/gcc-version.sh hack/scripts/gcc-version.sh
--- vanilla-2.6.2-rc1-mm2/scripts/gcc-version.sh	Sat Jan 24 15:49:59 2004
+++ hack/scripts/gcc-version.sh	Sat Jan 24 15:28:02 2004
@@ -8,7 +8,7 @@
 
 compiler="$*"
 
-MAJOR=$(echo __GNUC__ | $compiler -E -xc - | tail -1)
-MINOR=$(echo __GNUC_MINOR__ | $compiler -E -xc - | tail -1)
+MAJOR=$(echo __GNUC__ | $compiler -E -xc - | tail -n 1)
+MINOR=$(echo __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1)
 printf "%02d%02d\\n" $MAJOR $MINOR
 
diff -urN vanilla-2.6.2-rc1-mm2/Makefile hack/Makefile
--- vanilla-2.6.2-rc1-mm2/Makefile	Sat Jan 24 15:49:59 2004
+++ hack/Makefile	Sat Jan 24 15:51:30 2004
@@ -435,15 +435,12 @@
 
 ifndef CONFIG_FRAME_POINTER
 CFLAGS		+= -fomit-frame-pointer
+CFLAGS		+= $(call check_gcc,-fweb,)
 endif
 
 ifdef CONFIG_DEBUG_INFO
 CFLAGS		+= -g
 endif
-
-# Enable unit-at-a-time mode when possible. It shrinks the
-# kernel considerably.
-CFLAGS += $(call check_gcc,-funit-at-a-time,)
 
 # warn about C99 declaration after statement
 CFLAGS += $(call check_gcc,-Wdeclaration-after-statement,)

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

* Re: [PATCH] arch/i386/Makefile,scripts/gcc-version.sh,Makefile small fixes
@ 2004-01-24 14:37 sam
  0 siblings, 0 replies; 6+ messages in thread
From: sam @ 2004-01-24 14:37 UTC (permalink / raw)
  To: Serge Belyshev; +Cc: linux-kernel, Andrew Morton

Date: 24 Jan 2004 17:04:54 +0300 skrev Serge Belyshev <33554432@mtu-net.ru> : 

>[This patch is against 2.6.2-rc1-mm2]
>
>arch/i386/Makefile:
>*  omitted $(KBUILD_SRC)/ in script call.

This should be $(srctree).

  Sam

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

* Re: [PATCH] arch/i386/Makefile,scripts/gcc-version.sh,Makefile small fixes
  2004-01-24 14:04 [PATCH] arch/i386/Makefile,scripts/gcc-version.sh,Makefile small fixes Serge Belyshev
@ 2004-01-24 18:17 ` Andrew Morton
  2004-01-24 18:32   ` Valdis.Kletnieks
  2004-01-25  1:40   ` Serge Belyshev
  0 siblings, 2 replies; 6+ messages in thread
From: Andrew Morton @ 2004-01-24 18:17 UTC (permalink / raw)
  To: Serge Belyshev; +Cc: linux-kernel

Serge Belyshev <33554432@mtu-net.ru> wrote:
>
> [This patch is against 2.6.2-rc1-mm2]

Is appreciated, thanks.

> arch/i386/Makefile:
> *  omitted $(KBUILD_SRC)/ in script call.

OK

> scripts/gcc-version.sh:
> *  GNU tail no longer supports 'tail -1' syntax.

OK.

> Makefile: 
> *  There is no point in adding -funit-at-a-time option because it is
>    enabled by default at levels -Os, -O2 and -O3.

hm.  Didn't Andi say that adding -fno-unit-at-a-time caused code shrinkage?

> *  Consider adding -fweb option:

What does it do?

>    vanilla:
>    $ size vmlinux
>       text    data     bss     dec     hex filename
>    3056270  526780  386056 3969106  3c9052 vmlinux
> 
>    with -fweb:
>    $ size vmlinux
>       text    data     bss     dec     hex filename
>    3049523  526780  386056 3962359  3c75f7 vmlinux
> 
>    Also note 0.1 ... 1.0% speedup in various benchmarks.
>    This option is not enabled by default at -O2 because it
>    (like -fomit-frame-pointer) makes debugging impossible.

OK, then we'd need a config option for it.



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

* Re: [PATCH] arch/i386/Makefile,scripts/gcc-version.sh,Makefile small fixes
  2004-01-24 18:17 ` Andrew Morton
@ 2004-01-24 18:32   ` Valdis.Kletnieks
  2004-01-25  1:55     ` Serge Belyshev
  2004-01-25  1:40   ` Serge Belyshev
  1 sibling, 1 reply; 6+ messages in thread
From: Valdis.Kletnieks @ 2004-01-24 18:32 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Serge Belyshev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 813 bytes --]

On Sat, 24 Jan 2004 10:17:04 PST, Andrew Morton said:

> > Makefile: 
> > *  There is no point in adding -funit-at-a-time option because it is
> >    enabled by default at levels -Os, -O2 and -O3.
> 
> hm.  Didn't Andi say that adding -fno-unit-at-a-time caused code shrinkage?

Also, at least for the Fedora gcc-ssa compiler, -funit-at-a-time is *not* a
default option (provably so - building with gcc-ssa makes a kernel that hangs
*very* early on (right after 'decompressing the kernel' - I haven't dug into
this yet) - but commenting out this:

# Enable unit-at-a-time mode when possible. It shrinks the
# kernel considerably.
CFLAGS += $(call check_gcc,-funit-at-a-time,)

results in a working kernel.  This is with:

%  gcc-ssa --version
gcc-ssa (GCC) 3.5-tree-ssa 20040115 (Fedora Core Rawhide 3.5ssa-108)


[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

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

* Re: [PATCH] arch/i386/Makefile,scripts/gcc-version.sh,Makefile small fixes
  2004-01-24 18:17 ` Andrew Morton
  2004-01-24 18:32   ` Valdis.Kletnieks
@ 2004-01-25  1:40   ` Serge Belyshev
  1 sibling, 0 replies; 6+ messages in thread
From: Serge Belyshev @ 2004-01-25  1:40 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

>> *  Consider adding -fweb option:
>
>What does it do?

>From gcc(1):

       -fweb
           Constructs webs as commonly used for register allocation purposes and
           assign each web individual pseudo register.  This allows our register
           allocation pass to operate on pseudos directly, but also strengthens
           several other optimization passes, such as CSE, loop optimizer and
           trivial dead code remover.  It can, however, make debugging impossible,
           since variables will no longer stay in a ``home register''.

           Enabled at levels -O3.

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

* Re: [PATCH] arch/i386/Makefile,scripts/gcc-version.sh,Makefile small fixes
  2004-01-24 18:32   ` Valdis.Kletnieks
@ 2004-01-25  1:55     ` Serge Belyshev
  0 siblings, 0 replies; 6+ messages in thread
From: Serge Belyshev @ 2004-01-25  1:55 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: akpm, linux-kernel

>Also, at least for the Fedora gcc-ssa compiler, -funit-at-a-time is *not* a
>default option (provably so - building with gcc-ssa makes a kernel that hangs
>*very* early on (right after 'decompressing the kernel' - I haven't dug into

But for gcc-3_4-branch (3.4.0 prerelease) and mainline (3.5.0 experimental)
-funit-at-a-time is default (at -O2 and higher) and works (at least for me :-).

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

end of thread, other threads:[~2004-01-25  1:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-24 14:04 [PATCH] arch/i386/Makefile,scripts/gcc-version.sh,Makefile small fixes Serge Belyshev
2004-01-24 18:17 ` Andrew Morton
2004-01-24 18:32   ` Valdis.Kletnieks
2004-01-25  1:55     ` Serge Belyshev
2004-01-25  1:40   ` Serge Belyshev
  -- strict thread matches above, loose matches on Subject: below --
2004-01-24 14:37 sam

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