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 ItsVixano committed Feb 6, 2025
1 parent 93b575e commit e1c89b0
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 @@ -609,6 +609,9 @@ endif
# Use make W=1 to enable them (see scripts/Makefile.build)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
ifneq ($(LLVM),)
KBUILD_CFLAGS += -fuse-ld=lld
endif

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

0 comments on commit e1c89b0

Please sign in to comment.