diff -urN linux-2.4.33-wt3-base/Documentation/Configure.help linux-2.4.33-wt3-opt/Documentation/Configure.help --- linux-2.4.33-wt3-base/Documentation/Configure.help 2006-11-09 14:20:50 +0100 +++ linux-2.4.33-wt3-opt/Documentation/Configure.help 2006-11-09 14:14:35 +0100 @@ -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.33-wt3-base/Makefile linux-2.4.33-wt3-opt/Makefile --- linux-2.4.33-wt3-base/Makefile 2006-11-09 14:20:50 +0100 +++ linux-2.4.33-wt3-opt/Makefile 2006-11-09 14:31:18 +0100 @@ -92,17 +92,26 @@ 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,-fno-align-loops,$(call check_gcc,-falign-loops=0,-malign-loops=0)) \ + $(call check_gcc,-fno-align-jumps,$(call check_gcc,-falign-jumps=0,-malign-jumps=0)) \ + $(call check_gcc,-fno-align-functions,$(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 CFLAGS += -fno-builtin-strpbrk -fno-builtin-sprintf ifndef CONFIG_FRAME_POINTER -CFLAGS += -fomit-frame-pointer +CFLAGS += $(call check_gcc,-momit-leaf-frame-pointer,-fomit-frame-pointer) endif ifneq "$(CONFIG_TUX_DEBUG)" "" CFLAGS += -g diff -urN linux-2.4.33-wt3-base/arch/i386/Makefile linux-2.4.33-wt3-opt/arch/i386/Makefile --- linux-2.4.33-wt3-base/arch/i386/Makefile 2006-11-09 14:20:50 +0100 +++ linux-2.4.33-wt3-opt/arch/i386/Makefile 2006-11-09 14:14:35 +0100 @@ -96,6 +96,10 @@ # due to the lack of sharing of stacklots. CFLAGS += $(call check_gcc,-fno-unit-at-a-time,) +ifdef CONFIG_OPTIM_SIZE +CFLAGS += $(call check_gcc,-mtune=i386,-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.33-wt3-base/arch/i386/config.in linux-2.4.33-wt3-opt/arch/i386/config.in --- linux-2.4.33-wt3-base/arch/i386/config.in 2006-11-09 14:20:50 +0100 +++ linux-2.4.33-wt3-opt/arch/i386/config.in 2006-11-09 14:14:35 +0100 @@ -250,6 +250,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 \