Skip to content

Commit

Permalink
BACKPORT: FROMLIST: 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.

(am from https://lkml.org/lkml/2019/2/11/1949)

Bug: 63740206
Change-Id: Ibdc7ecc9861562305b49456d6d37274ce8075e22
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>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
  • Loading branch information
nickdesaulniers authored and Samw662 committed Oct 9, 2024
1 parent 0044f35 commit bd2afec
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 @@ -788,6 +788,7 @@ LDFLAGS += --lto-O2
else
LDFLAGS += -O2
endif
LDFLAGS += --lto-O2
endif

# Tell gcc to never replace conditional load with a non-conditional one
Expand Down

0 comments on commit bd2afec

Please sign in to comment.