kbuild: use -Oz instead of -Os when using clang
authorBehan Webster <behanw@converseincode.com>
Tue, 28 Mar 2017 01:19:09 +0000 (18:19 -0700)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 12 Apr 2017 20:30:25 +0000 (05:30 +0900)
This generates smaller resulting object code when compiled with clang.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Makefile

index ae49fef98ca3365200b40cf7f190d552df0c148c..d266186086334a35d476f62064c8e3f3c38d0f0e 100644 (file)
--- 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,)