Skip to content

Commit

Permalink
BACKPORT: 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)

Bug: 63740206
Change-Id: I3edf2f0f6c0bac842bef22194bd48a993fc0e3c0
Link: ClangBuiltLinux/linux#342
Suggested-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Tested-by: Nathan Chancellor <[email protected]>
Signed-off-by: Nick Desaulniers <[email protected]>
  • Loading branch information
nickdesaulniers authored and Abhinavgupta371 committed Sep 29, 2023
1 parent 21773b8 commit 03cd8d1
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 @@ -552,6 +552,9 @@ CLANG_FLAGS += $(call cc-option, -Wno-misleading-indentation)
CLANG_FLAGS += $(call cc-option, -Wno-bool-operation)
KBUILD_CFLAGS += $(CLANG_FLAGS)
KBUILD_AFLAGS += $(CLANG_FLAGS)
ifneq ($(LLVM),)
KBUILD_CFLAGS += -fuse-ld=lld
endif
endif

ifeq ($(mixed-targets),1)
Expand Down

0 comments on commit 03cd8d1

Please sign in to comment.