Skip to content

Commit

Permalink
kbuild: use -Oz instead of -Os when using clang
Browse files Browse the repository at this point in the history
This generates smaller resulting object code when compiled with clang.

Signed-off-by: Behan Webster <[email protected]>
Signed-off-by: Matthias Kaehlcke <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
behanw authored and masahir0y committed Apr 12, 2017
1 parent c3f0d0b commit 6748cb3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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,)
Expand Down

0 comments on commit 6748cb3

Please sign in to comment.