All of lore.kernel.org
 help / color / mirror / Atom feed
[parent not found: <Ip4B.8lT.23@gated-at.bofh.it>]
[parent not found: <Ioi6.7kG.15@gated-at.bofh.it>]
[parent not found: <I2Ue.7PG.3@gated-at.bofh.it>]
[parent not found: <20031015225055.GS17986@fs.tum.de.suse.lists.linux.kernel>]
* [2.6 patch] add a config option for -Os compilation
@ 2003-10-15 22:50 Adrian Bunk
  2003-10-15 23:12 ` Andrew Morton
  0 siblings, 1 reply; 40+ messages in thread
From: Adrian Bunk @ 2003-10-15 22:50 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Hi Andrew,

the patch below adds a configuration option for -Os (the H8300 symbol is
similar to the symbols on other architectures). It includes the results
of all detail discussions and applies, compiles and works with
2.6.0-test7-mm1.

Could you add it to -mm?

diffstat output:

 Makefile            |    8 +++++++-
 arch/arm/Makefile   |    2 --
 arch/h8300/Kconfig  |    4 ++++
 arch/h8300/Makefile |    3 +--
 init/Kconfig        |   10 ++++++++++
 5 files changed, 22 insertions(+), 5 deletions(-)


TIA
Adrian


--- linux-2.6.0-test5-mm4/init/Kconfig.old	2003-09-25 14:38:18.000000000 +0200
+++ linux-2.6.0-test5-mm4/init/Kconfig	2003-09-25 14:47:12.000000000 +0200
@@ -65,6 +65,16 @@
 
 menu "General setup"
 
+config CC_OPTIMIZE_FOR_SIZE
+	bool "Optimize for size" if EXPERIMENTAL
+	default y if ARM || H8300
+	default n
+	help
+	  Enabling this option will pass "-Os" instead of "-O2" to gcc
+	  resulting in a smaller kernel.
+
+	  If unsure, say N.
+
 config SWAP
 	bool "Support for paging of anonymous memory"
 	depends on MMU
--- linux-2.6.0-test5-mm4/Makefile.old	2003-09-25 14:38:18.000000000 +0200
+++ linux-2.6.0-test5-mm4/Makefile	2003-09-25 14:40:26.000000000 +0200
@@ -274,7 +274,7 @@
 CPPFLAGS        := -D__KERNEL__ -Iinclude \
 		   $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include)
 
-CFLAGS 		:= -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
+CFLAGS 		:= -Wall -Wstrict-prototypes -Wno-trigraphs \
 	  	   -fno-strict-aliasing -fno-common
 AFLAGS		:= -D__ASSEMBLY__
 
@@ -421,6 +421,12 @@
 # ---------------------------------------------------------------------------
 
 
+ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
+CFLAGS		+= -Os
+else
+CFLAGS		+= -O2
+endif
+
 ifndef CONFIG_FRAME_POINTER
 CFLAGS		+= -fomit-frame-pointer
 endif
--- linux-2.6.0-test5-mm4/arch/arm/Makefile.old	2003-09-25 14:38:18.000000000 +0200
+++ linux-2.6.0-test5-mm4/arch/arm/Makefile	2003-09-25 14:40:47.000000000 +0200
@@ -14,8 +14,6 @@
 GZFLAGS		:=-9
 #CFLAGS		+=-pipe
 
-CFLAGS		:=$(CFLAGS:-O2=-Os)
-
 ifeq ($(CONFIG_FRAME_POINTER),y)
 CFLAGS		+=-fno-omit-frame-pointer -mapcs -mno-sched-prolog
 endif
--- linux-2.6.0-test5-mm4/arch/h8300/Kconfig.old	2003-09-25 14:43:27.000000000 +0200
+++ linux-2.6.0-test5-mm4/arch/h8300/Kconfig	2003-09-25 14:43:44.000000000 +0200
@@ -5,6 +5,10 @@
 
 mainmenu "uClinux/h8300 (w/o MMU) Kernel Configuration"
 
+config H8300
+	bool
+	default y
+
 config MMU
 	bool
 	default n
--- linux-2.6.0-test5-mm4/arch/h8300/Makefile.old	2003-09-25 14:38:18.000000000 +0200
+++ linux-2.6.0-test5-mm4/arch/h8300/Makefile	2003-09-25 14:38:24.000000000 +0200
@@ -34,7 +34,7 @@
 ldflags-$(CONFIG_CPU_H8S)	:= -mh8300self
 
 CFLAGS += $(cflags-y)
-CFLAGS += -mint32 -fno-builtin -Os
+CFLAGS += -mint32 -fno-builtin
 CFLAGS += -g
 CFLAGS += -D__linux__
 CFLAGS += -DUTS_SYSNAME=\"uClinux\"

^ permalink raw reply	[flat|nested] 40+ messages in thread
* [2.6 patch] add a config option for -Os compilation
@ 2003-09-14 12:16 Adrian Bunk
  2003-09-14 12:33 ` Russell King
  2003-09-14 13:53 ` Wade
  0 siblings, 2 replies; 40+ messages in thread
From: Adrian Bunk @ 2003-09-14 12:16 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

The patch below adds a config option OPTIMIZE_FOR_SIZE for telling gcc 
to use -Os instead of -O2. Besides this, it removes constructs on 
architectures that had a -Os hardcoded in their Makefiles.

It works for me, I'm currently running a 2.6.0-test5 compild with this 
option enabled and there are no obvious problems.

The last time I sent this to linux-kernel there were one positive and 
zero negative reactions.

diffstat output:

 Makefile            |    8 +++++++-
 arch/arm/Makefile   |    2 --
 arch/h8300/Makefile |    2 +-
 init/Kconfig        |    9 +++++++++
 4 files changed, 17 insertions(+), 4 deletions(-)

Please apply
Adrian

--- linux-2.6.0-test5-Os/init/Kconfig.old	2003-09-13 17:30:50.000000000 +0200
+++ linux-2.6.0-test5-Os/init/Kconfig	2003-09-13 17:30:59.000000000 +0200
@@ -65,6 +65,15 @@
 
 menu "General setup"
 
+config OPTIMIZE_FOR_SIZE
+	bool "Optimize for size" if EXPERIMENTAL
+	default n
+	help
+	  Enabling this option will pass "-Os" instead of "-O2" to gcc
+	  resulting in a smaller kernel.
+
+	  If unsure, say N.
+
 config SWAP
 	bool "Support for paging of anonymous memory"
 	depends on MMU
--- linux-2.6.0-test5-Os/Makefile.old	2003-09-13 17:30:50.000000000 +0200
+++ linux-2.6.0-test5-Os/Makefile	2003-09-13 17:30:59.000000000 +0200
@@ -223,7 +223,7 @@
 NOSTDINC_FLAGS  = -nostdinc -iwithprefix include
 
 CPPFLAGS	:= -D__KERNEL__ -Iinclude
-CFLAGS 		:= -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
+CFLAGS 		:= -Wall -Wstrict-prototypes -Wno-trigraphs \
 	  	   -fno-strict-aliasing -fno-common
 AFLAGS		:= -D__ASSEMBLY__
 
@@ -370,6 +370,12 @@
 # ---------------------------------------------------------------------------
 
 
+ifdef CONFIG_OPTIMIZE_FOR_SIZE
+CFLAGS		+= -Os
+else
+CFLAGS		+= -O2
+endif
+
 ifndef CONFIG_FRAME_POINTER
 CFLAGS		+= -fomit-frame-pointer
 endif
--- linux-2.6.0-test5-Os/arch/arm/Makefile.old	2003-09-13 17:30:50.000000000 +0200
+++ linux-2.6.0-test5-Os/arch/arm/Makefile	2003-09-13 17:30:59.000000000 +0200
@@ -14,8 +14,6 @@
 GZFLAGS		:=-9
 #CFLAGS		+=-pipe
 
-CFLAGS		:=$(CFLAGS:-O2=-Os)
-
 ifeq ($(CONFIG_FRAME_POINTER),y)
 CFLAGS		+=-fno-omit-frame-pointer -mapcs -mno-sched-prolog
 endif
--- linux-2.6.0-test5-Os/arch/h8300/Makefile.old	2003-09-13 17:30:50.000000000 +0200
+++ linux-2.6.0-test5-Os/arch/h8300/Makefile	2003-09-13 17:30:59.000000000 +0200
@@ -34,7 +34,7 @@
 ldflags-$(CONFIG_CPU_H8S)	:= -mh8300self
 
 CFLAGS += $(cflags-y)
-CFLAGS += -mint32 -fno-builtin -Os
+CFLAGS += -mint32 -fno-builtin
 CFLAGS += -g
 CFLAGS += -D__linux__
 CFLAGS += -DUTS_SYSNAME=\"uClinux\"

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

end of thread, other threads:[~2003-10-21  8:22 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <H2MN.3cm.7@gated-at.bofh.it>
     [not found] ` <H366.3IC.9@gated-at.bofh.it>
     [not found]   ` <H3fO.3VO.13@gated-at.bofh.it>
     [not found]     ` <H3IO.4yt.9@gated-at.bofh.it>
     [not found]       ` <HWvz.5PI.9@gated-at.bofh.it>
     [not found]         ` <I1EP.5QO.1@gated-at.bofh.it>
2003-10-18 17:10           ` [2.6 patch] add a config option for -Os compilation Ihar 'Philips' Filipau
     [not found]             ` <20031019113743.GO12423@fs.tum.de>
2003-10-19 14:15               ` Ihar 'Philips' Filipau
2003-10-19 15:40                 ` Martin J. Bligh
     [not found] <Ip4B.8lT.23@gated-at.bofh.it>
     [not found] ` <Ip4B.8lT.25@gated-at.bofh.it>
     [not found]   ` <Ip4B.8lT.27@gated-at.bofh.it>
     [not found]     ` <Ip4B.8lT.29@gated-at.bofh.it>
     [not found]       ` <Ip4B.8lT.31@gated-at.bofh.it>
     [not found]         ` <Ip4B.8lT.33@gated-at.bofh.it>
     [not found]           ` <Ip4B.8lT.35@gated-at.bofh.it>
     [not found]             ` <Ip4B.8lT.37@gated-at.bofh.it>
     [not found]               ` <Ip4B.8lT.39@gated-at.bofh.it>
     [not found]                 ` <Ip4B.8lT.41@gated-at.bofh.it>
     [not found]                   ` <Ip4B.8lT.43@gated-at.bofh.it>
     [not found]                     ` <Ip4B.8lT.21@gated-at.bofh.it>
2003-10-19 17:04                       ` Ihar 'Philips' Filipau
     [not found] <Ioi6.7kG.15@gated-at.bofh.it>
     [not found] ` <Ioi6.7kG.17@gated-at.bofh.it>
     [not found]   ` <Ioi6.7kG.19@gated-at.bofh.it>
     [not found]     ` <Ioi6.7kG.21@gated-at.bofh.it>
     [not found]       ` <Ioi6.7kG.23@gated-at.bofh.it>
     [not found]         ` <Ioi6.7kG.25@gated-at.bofh.it>
     [not found]           ` <Ioi6.7kG.27@gated-at.bofh.it>
     [not found]             ` <Ioi6.7kG.29@gated-at.bofh.it>
     [not found]               ` <Ioi6.7kG.31@gated-at.bofh.it>
     [not found]                 ` <Ioi6.7kG.11@gated-at.bofh.it>
     [not found]                   ` <IorM.7wQ.11@gated-at.bofh.it>
2003-10-19 16:55                     ` Ihar 'Philips' Filipau
     [not found] <I2Ue.7PG.3@gated-at.bofh.it>
     [not found] ` <I2Ue.7PG.5@gated-at.bofh.it>
     [not found]   ` <I2Ue.7PG.7@gated-at.bofh.it>
     [not found]     ` <I2Ue.7PG.9@gated-at.bofh.it>
     [not found]       ` <I2Ue.7PG.11@gated-at.bofh.it>
     [not found]         ` <I2Ue.7PG.13@gated-at.bofh.it>
     [not found]           ` <I2Ue.7PG.1@gated-at.bofh.it>
     [not found]             ` <ImzK.4TR.25@gated-at.bofh.it>
     [not found]               ` <ImzK.4TR.23@gated-at.bofh.it>
     [not found]                 ` <InYQ.6OJ.21@gated-at.bofh.it>
2003-10-19 16:05                   ` Ihar 'Philips' Filipau
2003-10-19 16:14                     ` Wichert Akkerman
2003-10-19 16:31                       ` Valdis.Kletnieks
2003-10-19 16:57                         ` Maciej Zenczykowski
2003-10-19 18:00                           ` Valdis.Kletnieks
     [not found] <20031015225055.GS17986@fs.tum.de.suse.lists.linux.kernel>
     [not found] ` <20031015161251.7de440ab.akpm@osdl.org.suse.lists.linux.kernel>
     [not found]   ` <20031015232440.GU17986@fs.tum.de.suse.lists.linux.kernel>
     [not found]     ` <20031015165205.0cc40606.akpm@osdl.org.suse.lists.linux.kernel>
     [not found]       ` <20031018102127.GE12423@fs.tum.de.suse.lists.linux.kernel>
     [not found]         ` <649730000.1066491920@[10.10.2.4].suse.lists.linux.kernel>
     [not found]           ` <20031018102402.3576af6c.akpm@osdl.org.suse.lists.linux.kernel>
     [not found]             ` <20031018174434.GJ12423@fs.tum.de.suse.lists.linux.kernel>
     [not found]               ` <20031018105733.380ea8d2.akpm@osdl.org.suse.lists.linux.kernel>
2003-10-18 19:19                 ` Andi Kleen
2003-10-19 13:56                   ` Ingo Oeser
2003-10-19 14:09                     ` Michael Buesch
2003-10-19 17:37                     ` Sam Ravnborg
2003-10-15 22:50 Adrian Bunk
2003-10-15 23:12 ` Andrew Morton
2003-10-15 23:24   ` Adrian Bunk
2003-10-15 23:52     ` Andrew Morton
2003-10-18 10:21       ` Adrian Bunk
2003-10-18 15:45         ` Martin J. Bligh
2003-10-18 17:24           ` Andrew Morton
2003-10-18 17:44             ` Adrian Bunk
2003-10-18 17:57               ` Andrew Morton
2003-10-19 15:43                 ` Martin J. Bligh
2003-10-19 15:59                   ` Adrian Bunk
2003-10-19 16:25                   ` Arjan van de Ven
2003-10-19 18:32                   ` Andrew Morton
2003-10-20 14:27                     ` Martin J. Bligh
2003-10-21  8:22         ` Jan-Benedict Glaw
  -- strict thread matches above, loose matches on Subject: below --
2003-09-14 12:16 Adrian Bunk
2003-09-14 12:33 ` Russell King
2003-09-14 13:21   ` Adrian Bunk
2003-09-14 14:52     ` Russell King
2003-09-25 14:38       ` Adrian Bunk
2003-09-25 18:11         ` Sam Ravnborg
2003-09-26 11:44           ` Russell King
2003-09-26 22:36           ` Adrian Bunk
2003-09-14 13:53 ` Wade
2003-09-14 14:57   ` Alan Cox
2003-09-15 15:15     ` Martin J. Bligh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.