aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
authorLinus Torvalds <torvalds@linux-foundation.org>2025-03-09 09:23:14 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2025-03-09 09:23:14 -1000
commit9712d38c87087ae34f8cede6583092c272507c52 (patch)
tree03d647b1b42d8eda03d034ab1104af734beb29e0 /Makefile
parent0dc1f314f854257eb64dcea604a42a55225453a9 (diff)
parentb5e3956535466187657563b754ba0f1da8626c7f (diff)
downloadath-9712d38c87087ae34f8cede6583092c272507c52.tar.gz
Merge tag 'kbuild-fixes-v6.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild fixes from Masahiro Yamada: - Use the specified $(LD) when building userprogs with Clang - Pass the correct target triple when compile-testing UAPI headers with Clang - Fix pacman-pkg build error with KBUILD_OUTPUT * tag 'kbuild-fixes-v6.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: install-extmod-build: Fix build when specifying KBUILD_OUTPUT docs: Kconfig: fix defconfig description kbuild: hdrcheck: fix cross build with clang kbuild: userprogs: use correct lld when linking through clang
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 70bdbf2218fc5..6a8e5be6b0043 100644
--- a/Makefile
+++ b/Makefile
@@ -1123,6 +1123,11 @@ endif
KBUILD_USERCFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
KBUILD_USERLDFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
+# userspace programs are linked via the compiler, use the correct linker
+ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_LD_IS_LLD),yy)
+KBUILD_USERLDFLAGS += --ld-path=$(LD)
+endif
+
# make the checker run with the right architecture
CHECKFLAGS += --arch=$(ARCH)