From: Serge Belyshev <33554432@mtu-net.ru>

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

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

We should 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.



---

 arch/i386/Makefile     |    2 +-
 scripts/gcc-version.sh |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff -puN arch/i386/Makefile~add-config-for-mregparm-3-ng-fixes arch/i386/Makefile
--- 25/arch/i386/Makefile~add-config-for-mregparm-3-ng-fixes	2004-01-24 13:43:04.000000000 -0800
+++ 25-akpm/arch/i386/Makefile	2004-01-24 13:43:04.000000000 -0800
@@ -70,7 +70,7 @@ cflags-$(CONFIG_X86_ELAN)	:= -march=i486
 
 # -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) $(srctree)/scripts/gcc-version.sh $(CC))
 cflags-$(CONFIG_REGPARM) 	+= $(shell if [ $(GCC_VERSION) -ge 0300 ] ; then echo "-mregparm=3"; fi ;)
 
 CFLAGS += $(cflags-y)
diff -puN scripts/gcc-version.sh~add-config-for-mregparm-3-ng-fixes scripts/gcc-version.sh
--- 25/scripts/gcc-version.sh~add-config-for-mregparm-3-ng-fixes	2004-01-24 13:43:04.000000000 -0800
+++ 25-akpm/scripts/gcc-version.sh	2004-01-24 13:43:04.000000000 -0800
@@ -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
 

_