From: Greg Kroah-Hartman Date: Wed, 25 Jun 2025 08:50:49 +0000 (+0100) Subject: drop some kbuild patches from 5.4 X-Git-Tag: v5.4.295~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b1eaf4a5f170ca33ffc19ae2c22bc8e729b7e31e;p=thirdparty%2Fkernel%2Fstable-queue.git drop some kbuild patches from 5.4 broke the build on arm64 --- diff --git a/queue-5.4/kbuild-add-clang_flags-to-as-instr.patch b/queue-5.4/kbuild-add-clang_flags-to-as-instr.patch deleted file mode 100644 index 617780251f..0000000000 --- a/queue-5.4/kbuild-add-clang_flags-to-as-instr.patch +++ /dev/null @@ -1,43 +0,0 @@ -From b7e68767a827168474d68a6f5ab998eac82f8c90 Mon Sep 17 00:00:00 2001 -From: Nathan Chancellor -Date: Thu, 1 Jun 2023 12:50:39 -0700 -Subject: kbuild: Add CLANG_FLAGS to as-instr - -From: Nathan Chancellor - -commit cff6e7f50bd315e5b39c4e46c704ac587ceb965f upstream. - -A future change will move CLANG_FLAGS from KBUILD_{A,C}FLAGS to -KBUILD_CPPFLAGS so that '--target' is available while preprocessing. -When that occurs, the following errors appear multiple times when -building ARCH=powerpc powernv_defconfig: - - ld.lld: error: vmlinux.a(arch/powerpc/kernel/head_64.o):(.text+0x12d4): relocation R_PPC64_ADDR16_HI out of range: -4611686018409717520 is not in [-2147483648, 2147483647]; references '__start___soft_mask_table' - ld.lld: error: vmlinux.a(arch/powerpc/kernel/head_64.o):(.text+0x12e8): relocation R_PPC64_ADDR16_HI out of range: -4611686018409717392 is not in [-2147483648, 2147483647]; references '__stop___soft_mask_table' - -Diffing the .o.cmd files reveals that -DHAVE_AS_ATHIGH=1 is not present -anymore, because as-instr only uses KBUILD_AFLAGS, which will no longer -contain '--target'. - -Mirror Kconfig's as-instr and add CLANG_FLAGS explicitly to the -invocation to ensure the target information is always present. - -Signed-off-by: Nathan Chancellor -Signed-off-by: Masahiro Yamada -Signed-off-by: Nathan Chancellor -Signed-off-by: Greg Kroah-Hartman ---- - scripts/Kbuild.include | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/scripts/Kbuild.include -+++ b/scripts/Kbuild.include -@@ -108,7 +108,7 @@ as-option = $(call try-run,\ - # Usage: aflags-y += $(call as-instr,instr,option1,option2) - - as-instr = $(call try-run,\ -- printf "%b\n" "$(1)" | $(CC) -Werror $(KBUILD_AFLAGS) -c -x assembler-with-cpp -o "$$TMP" -,$(2),$(3)) -+ printf "%b\n" "$(1)" | $(CC) -Werror $(CLANG_FLAGS) $(KBUILD_AFLAGS) -c -x assembler-with-cpp -o "$$TMP" -,$(2),$(3)) - - # __cc-option - # Usage: MY_CFLAGS += $(call __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586) diff --git a/queue-5.4/kbuild-add-clang_flags-to-kbuild_cppflags.patch b/queue-5.4/kbuild-add-clang_flags-to-kbuild_cppflags.patch deleted file mode 100644 index a3bd448614..0000000000 --- a/queue-5.4/kbuild-add-clang_flags-to-kbuild_cppflags.patch +++ /dev/null @@ -1,53 +0,0 @@ -From a846e1c74e2c17443e84efefb632f0d759d5f6e1 Mon Sep 17 00:00:00 2001 -From: Masahiro Yamada -Date: Sun, 9 Apr 2023 23:53:57 +0900 -Subject: kbuild: add $(CLANG_FLAGS) to KBUILD_CPPFLAGS - -From: Masahiro Yamada - -commit feb843a469fb0ab00d2d23cfb9bcc379791011bb upstream. - -When preprocessing arch/*/kernel/vmlinux.lds.S, the target triple is -not passed to $(CPP) because we add it only to KBUILD_{C,A}FLAGS. - -As a result, the linker script is preprocessed with predefined macros -for the build host instead of the target. - -Assuming you use an x86 build machine, compare the following: - - $ clang -dM -E -x c /dev/null - $ clang -dM -E -x c /dev/null -target aarch64-linux-gnu - -There is no actual problem presumably because our linker scripts do not -rely on such predefined macros, but it is better to define correct ones. - -Move $(CLANG_FLAGS) to KBUILD_CPPFLAGS, so that all *.c, *.S, *.lds.S -will be processed with the proper target triple. - -[Note] -After the patch submission, we got an actual problem that needs this -commit. (CBL issue 1859) - -Link: https://github.com/ClangBuiltLinux/linux/issues/1859 -Reported-by: Tom Rini -Signed-off-by: Masahiro Yamada -Reviewed-by: Nathan Chancellor -Tested-by: Nathan Chancellor -Signed-off-by: Nathan Chancellor -Signed-off-by: Greg Kroah-Hartman ---- - Makefile | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - ---- a/Makefile -+++ b/Makefile -@@ -568,8 +568,7 @@ ifneq ($(LLVM_IAS),1) - CLANG_FLAGS += -no-integrated-as - endif - CLANG_FLAGS += -Werror=unknown-warning-option --KBUILD_CFLAGS += $(CLANG_FLAGS) --KBUILD_AFLAGS += $(CLANG_FLAGS) -+KBUILD_CPPFLAGS += $(CLANG_FLAGS) - export CLANG_FLAGS - endif - diff --git a/queue-5.4/kbuild-add-kbuild_cppflags-to-as-option-invocation.patch b/queue-5.4/kbuild-add-kbuild_cppflags-to-as-option-invocation.patch deleted file mode 100644 index c7451fc4e2..0000000000 --- a/queue-5.4/kbuild-add-kbuild_cppflags-to-as-option-invocation.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 869854f263162dc80dc632fed8db396789bdf3ab Mon Sep 17 00:00:00 2001 -From: Nathan Chancellor -Date: Tue, 6 Jun 2023 15:40:35 -0700 -Subject: kbuild: Add KBUILD_CPPFLAGS to as-option invocation - -From: Nathan Chancellor - -commit 43fc0a99906e04792786edf8534d8d58d1e9de0c upstream. - -After commit feb843a469fb ("kbuild: add $(CLANG_FLAGS) to -KBUILD_CPPFLAGS"), there is an error while building certain PowerPC -assembly files with clang: - - arch/powerpc/lib/copypage_power7.S: Assembler messages: - arch/powerpc/lib/copypage_power7.S:34: Error: junk at end of line: `0b01000' - arch/powerpc/lib/copypage_power7.S:35: Error: junk at end of line: `0b01010' - arch/powerpc/lib/copypage_power7.S:37: Error: junk at end of line: `0b01000' - arch/powerpc/lib/copypage_power7.S:38: Error: junk at end of line: `0b01010' - arch/powerpc/lib/copypage_power7.S:40: Error: junk at end of line: `0b01010' - clang: error: assembler command failed with exit code 1 (use -v to see invocation) - -as-option only uses KBUILD_AFLAGS, so after removing CLANG_FLAGS from -KBUILD_AFLAGS, there is no more '--target=' or '--prefix=' flags. As a -result of those missing flags, the host target -will be tested during as-option calls and likely fail, meaning necessary -flags may not get added when building assembly files, resulting in -errors like seen above. - -Add KBUILD_CPPFLAGS to as-option invocations to clear up the errors. -This should have been done in commit d5c8d6e0fa61 ("kbuild: Update -assembler calls to use proper flags and language target"), which -switched from using the assembler target to the assembler-with-cpp -target, so flags that affect preprocessing are passed along in all -relevant tests. as-option now mirrors cc-option. - -Fixes: feb843a469fb ("kbuild: add $(CLANG_FLAGS) to KBUILD_CPPFLAGS") -Reported-by: Linux Kernel Functional Testing -Closes: https://lore.kernel.org/CA+G9fYs=koW9WardsTtora+nMgLR3raHz-LSLr58tgX4T5Mxag@mail.gmail.com/ -Signed-off-by: Nathan Chancellor -Tested-by: Naresh Kamboju -Signed-off-by: Masahiro Yamada -Signed-off-by: Nathan Chancellor -Signed-off-by: Greg Kroah-Hartman ---- - scripts/Kbuild.include | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/scripts/Kbuild.include -+++ b/scripts/Kbuild.include -@@ -102,7 +102,7 @@ try-run = $(shell set -e; \ - # Usage: aflags-y += $(call as-option,-Wa$(comma)-isa=foo,) - - as-option = $(call try-run,\ -- $(CC) -Werror $(KBUILD_AFLAGS) $(1) -c -x assembler-with-cpp /dev/null -o "$$TMP",$(1),$(2)) -+ $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(1) -c -x assembler-with-cpp /dev/null -o "$$TMP",$(1),$(2)) - - # as-instr - # Usage: aflags-y += $(call as-instr,instr,option1,option2) diff --git a/queue-5.4/kbuild-update-assembler-calls-to-use-proper-flags-and-language-target.patch b/queue-5.4/kbuild-update-assembler-calls-to-use-proper-flags-and-language-target.patch deleted file mode 100644 index 0b9b2dd6e4..0000000000 --- a/queue-5.4/kbuild-update-assembler-calls-to-use-proper-flags-and-language-target.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 53842cd1ecb80f2347244af2a4fdfd2956e010b6 Mon Sep 17 00:00:00 2001 -From: Nick Desaulniers -Date: Wed, 11 Jan 2023 20:05:01 -0700 -Subject: kbuild: Update assembler calls to use proper flags and language target - -From: Nick Desaulniers - -commit d5c8d6e0fa61401a729e9eb6a9c7077b2d3aebb0 upstream. - -as-instr uses KBUILD_AFLAGS, but as-option uses KBUILD_CFLAGS. This can -cause as-option to fail unexpectedly when CONFIG_WERROR is set, because -clang will emit -Werror,-Wunused-command-line-argument for various -m -and -f flags in KBUILD_CFLAGS for assembler sources. - -Callers of as-option and as-instr should be adding flags to -KBUILD_AFLAGS / aflags-y, not KBUILD_CFLAGS / cflags-y. Use -KBUILD_AFLAGS in all macros to clear up the initial problem. - -Unfortunately, -Wunused-command-line-argument can still be triggered -with clang by the presence of warning flags or macro definitions because -'-x assembler' is used, instead of '-x assembler-with-cpp', which will -consume these flags. Switch to '-x assembler-with-cpp' in places where -'-x assembler' is used, as the compiler is always used as the driver for -out of line assembler sources in the kernel. - -Finally, add -Werror to these macros so that they behave consistently -whether or not CONFIG_WERROR is set. - -[nathan: Reworded and expanded on problems in commit message - Use '-x assembler-with-cpp' in a couple more places] - -Link: https://github.com/ClangBuiltLinux/linux/issues/1699 -Suggested-by: Masahiro Yamada -Signed-off-by: Nick Desaulniers -Signed-off-by: Nathan Chancellor -Tested-by: Linux Kernel Functional Testing -Tested-by: Anders Roxell -Signed-off-by: Masahiro Yamada -Signed-off-by: Nathan Chancellor -Signed-off-by: Greg Kroah-Hartman ---- - scripts/Kbuild.include | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- a/scripts/Kbuild.include -+++ b/scripts/Kbuild.include -@@ -99,16 +99,16 @@ try-run = $(shell set -e; \ - fi) - - # as-option --# Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,) -+# Usage: aflags-y += $(call as-option,-Wa$(comma)-isa=foo,) - - as-option = $(call try-run,\ -- $(CC) $(KBUILD_CFLAGS) $(1) -c -x assembler /dev/null -o "$$TMP",$(1),$(2)) -+ $(CC) -Werror $(KBUILD_AFLAGS) $(1) -c -x assembler-with-cpp /dev/null -o "$$TMP",$(1),$(2)) - - # as-instr --# Usage: cflags-y += $(call as-instr,instr,option1,option2) -+# Usage: aflags-y += $(call as-instr,instr,option1,option2) - - as-instr = $(call try-run,\ -- printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3)) -+ printf "%b\n" "$(1)" | $(CC) -Werror $(KBUILD_AFLAGS) -c -x assembler-with-cpp -o "$$TMP" -,$(2),$(3)) - - # __cc-option - # Usage: MY_CFLAGS += $(call __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586) diff --git a/queue-5.4/mips-include-kbuild_cppflags-in-checkflags-invocation.patch b/queue-5.4/mips-include-kbuild_cppflags-in-checkflags-invocation.patch deleted file mode 100644 index 077d75136e..0000000000 --- a/queue-5.4/mips-include-kbuild_cppflags-in-checkflags-invocation.patch +++ /dev/null @@ -1,38 +0,0 @@ -From ee72d68bba47e0a0f045ff33638601ef7ec14260 Mon Sep 17 00:00:00 2001 -From: Nathan Chancellor -Date: Thu, 1 Jun 2023 11:38:24 -0700 -Subject: mips: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation - -From: Nathan Chancellor - -commit 08f6554ff90ef189e6b8f0303e57005bddfdd6a7 upstream. - -A future change will move CLANG_FLAGS from KBUILD_{A,C}FLAGS to -KBUILD_CPPFLAGS so that '--target' is available while preprocessing. -When that occurs, the following error appears when building ARCH=mips -with clang (tip of tree error shown): - - clang: error: unsupported option '-mabi=' for target 'x86_64-pc-linux-gnu' - -Add KBUILD_CPPFLAGS in the CHECKFLAGS invocation to keep everything -working after the move. - -Signed-off-by: Nathan Chancellor -Signed-off-by: Masahiro Yamada -Signed-off-by: Nathan Chancellor -Signed-off-by: Greg Kroah-Hartman ---- - arch/mips/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/mips/Makefile -+++ b/arch/mips/Makefile -@@ -319,7 +319,7 @@ KBUILD_CFLAGS += -fno-asynchronous-unwin - KBUILD_LDFLAGS += -m $(ld-emul) - - ifdef CONFIG_MIPS --CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \ -+CHECKFLAGS += $(shell $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \ - egrep -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \ - sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g') - endif diff --git a/queue-5.4/series b/queue-5.4/series index 9c791ca9bc..b77380246f 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -84,12 +84,7 @@ net_sched-tbf-fix-a-race-in-tbf_change.patch net-mdio-c22-is-now-optional-eopnotsupp-if-not-provi.patch x86-boot-compressed-prefer-cc-option-for-cflags-additions.patch mips-move-wa-msoft-float-check-from-as-option-to-cc-option.patch -kbuild-update-assembler-calls-to-use-proper-flags-and-language-target.patch drm-amd-display-do-not-add-mhard-float-to-dml_ccflags-for-clang.patch -mips-include-kbuild_cppflags-in-checkflags-invocation.patch -kbuild-add-clang_flags-to-as-instr.patch -kbuild-add-clang_flags-to-kbuild_cppflags.patch -kbuild-add-kbuild_cppflags-to-as-option-invocation.patch drm-amd-display-do-not-add-mhard-float-to-dcn2-1-0-_resource.o-for-clang.patch net-mdiobus-fix-potential-out-of-bounds-read-write-a.patch fs-filesystems-fix-potential-unsigned-integer-underf.patch