linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: use -Oz instead of -Os when using clang
@ 2017-03-28  1:19 Matthias Kaehlcke
  2017-03-30 16:03 ` Masahiro Yamada
  0 siblings, 1 reply; 7+ messages in thread
From: Matthias Kaehlcke @ 2017-03-28  1:19 UTC (permalink / raw)
  To: Michal Marek
  Cc: linux-kbuild, linux-kernel, Behan Webster, Greg Hackmann,
	Grant Grundler, Michael Davidson, Peter Foley, Matthias Kaehlcke

This generates smaller resulting object code when compiled with clang.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index b2faa9319372..66bcdbf58371 100644
--- a/Makefile
+++ b/Makefile
@@ -638,7 +638,8 @@ KBUILD_CFLAGS	+= $(call cc-option,-fdata-sections,)
 endif
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS	+= -Os $(call cc-disable-warning,maybe-uninitialized,)
+KBUILD_CFLAGS	+= $(call cc-option,-Oz,-Os)
+KBUILD_CFLAGS	+= $(call cc-disable-warning,maybe-uninitialized,)
 else
 ifdef CONFIG_PROFILE_ALL_BRANCHES
 KBUILD_CFLAGS	+= -O2 $(call cc-disable-warning,maybe-uninitialized,)
-- 
2.12.2.564.g063fe858b8-goog

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

end of thread, other threads:[~2017-04-12 20:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-28  1:19 [PATCH] kbuild: use -Oz instead of -Os when using clang Matthias Kaehlcke
2017-03-30 16:03 ` Masahiro Yamada
2017-03-30 16:41   ` Matthias Kaehlcke
2017-03-30 17:57     ` Masahiro Yamada
2017-04-10 18:08       ` Matthias Kaehlcke
2017-04-12  3:38         ` Masahiro Yamada
2017-04-12 20:39           ` Masahiro Yamada

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).