All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@fs.tum.de>
To: linux-kernel@vger.kernel.org
Subject: [2.6 patch] add an -Os config option
Date: Mon, 11 Aug 2003 23:11:45 +0200	[thread overview]
Message-ID: <20030811211145.GA569@fs.tum.de> (raw)

The patch below adds an option OPTIMIZE_FOR_SIZE (depending on EMBEDDED) 
that changes the optimization from -O2 to -Os.

cu
Adrian

--- linux-2.6.0-test3/init/Kconfig.old	2003-08-11 01:33:31.000000000 +0200
+++ linux-2.6.0-test3/init/Kconfig	2003-08-11 01:46:48.000000000 +0200
@@ -118,6 +118,17 @@
 	  a "non-standard" kernel.  Only use this if you really know what you
 	  are doing.
 
+config OPTIMIZE_FOR_SIZE
+	bool "Optimize for size" if EMBEDDED
+	default n
+	help
+	  Enabling this option will pass "-Os" instead of "-O2" to gcc
+	  resulting in a smaller kernel.
+
+	  The resulting kernel might be significantly slower.
+
+	  If unsure, say N.
+
 config KALLSYMS
 	 bool "Load all symbols for debugging/kksymoops" if EMBEDDED
 	 default y
--- linux-2.6.0-test3/Makefile.old	2003-08-11 01:34:41.000000000 +0200
+++ linux-2.6.0-test3/Makefile	2003-08-11 01:37:16.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__
 
@@ -318,6 +318,12 @@
 
 -include .config.cmd
 
+ifdef CONFIG_OPTIMIZE_FOR_SIZE
+CFLAGS		+= -Os
+else
+CFLAGS		+= -O2
+endif
+
 ifndef CONFIG_FRAME_POINTER
 CFLAGS		+= -fomit-frame-pointer
 endif

             reply	other threads:[~2003-08-11 21:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-11 21:11 Adrian Bunk [this message]
2003-08-11 21:19 ` [2.6 patch] add an -Os config option Michael Buesch
2003-08-11 21:37   ` Mike Fedyk
2003-08-11 21:39   ` Christophe Saout
2003-08-11 21:41   ` Dagfinn Ilmari Mannsåker
2003-08-12  1:29   ` Gene Heskett
2003-08-12  2:51     ` Thomas Molina
2003-08-12  4:14       ` [OT] " Steven Cole
2003-08-12 15:25         ` Timothy Miller
2003-08-12 14:48       ` Gene Heskett
2003-08-12 10:11     ` Michael Buesch
2003-08-12 14:42       ` Gene Heskett
2003-08-12  1:45   ` Warren Turkal
2003-08-11 22:20 ` Russell King
2003-08-12  7:06 ` Christoph Hellwig
2003-08-12 15:43   ` Timothy Miller
2003-08-12 15:58     ` Adrian Bunk
2003-08-12 16:03     ` Kevin P. Fleming
2003-08-12 13:35 ` Alan Cox
2003-08-12 15:45   ` Joe Korty
2003-08-12 18:03   ` Timothy Miller
  -- strict thread matches above, loose matches on Subject: below --
2003-08-12 19:43 John Bradford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030811211145.GA569@fs.tum.de \
    --to=bunk@fs.tum.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.