aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/Makefile
diff options
context:
space:
mode:
authorPalmer Dabbelt2023-02-23 14:46:05 -0800
committerGreg Kroah-Hartman2023-03-17 08:50:14 +0100
commit1c39d126b51b31c14a0a33393ae49b20ca0c571c (patch)
tree23bb4f614d244de5640420e6c26b6aa02f1da55b /arch/riscv/Makefile
parent120f7a92871988bf0ced8d6c0b50b93a74f17639 (diff)
RISC-V: Stop emitting attributes
commit e18048da9bc3f87acef4eb67a11b4fc55fe15424 upstream. The RISC-V ELF attributes don't contain any useful information. New toolchains ignore them, but they frequently trip up various older/mixed toolchains. So just turn them off. Tested-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20230223224605.6995-1-palmer@rivosinc.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/riscv/Makefile')
-rw-r--r--arch/riscv/Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index ba8050e63acf..8b4ddccea279 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -87,6 +87,13 @@ endif
# Avoid generating .eh_frame sections.
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables
+# The RISC-V attributes frequently cause compatibility issues and provide no
+# information, so just turn them off.
+KBUILD_CFLAGS += $(call cc-option,-mno-riscv-attribute)
+KBUILD_AFLAGS += $(call cc-option,-mno-riscv-attribute)
+KBUILD_CFLAGS += $(call as-option,-Wa$(comma)-mno-arch-attr)
+KBUILD_AFLAGS += $(call as-option,-Wa$(comma)-mno-arch-attr)
+
KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-relax)
KBUILD_AFLAGS_MODULE += $(call as-option,-Wa$(comma)-mno-relax)