All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.m@jp.panasonic.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] kconfig: add CONFIG_CC_OPTIMIZE_FOR_SIZE
Date: Fri, 22 Aug 2014 19:42:29 +0900	[thread overview]
Message-ID: <1408704149-14704-4-git-send-email-yamada.m@jp.panasonic.com> (raw)
In-Reply-To: <1408704149-14704-1-git-send-email-yamada.m@jp.panasonic.com>

Copy the Kconfig option from "init/Kconfig" of Linux v3.16 tag
and adjust the help document.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

 Kconfig  | 10 ++++++++++
 Makefile |  6 +++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/Kconfig b/Kconfig
index ea2c836..cbb691e 100644
--- a/Kconfig
+++ b/Kconfig
@@ -46,6 +46,16 @@ config LOCALVERSION_AUTO
 
 	  which is done within the script "scripts/setlocalversion".)
 
+config CC_OPTIMIZE_FOR_SIZE
+	bool "Optimize for size"
+	depends on !SPL_BUILD
+	default y
+	help
+	  Enabling this option will pass "-Os" instead of "-O2" to gcc
+	  resulting in a smaller U-Boot image.
+
+	  This option is enabled by default for U-Boot.
+
 endmenu		# General setup
 
 menu "Boot images"
diff --git a/Makefile b/Makefile
index 2938dec..95e298b 100644
--- a/Makefile
+++ b/Makefile
@@ -533,7 +533,11 @@ else
 include/config/auto.conf: ;
 endif # $(dot-config)
 
-KBUILD_CFLAGS += -Os #-fomit-frame-pointer
+ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
+KBUILD_CFLAGS	+= -Os
+else
+KBUILD_CFLAGS	+= -O2
+endif
 
 ifdef BUILD_TAG
 KBUILD_CFLAGS += -DBUILD_TAG='"$(BUILD_TAG)"'
-- 
1.9.1

  parent reply	other threads:[~2014-08-22 10:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-22 10:42 [U-Boot] [PATCH 0/3] Kconfig: import some options related to general setup Masahiro Yamada
2014-08-22 10:42 ` [U-Boot] [PATCH 1/3] kconfig: add CONFIG_LOCALVERSION and CONFIG_LOCALVERSION_AUTO Masahiro Yamada
2014-08-29 14:41   ` [U-Boot] [U-Boot, " Tom Rini
2014-08-22 10:42 ` [U-Boot] [PATCH 2/3] scripts: refetch scripts/setlocalversion from Linux 3.16 Masahiro Yamada
2014-08-29 14:41   ` [U-Boot] [U-Boot, " Tom Rini
2014-08-22 10:42 ` Masahiro Yamada [this message]
2014-08-29 14:41   ` [U-Boot] [U-Boot,3/3] kconfig: add CONFIG_CC_OPTIMIZE_FOR_SIZE Tom Rini

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=1408704149-14704-4-git-send-email-yamada.m@jp.panasonic.com \
    --to=yamada.m@jp.panasonic.com \
    --cc=u-boot@lists.denx.de \
    /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.