]>
Commit | Line | Data |
---|---|---|
22b74881 GKH |
1 | From foo@baz Wed Nov 21 18:50:39 CET 2018 |
2 | From: Behan Webster <behanw@converseincode.com> | |
3 | Date: Mon, 27 Mar 2017 18:19:09 -0700 | |
4 | Subject: kbuild: use -Oz instead of -Os when using clang | |
5 | ||
6 | From: Behan Webster <behanw@converseincode.com> | |
7 | ||
8 | commit 6748cb3c299de1ffbe56733647b01dbcc398c419 upstream. | |
9 | ||
10 | This generates smaller resulting object code when compiled with clang. | |
11 | ||
12 | Signed-off-by: Behan Webster <behanw@converseincode.com> | |
13 | Signed-off-by: Matthias Kaehlcke <mka@chromium.org> | |
14 | Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> | |
15 | [nc: Adjust context due to lack of commit a76bcf557ef4 in linux-4.4.y] | |
16 | Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> | |
17 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
18 | --- | |
19 | Makefile | 2 +- | |
20 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
21 | ||
22 | --- a/Makefile | |
23 | +++ b/Makefile | |
24 | @@ -628,7 +628,7 @@ KBUILD_CFLAGS += $(call cc-disable-warni | |
25 | KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias) | |
26 | ||
27 | ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE | |
28 | -KBUILD_CFLAGS += -Os | |
29 | +KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) | |
30 | else | |
31 | ifdef CONFIG_PROFILE_ALL_BRANCHES | |
32 | KBUILD_CFLAGS += -O2 |