Skip to content

Commit

Permalink
FROMLIST: Makefile: lld: tell clang to use lld
Browse files Browse the repository at this point in the history
This is needed because clang doesn't select which linker to use based on
$LD but rather -fuse-ld=lld. This is problematic especially for
cc-ldoption, which checks for linker flag support via invoking the
compiler, rather than the linker.

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

Link: ClangBuiltLinux/linux#342
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>
Bug: 63740206
Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0
Signed-off-by: Yousef Algadri <yusufgadrie@gmail.com>
Signed-off-by: Raphiel Rollerscaperers <rapherion@raphielgang.org>
  • Loading branch information
nickdesaulniers authored and MocaRafee committed Nov 8, 2024
1 parent 400d2de commit d948587
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,9 @@ CLANG_FLAGS += $(call cc-option, -Wno-bool-operation)
CLANG_FLAGS += $(call cc-option, -Wno-string-concatenation)
KBUILD_CFLAGS += $(CLANG_FLAGS)
KBUILD_AFLAGS += $(CLANG_FLAGS)
ifeq ($(ld-name),lld)
KBUILD_CFLAGS += -fuse-ld=lld
endif
export CLANG_FLAGS
endif

Expand Down

0 comments on commit d948587

Please sign in to comment.