From: Greg Kroah-Hartman Date: Mon, 10 Mar 2025 16:42:09 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v5.4.291~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f28ff47943a3e59a9d80a0eb24d17627fbfd13e1;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: kbuild-userprogs-use-correct-lld-when-linking-through-clang.patch --- diff --git a/queue-5.4/kbuild-userprogs-use-correct-lld-when-linking-through-clang.patch b/queue-5.4/kbuild-userprogs-use-correct-lld-when-linking-through-clang.patch new file mode 100644 index 0000000000..a31bd5d3c9 --- /dev/null +++ b/queue-5.4/kbuild-userprogs-use-correct-lld-when-linking-through-clang.patch @@ -0,0 +1,50 @@ +From 89dc7c7a9f6f609fb5c9c6ed819bf99cf2e373a2 Mon Sep 17 00:00:00 2001 +From: "Thomas Weißschuh" +Date: Mon, 17 Feb 2025 08:27:54 +0100 +Subject: kbuild: userprogs: use correct lld when linking through clang + +From: "Thomas Weißschuh" + +commit dfc1b168a8c4b376fa222b27b97c2c4ad4b786e1 upstream. + +The userprog infrastructure links objects files through $(CC). +Either explicitly by manually calling $(CC) on multiple object files or +implicitly by directly compiling a source file to an executable. +The documentation at Documentation/kbuild/llvm.rst indicates that ld.lld +would be used for linking if LLVM=1 is specified. +However clang instead will use either a globally installed cross linker +from $PATH called ${target}-ld or fall back to the system linker, which +probably does not support crosslinking. +For the normal kernel build this is not an issue because the linker is +always executed directly, without the compiler being involved. + +Explicitly pass --ld-path to clang so $(LD) is respected. +As clang 13.0.1 is required to build the kernel, this option is available. + +Fixes: 7f3a59db274c ("kbuild: add infrastructure to build userspace programs") +Cc: stable@vger.kernel.org # needs wrapping in $(cc-option) for < 6.9 +Signed-off-by: Thomas Weißschuh +Reviewed-by: Nathan Chancellor +Signed-off-by: Masahiro Yamada +[nathan: use cc-option for 6.6 and older, as those trees support back to + clang-11] +Signed-off-by: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + Makefile | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/Makefile ++++ b/Makefile +@@ -956,6 +956,11 @@ ifeq ($(CONFIG_RELR),y) + LDFLAGS_vmlinux += --pack-dyn-relocs=relr --use-android-relr-tags + endif + ++# userspace programs are linked via the compiler, use the correct linker ++ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_LD_IS_LLD),yy) ++KBUILD_USERLDFLAGS += $(call cc-option, --ld-path=$(LD)) ++endif ++ + # make the checker run with the right architecture + CHECKFLAGS += --arch=$(ARCH) + diff --git a/queue-5.4/series b/queue-5.4/series index 479903d307..b7782c3813 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -95,6 +95,7 @@ nilfs2-handle-errors-that-nilfs_prepare_chunk-may-return.patch media-uvcvideo-only-save-async-fh-if-success.patch media-uvcvideo-remove-dangling-pointers.patch sched-sch_cake-add-bounds-checks-to-host-bulk-flow-fairness-counts.patch +kbuild-userprogs-use-correct-lld-when-linking-through-clang.patch tasklet-introduce-new-initialization-api.patch net-usb-rtl8150-use-new-tasklet-api.patch net-usb-rtl8150-enable-basic-endpoint-checking.patch