BACKPORT: FROMLIST: Makefile: lld: set -O2 linker flag when linking with LLD
For arm64: 0.34% size improvement with lld -O2 over lld for vmlinux. 3.3% size improvement with lld -O2 over lld for Image.lz4-dtb. (am from https://lkml.org/lkml/2019/2/11/1949) Bug: 63740206 Change-Id: Ibdc7ecc9861562305b49456d6d37274ce8075e22 Link: https://github.com/ClangBuiltLinux/linux/issues/343 Suggested-by: Rui Ueyama <ruiu@google.com> Suggested-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Tested-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
This commit is contained in:
committed by
Sami Tolvanen
parent
10fa2703fb
commit
4a4ea24df2
4
Makefile
4
Makefile
@@ -755,6 +755,10 @@ else
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
|
||||
endif
|
||||
|
||||
ifeq ($(ld-name),lld)
|
||||
LDFLAGS += -O2
|
||||
endif
|
||||
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
|
||||
ifdef CONFIG_FRAME_POINTER
|
||||
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
||||
|
||||
Reference in New Issue
Block a user