diff --git a/Makefile b/Makefile index 8bca8d06fb2b..f2ea4dea3673 100644 --- a/Makefile +++ b/Makefile @@ -650,6 +650,13 @@ LLVM_NM := llvm-nm export LLVM_AR LLVM_NM endif +ifeq ($(cc-name),clang) +ifeq ($(ld-name),lld) +KBUILD_CFLAGS += -fuse-ld=lld +endif +KBUILD_CPPFLAGS += -Qunused-arguments +endif + # The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default # values of the respective KBUILD_* variables ARCH_CPPFLAGS := @@ -781,7 +788,6 @@ CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN) endif KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) -meabi gnu KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) -KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) KBUILD_CFLAGS += $(call cc-disable-warning, gnu) KBUILD_CFLAGS += $(call cc-disable-warning, duplicate-decl-specifier)