From: Sasha Levin Date: Wed, 13 Mar 2024 14:58:14 +0000 (-0400) Subject: Drop um-fix-adding-no-pie-for-clang.patch from older trees X-Git-Tag: v6.8.1~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3413e2f452793cee7855207083a8ea003ef85ad1;p=thirdparty%2Fkernel%2Fstable-queue.git Drop um-fix-adding-no-pie-for-clang.patch from older trees --- diff --git a/queue-4.19/series b/queue-4.19/series index 727b4df6a9a..6da763d9197 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -25,7 +25,6 @@ btrfs-ref-verify-free-ref-cache-before-clearing-moun.patch tools-selftest-vm-allow-choosing-mem-size-and-page-s.patch selftests-mm-fix-map_hugetlb-failure-on-64k-page-siz.patch um-allow-not-setting-extra-rpaths-in-the-linux-binar.patch -um-fix-adding-no-pie-for-clang.patch input-i8042-fix-strange-behavior-of-touchpad-on-clev.patch hv_netvsc-make-netvsc-vf-binding-check-both-mac-and-.patch hv_netvsc-use-netif_is_bond_master-instead-of-open-c.patch diff --git a/queue-4.19/um-fix-adding-no-pie-for-clang.patch b/queue-4.19/um-fix-adding-no-pie-for-clang.patch deleted file mode 100644 index a55a744d1af..00000000000 --- a/queue-4.19/um-fix-adding-no-pie-for-clang.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 639b65dc8b8fa707d56b378ab98e284a9bd12ad0 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 23 Jan 2024 15:59:54 -0700 -Subject: um: Fix adding '-no-pie' for clang - -From: Nathan Chancellor - -[ Upstream commit 846cfbeed09b45d985079a9173cf390cc053715b ] - -The kernel builds with -fno-PIE, so commit 883354afbc10 ("um: link -vmlinux with -no-pie") added the compiler linker flag '-no-pie' via -cc-option because '-no-pie' was only supported in GCC 6.1.0 and newer. - -While this works for GCC, this does not work for clang because cc-option -uses '-c', which stops the pipeline right before linking, so '-no-pie' -is unconsumed and clang warns, causing cc-option to fail just as it -would if the option was entirely unsupported: - - $ clang -Werror -no-pie -c -o /dev/null -x c /dev/null - clang-16: error: argument unused during compilation: '-no-pie' [-Werror,-Wunused-command-line-argument] - -A recent version of clang exposes this because it generates a relocation -under '-mcmodel=large' that is not supported in PIE mode: - - /usr/sbin/ld: init/main.o: relocation R_X86_64_32 against symbol `saved_command_line' can not be used when making a PIE object; recompile with -fPIE - /usr/sbin/ld: failed to set dynamic section sizes: bad value - clang: error: linker command failed with exit code 1 (use -v to see invocation) - -Remove the cc-option check altogether. It is wasteful to invoke the -compiler to check for '-no-pie' because only one supported compiler -version does not support it, GCC 5.x (as it is supported with the -minimum version of clang and GCC 6.1.0+). Use a combination of the -gcc-min-version macro and CONFIG_CC_IS_CLANG to unconditionally add -'-no-pie' with CONFIG_LD_SCRIPT_DYN=y, so that it is enabled with all -compilers that support this. Furthermore, using gcc-min-version can help -turn this back into - - LINK-$(CONFIG_LD_SCRIPT_DYN) += -no-pie - -when the minimum version of GCC is bumped past 6.1.0. - -Cc: stable@vger.kernel.org -Closes: https://github.com/ClangBuiltLinux/linux/issues/1982 -Signed-off-by: Nathan Chancellor -Signed-off-by: Masahiro Yamada -Signed-off-by: Sasha Levin ---- - arch/um/Makefile | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/arch/um/Makefile b/arch/um/Makefile -index 439edee0b2878..5ac1b16ce3c10 100644 ---- a/arch/um/Makefile -+++ b/arch/um/Makefile -@@ -119,7 +119,9 @@ archheaders: - archprepare: include/generated/user_constants.h - - LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static --LINK-$(CONFIG_LD_SCRIPT_DYN) += $(call cc-option, -no-pie) -+ifdef CONFIG_LD_SCRIPT_DYN -+LINK-$(call gcc-min-version, 60100)$(CONFIG_CC_IS_CLANG) += -no-pie -+endif - LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib - - CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \ --- -2.43.0 - diff --git a/queue-5.10/series b/queue-5.10/series index eb02355417b..3b125e409ec 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -31,7 +31,6 @@ netrom-fix-data-races-around-sysctl_net_busy_read.patch selftests-mm-switch-to-bash-from-sh.patch selftests-mm-fix-map_hugetlb-failure-on-64k-page-siz.patch um-allow-not-setting-extra-rpaths-in-the-linux-binar.patch -um-fix-adding-no-pie-for-clang.patch xhci-remove-extra-loop-in-interrupt-context.patch xhci-prevent-double-fetch-of-transfer-and-transfer-e.patch xhci-process-isoc-td-properly-when-there-was-a-trans.patch diff --git a/queue-5.10/um-fix-adding-no-pie-for-clang.patch b/queue-5.10/um-fix-adding-no-pie-for-clang.patch deleted file mode 100644 index 5e2a36c6357..00000000000 --- a/queue-5.10/um-fix-adding-no-pie-for-clang.patch +++ /dev/null @@ -1,68 +0,0 @@ -From e9d85964ffc6c7b86d09408ccde4e85c228101ef Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 23 Jan 2024 15:59:54 -0700 -Subject: um: Fix adding '-no-pie' for clang - -From: Nathan Chancellor - -[ Upstream commit 846cfbeed09b45d985079a9173cf390cc053715b ] - -The kernel builds with -fno-PIE, so commit 883354afbc10 ("um: link -vmlinux with -no-pie") added the compiler linker flag '-no-pie' via -cc-option because '-no-pie' was only supported in GCC 6.1.0 and newer. - -While this works for GCC, this does not work for clang because cc-option -uses '-c', which stops the pipeline right before linking, so '-no-pie' -is unconsumed and clang warns, causing cc-option to fail just as it -would if the option was entirely unsupported: - - $ clang -Werror -no-pie -c -o /dev/null -x c /dev/null - clang-16: error: argument unused during compilation: '-no-pie' [-Werror,-Wunused-command-line-argument] - -A recent version of clang exposes this because it generates a relocation -under '-mcmodel=large' that is not supported in PIE mode: - - /usr/sbin/ld: init/main.o: relocation R_X86_64_32 against symbol `saved_command_line' can not be used when making a PIE object; recompile with -fPIE - /usr/sbin/ld: failed to set dynamic section sizes: bad value - clang: error: linker command failed with exit code 1 (use -v to see invocation) - -Remove the cc-option check altogether. It is wasteful to invoke the -compiler to check for '-no-pie' because only one supported compiler -version does not support it, GCC 5.x (as it is supported with the -minimum version of clang and GCC 6.1.0+). Use a combination of the -gcc-min-version macro and CONFIG_CC_IS_CLANG to unconditionally add -'-no-pie' with CONFIG_LD_SCRIPT_DYN=y, so that it is enabled with all -compilers that support this. Furthermore, using gcc-min-version can help -turn this back into - - LINK-$(CONFIG_LD_SCRIPT_DYN) += -no-pie - -when the minimum version of GCC is bumped past 6.1.0. - -Cc: stable@vger.kernel.org -Closes: https://github.com/ClangBuiltLinux/linux/issues/1982 -Signed-off-by: Nathan Chancellor -Signed-off-by: Masahiro Yamada -Signed-off-by: Sasha Levin ---- - arch/um/Makefile | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/arch/um/Makefile b/arch/um/Makefile -index 4211e23a2f68f..81d35b1f315ae 100644 ---- a/arch/um/Makefile -+++ b/arch/um/Makefile -@@ -118,7 +118,9 @@ archprepare: - $(Q)$(MAKE) $(build)=$(HOST_DIR)/um include/generated/user_constants.h - - LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static --LINK-$(CONFIG_LD_SCRIPT_DYN) += $(call cc-option, -no-pie) -+ifdef CONFIG_LD_SCRIPT_DYN -+LINK-$(call gcc-min-version, 60100)$(CONFIG_CC_IS_CLANG) += -no-pie -+endif - LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib - - CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \ --- -2.43.0 - diff --git a/queue-5.15/series b/queue-5.15/series index a4186f6b306..34e1d23395e 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -42,7 +42,6 @@ nfp-flower-add-goto_chain_index-for-ct-entry.patch nfp-flower-add-hardware-offload-check-for-post-ct-en.patch selftests-mm-switch-to-bash-from-sh.patch selftests-mm-fix-map_hugetlb-failure-on-64k-page-siz.patch -um-fix-adding-no-pie-for-clang.patch modpost-include-.text.-in-text_sections.patch modpost-add-.ltext-and-.ltext.-to-text_sections.patch xhci-process-isoc-td-properly-when-there-was-a-trans.patch diff --git a/queue-5.15/um-fix-adding-no-pie-for-clang.patch b/queue-5.15/um-fix-adding-no-pie-for-clang.patch deleted file mode 100644 index ea92616dfa6..00000000000 --- a/queue-5.15/um-fix-adding-no-pie-for-clang.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 0332f68bfb32f980bd2385d853d957c2f9e41460 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 23 Jan 2024 15:59:54 -0700 -Subject: um: Fix adding '-no-pie' for clang - -From: Nathan Chancellor - -[ Upstream commit 846cfbeed09b45d985079a9173cf390cc053715b ] - -The kernel builds with -fno-PIE, so commit 883354afbc10 ("um: link -vmlinux with -no-pie") added the compiler linker flag '-no-pie' via -cc-option because '-no-pie' was only supported in GCC 6.1.0 and newer. - -While this works for GCC, this does not work for clang because cc-option -uses '-c', which stops the pipeline right before linking, so '-no-pie' -is unconsumed and clang warns, causing cc-option to fail just as it -would if the option was entirely unsupported: - - $ clang -Werror -no-pie -c -o /dev/null -x c /dev/null - clang-16: error: argument unused during compilation: '-no-pie' [-Werror,-Wunused-command-line-argument] - -A recent version of clang exposes this because it generates a relocation -under '-mcmodel=large' that is not supported in PIE mode: - - /usr/sbin/ld: init/main.o: relocation R_X86_64_32 against symbol `saved_command_line' can not be used when making a PIE object; recompile with -fPIE - /usr/sbin/ld: failed to set dynamic section sizes: bad value - clang: error: linker command failed with exit code 1 (use -v to see invocation) - -Remove the cc-option check altogether. It is wasteful to invoke the -compiler to check for '-no-pie' because only one supported compiler -version does not support it, GCC 5.x (as it is supported with the -minimum version of clang and GCC 6.1.0+). Use a combination of the -gcc-min-version macro and CONFIG_CC_IS_CLANG to unconditionally add -'-no-pie' with CONFIG_LD_SCRIPT_DYN=y, so that it is enabled with all -compilers that support this. Furthermore, using gcc-min-version can help -turn this back into - - LINK-$(CONFIG_LD_SCRIPT_DYN) += -no-pie - -when the minimum version of GCC is bumped past 6.1.0. - -Cc: stable@vger.kernel.org -Closes: https://github.com/ClangBuiltLinux/linux/issues/1982 -Signed-off-by: Nathan Chancellor -Signed-off-by: Masahiro Yamada -Signed-off-by: Sasha Levin ---- - arch/um/Makefile | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/arch/um/Makefile b/arch/um/Makefile -index 3dbd0e3b660ea..778c50f273992 100644 ---- a/arch/um/Makefile -+++ b/arch/um/Makefile -@@ -118,7 +118,9 @@ archprepare: - $(Q)$(MAKE) $(build)=$(HOST_DIR)/um include/generated/user_constants.h - - LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static --LINK-$(CONFIG_LD_SCRIPT_DYN) += $(call cc-option, -no-pie) -+ifdef CONFIG_LD_SCRIPT_DYN -+LINK-$(call gcc-min-version, 60100)$(CONFIG_CC_IS_CLANG) += -no-pie -+endif - LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib - - CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \ --- -2.43.0 - diff --git a/queue-5.4/series b/queue-5.4/series index 08030342a33..e3d826d00b5 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -24,7 +24,6 @@ netrom-fix-a-data-race-around-sysctl_netrom_link_fai.patch netrom-fix-data-races-around-sysctl_net_busy_read.patch selftests-mm-fix-map_hugetlb-failure-on-64k-page-siz.patch um-allow-not-setting-extra-rpaths-in-the-linux-binar.patch -um-fix-adding-no-pie-for-clang.patch serial-max310x-use-devm_clk_get_optional-to-get-the-.patch serial-max310x-try-to-get-crystal-clock-rate-from-pr.patch serial-max310x-fail-probe-if-clock-crystal-is-unstab.patch diff --git a/queue-5.4/um-fix-adding-no-pie-for-clang.patch b/queue-5.4/um-fix-adding-no-pie-for-clang.patch deleted file mode 100644 index 8437f4b407e..00000000000 --- a/queue-5.4/um-fix-adding-no-pie-for-clang.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 8ea84d1ab02214ad66ba8d958fdb4697065eb362 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 23 Jan 2024 15:59:54 -0700 -Subject: um: Fix adding '-no-pie' for clang - -From: Nathan Chancellor - -[ Upstream commit 846cfbeed09b45d985079a9173cf390cc053715b ] - -The kernel builds with -fno-PIE, so commit 883354afbc10 ("um: link -vmlinux with -no-pie") added the compiler linker flag '-no-pie' via -cc-option because '-no-pie' was only supported in GCC 6.1.0 and newer. - -While this works for GCC, this does not work for clang because cc-option -uses '-c', which stops the pipeline right before linking, so '-no-pie' -is unconsumed and clang warns, causing cc-option to fail just as it -would if the option was entirely unsupported: - - $ clang -Werror -no-pie -c -o /dev/null -x c /dev/null - clang-16: error: argument unused during compilation: '-no-pie' [-Werror,-Wunused-command-line-argument] - -A recent version of clang exposes this because it generates a relocation -under '-mcmodel=large' that is not supported in PIE mode: - - /usr/sbin/ld: init/main.o: relocation R_X86_64_32 against symbol `saved_command_line' can not be used when making a PIE object; recompile with -fPIE - /usr/sbin/ld: failed to set dynamic section sizes: bad value - clang: error: linker command failed with exit code 1 (use -v to see invocation) - -Remove the cc-option check altogether. It is wasteful to invoke the -compiler to check for '-no-pie' because only one supported compiler -version does not support it, GCC 5.x (as it is supported with the -minimum version of clang and GCC 6.1.0+). Use a combination of the -gcc-min-version macro and CONFIG_CC_IS_CLANG to unconditionally add -'-no-pie' with CONFIG_LD_SCRIPT_DYN=y, so that it is enabled with all -compilers that support this. Furthermore, using gcc-min-version can help -turn this back into - - LINK-$(CONFIG_LD_SCRIPT_DYN) += -no-pie - -when the minimum version of GCC is bumped past 6.1.0. - -Cc: stable@vger.kernel.org -Closes: https://github.com/ClangBuiltLinux/linux/issues/1982 -Signed-off-by: Nathan Chancellor -Signed-off-by: Masahiro Yamada -Signed-off-by: Sasha Levin ---- - arch/um/Makefile | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/arch/um/Makefile b/arch/um/Makefile -index 94cea8d46b222..4125bf63f5275 100644 ---- a/arch/um/Makefile -+++ b/arch/um/Makefile -@@ -118,7 +118,9 @@ archprepare: - $(Q)$(MAKE) $(build)=$(HOST_DIR)/um include/generated/user_constants.h - - LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static --LINK-$(CONFIG_LD_SCRIPT_DYN) += $(call cc-option, -no-pie) -+ifdef CONFIG_LD_SCRIPT_DYN -+LINK-$(call gcc-min-version, 60100)$(CONFIG_CC_IS_CLANG) += -no-pie -+endif - LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib - - CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \ --- -2.43.0 -