Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d438cec0 authored by Behan Webster's avatar Behan Webster Committed by Greg Kroah-Hartman
Browse files

kbuild: use -Oz instead of -Os when using clang



commit 6748cb3c299de1ffbe56733647b01dbcc398c419 upstream.

This generates smaller resulting object code when compiled with clang.

Signed-off-by: default avatarBehan Webster <behanw@converseincode.com>
Signed-off-by: default avatarMatthias Kaehlcke <mka@chromium.org>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 14635231
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -644,7 +644,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,)