linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] Kbuild: change CC_OPTIMIZE_FOR_SIZE definition
Date: Mon, 25 Apr 2016 17:35:27 +0200	[thread overview]
Message-ID: <1461598531-2190169-2-git-send-email-arnd@arndb.de> (raw)
In-Reply-To: <1461598531-2190169-1-git-send-email-arnd@arndb.de>

CC_OPTIMIZE_FOR_SIZE disables the often useful -Wmaybe-unused warning,
because that causes a ridiculous amount of false positives when combined
with -Os.

This means a lot of warnings don't show up in testing by the developers
that should see them with an 'allmodconfig' kernel that has
CC_OPTIMIZE_FOR_SIZE enabled, but only later in randconfig builds
that don't.

This changes the Kconfig logic around CC_OPTIMIZE_FOR_SIZE to make
it a 'choice' statement defaulting to CC_OPTIMIZE_FOR_PERFORMANCE
that gets added for this purpose. The allmodconfig and allyesconfig
kernels now default to -O2 with the maybe-unused warning enabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 init/Kconfig | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/init/Kconfig b/init/Kconfig
index 0c666408a8b6..d1b766bf60c1 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1284,6 +1284,17 @@ source "usr/Kconfig"
 
 endif
 
+choice
+	prompt "Compiler optimization level"
+	default CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
+
+config CC_OPTIMIZE_FOR_PERFORMANCE
+	bool "Optimize for performance"
+	help
+	  This is the default optimization level for the kernel, building
+	  with the "-O2" compiler flag for best performance and most
+	  helpful compile-time warnings.
+
 config CC_OPTIMIZE_FOR_SIZE
 	bool "Optimize for size"
 	help
@@ -1292,6 +1303,8 @@ config CC_OPTIMIZE_FOR_SIZE
 
 	  If unsure, say N.
 
+endchoice
+
 config SYSCTL
 	bool
 
-- 
2.7.0

  reply	other threads:[~2016-04-25 15:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25 15:35 [RESEND PATCH 0/5] gcov fixes and maybe-uninitialized warnings Arnd Bergmann
2016-04-25 15:35 ` Arnd Bergmann [this message]
2016-04-25 15:35 ` [PATCH 2/5] Kbuild: disable 'maybe-uninitialized' warning for CONFIG_PROFILE_ALL_BRANCHES Arnd Bergmann
2016-04-25 15:35 ` [PATCH 3/5] gcov: disable for COMPILE_TEST Arnd Bergmann
2016-04-25 15:35 ` [PATCH 4/5] gcov: disable tree-loop-im to reduce stack usage Arnd Bergmann
2016-04-25 15:35 ` [PATCH 5/5] gcov: disable -Wmaybe-uninitialized warning Arnd Bergmann
2016-05-10 15:14 ` [RESEND PATCH 0/5] gcov fixes and maybe-uninitialized warnings Michal Marek
2016-05-10 15:45   ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2016-02-12 16:06 [PATCH " Arnd Bergmann
2016-02-12 16:06 ` [PATCH 1/5] Kbuild: change CC_OPTIMIZE_FOR_SIZE definition Arnd Bergmann

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=1461598531-2190169-2-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).