]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Aug 2025 05:46:22 +0000 (07:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Aug 2025 05:46:22 +0000 (07:46 +0200)
added patches:
kbuild-userprogs-use-correct-linker-when-mixing-clang-and-gnu-ld.patch

queue-5.10/kbuild-userprogs-use-correct-linker-when-mixing-clang-and-gnu-ld.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/kbuild-userprogs-use-correct-linker-when-mixing-clang-and-gnu-ld.patch b/queue-5.10/kbuild-userprogs-use-correct-linker-when-mixing-clang-and-gnu-ld.patch
new file mode 100644 (file)
index 0000000..e1cac6e
--- /dev/null
@@ -0,0 +1,44 @@
+From stable+bounces-172219-greg=kroah.com@vger.kernel.org Thu Aug 21 20:31:32 2025
+From: Nathan Chancellor <nathan@kernel.org>
+Date: Thu, 21 Aug 2025 11:31:06 -0700
+Subject: kbuild: userprogs: use correct linker when mixing clang and GNU ld
+To: gregkh@linuxfoundation.org, sashal@kernel.org
+Cc: stable@vger.kernel.org, nathan@kernel.org, thomas.weissschuh@linutronix.de
+Message-ID: <20250821183106.1268616-1-nathan@kernel.org>
+
+From: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
+
+commit 936599ca514973d44a766b7376c6bbdc96b6a8cc upstream.
+
+The userprogs infrastructure does not expect clang being used with GNU ld
+and in that case uses /usr/bin/ld for linking, not the configured $(LD).
+This fallback is problematic as it will break when cross-compiling.
+Mixing clang and GNU ld is used for example when building for SPARC64,
+as ld.lld is not sufficient; see Documentation/kbuild/llvm.rst.
+
+Relax the check around --ld-path so it gets used for all linkers.
+
+Fixes: dfc1b168a8c4 ("kbuild: userprogs: use correct lld when linking through clang")
+Cc: stable@vger.kernel.org
+Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
+Reviewed-by: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+[nathan: Work around wrapping '--ld-path' in cc-option in older stable
+         branches due to older minimum LLVM version]
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Makefile |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -1037,7 +1037,7 @@ KBUILD_USERCFLAGS  += $(filter -m32 -m64
+ 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)
++ifdef CONFIG_CC_IS_CLANG
+ KBUILD_USERLDFLAGS += $(call cc-option, --ld-path=$(LD))
+ endif
index 9d6cbb9103ef2a8144ee6c9ccd49589b21e6535b..b82d3a209c0ef57ad507c44510d0019ce367fa2d 100644 (file)
@@ -412,3 +412,4 @@ usb-storage-add-unusual-devs-entry-for-novatek-ntk96550-based-camera.patch
 usb-storage-realtek_cr-use-correct-byte-order-for-bcs-residue.patch
 usb-storage-ignore-driver-cd-mode-for-realtek-multi-mode-wi-fi-dongles.patch
 usb-dwc3-ignore-late-xfernotready-event-to-prevent-halt-timeout.patch
+kbuild-userprogs-use-correct-linker-when-mixing-clang-and-gnu-ld.patch