Skip to content

Commit

Permalink
FROMLIST: BACKPORT: Makefile: lld: set -O2 linker flag when linking w…
Browse files Browse the repository at this point in the history
…ith 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.

Link: ClangBuiltLinux/linux#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>
  • Loading branch information
nickdesaulniers authored and subhajeetmuhuri committed Jun 3, 2019
1 parent 0fe9206 commit 6f06fac
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ endif
ifeq ($(cc-name),clang)
ifeq ($(ld-name),lld)
KBUILD_CFLAGS += -fuse-ld=lld
KBUILD_LDFLAGS += -O2
endif
KBUILD_CPPFLAGS += -Qunused-arguments
endif
Expand Down

0 comments on commit 6f06fac

Please sign in to comment.