]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.165/kbuild-use-oz-instead-of-os-when-using-clang.patch
move 5.10 queue back in place
[thirdparty/kernel/stable-queue.git] / releases / 4.4.165 / kbuild-use-oz-instead-of-os-when-using-clang.patch
CommitLineData
22b74881
GKH
1From foo@baz Wed Nov 21 18:50:39 CET 2018
2From: Behan Webster <behanw@converseincode.com>
3Date: Mon, 27 Mar 2017 18:19:09 -0700
4Subject: kbuild: use -Oz instead of -Os when using clang
5
6From: Behan Webster <behanw@converseincode.com>
7
8commit 6748cb3c299de1ffbe56733647b01dbcc398c419 upstream.
9
10This generates smaller resulting object code when compiled with clang.
11
12Signed-off-by: Behan Webster <behanw@converseincode.com>
13Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
14Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
15[nc: Adjust context due to lack of commit a76bcf557ef4 in linux-4.4.y]
16Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
17Signed-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