diff -urN linux-2.4.26-wt7/Documentation/Configure.help linux-2.4.26-wt7-cfg/Documentation/Configure.help --- linux-2.4.26-wt7/Documentation/Configure.help Fri May 21 11:28:04 2004 +++ linux-2.4.26-wt7-cfg/Documentation/Configure.help Fri May 21 15:26:03 2004 @@ -348,6 +348,16 @@ If you are not sure, say Y; apart from resulting in a 66 KB bigger kernel, it won't hurt. +Optimize compilation for speed (Default) +CONFIG_OPTIM_SPEED + This option selects optimization for speed, which is the default. + If unsure, select Y. + +Optimize compilation for size +CONFIG_OPTIM_SIZE + This option selects optimization for reduced code size if using + GCC-2.95 or newer. If unsure, select N. + Timer and CPU usage LEDs CONFIG_LEDS If you say Y here, the LEDs on your machine will be used diff -urN linux-2.4.26-wt7/Makefile linux-2.4.26-wt7-cfg/Makefile --- linux-2.4.26-wt7/Makefile Fri May 21 15:38:20 2004 +++ linux-2.4.26-wt7-cfg/Makefile Fri May 21 15:36:05 2004 @@ -94,11 +94,20 @@ CPPFLAGS := -D__KERNEL__ -I$(HPATH) ifeq "$(CONFIG_TUX_DEBUG)" "" +ifdef CONFIG_OPTIM_SIZE +CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -Os \ + -fno-strict-aliasing -fno-common -fno-strength-reduce \ + $(call check_gcc,-falign-loops=0,-malign-loops=0) \ + $(call check_gcc,-falign-jumps=0,-malign-jumps=0) \ + $(call check_gcc,-falign-functions=0,-malign-functions=0) +else CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \ - -fomit-frame-pointer -fno-strict-aliasing -fno-common + -fno-strict-aliasing -fno-common -fno-strength-reduce +endif else CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \ - -fno-omit-frame-pointer -fno-strict-aliasing -fno-common -g + -fno-omit-frame-pointer -fno-strict-aliasing -fno-common -g \ + -fno-strength-reduce endif ifndef CONFIG_FRAME_POINTER diff -urN linux-2.4.26-wt7/arch/i386/Makefile linux-2.4.26-wt7-cfg/arch/i386/Makefile --- linux-2.4.26-wt7/arch/i386/Makefile Fri May 21 11:27:51 2004 +++ linux-2.4.26-wt7-cfg/arch/i386/Makefile Fri May 21 15:26:03 2004 @@ -94,6 +94,10 @@ CFLAGS += $(call check_gcc,-march=c3-2,-march=i686) endif +ifdef CONFIG_OPTIM_SIZE +CFLAGS += -mcpu=i386 +endif + HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o SUBDIRS += arch/i386/kernel arch/i386/mm arch/i386/lib diff -urN linux-2.4.26-wt7/arch/i386/config.in linux-2.4.26-wt7-cfg/arch/i386/config.in --- linux-2.4.26-wt7/arch/i386/config.in Fri May 21 11:28:04 2004 +++ linux-2.4.26-wt7-cfg/arch/i386/config.in Fri May 21 15:26:03 2004 @@ -252,6 +252,10 @@ tristate 'BIOS Enhanced Disk Drive calls determine boot disk (EXPERIMENTAL)' CONFIG_EDD fi +choice 'Optimize code for' \ + "Speed CONFIG_OPTIM_SPEED \ + Size CONFIG_OPTIM_SIZE" Speed + choice 'High Memory Support' \ "off CONFIG_NOHIGHMEM \ 4GB CONFIG_HIGHMEM4G \