aboutsummaryrefslogtreecommitdiffstats
path: root/arch/riscv
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2025-08-21 14:15:45 -0700
committerNathan Chancellor <nathan@kernel.org>2025-08-28 16:58:45 -0700
commit7ccbe91796d7bb584a00833cb59ef7d4575ba784 (patch)
treed420aae7f17e63210f44cc01fb8ea15cdeb6e765 /arch/riscv
parent6578a1ff6aa49034489c2701502d1969e6bf12a7 (diff)
downloadlinux-7ccbe91796d7bb584a00833cb59ef7d4575ba784.tar.gz
riscv: Unconditionally use linker relaxation
Now that the minimum supported version of LLVM for building the kernel has been bumped to 15.0.0, CONFIG_RISCV_USE_LINKER_RELAXATION will always be enabled, so it can be removed. Acked-by: Alexandre Ghiti <alexghiti@rivosinc.com> Link: https://lore.kernel.org/r/20250821-bump-min-llvm-ver-15-v2-8-635f3294e5f0@kernel.org Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Diffstat (limited to 'arch/riscv')
-rw-r--r--arch/riscv/Kconfig6
-rw-r--r--arch/riscv/Makefile9
2 files changed, 1 insertions, 14 deletions
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 1d53bf02d0fac3..d482236e93f402 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -246,15 +246,9 @@ config HAVE_SHADOW_CALL_STACK
# https://github.com/riscv-non-isa/riscv-elf-psabi-doc/commit/a484e843e6eeb51f0cb7b8819e50da6d2444d769
depends on $(ld-option,--no-relax-gp)
-config RISCV_USE_LINKER_RELAXATION
- def_bool y
- # https://github.com/llvm/llvm-project/commit/6611d58f5bbcbec77262d392e2923e1d680f6985
- depends on !LD_IS_LLD || LLD_VERSION >= 150000
-
# https://github.com/llvm/llvm-project/commit/bbc0f99f3bc96f1db16f649fc21dd18e5b0918f6
config ARCH_HAS_BROKEN_DWARF5
def_bool y
- depends on RISCV_USE_LINKER_RELAXATION
# https://github.com/llvm/llvm-project/commit/1df5ea29b43690b6622db2cad7b745607ca4de6a
depends on AS_IS_LLVM && AS_VERSION < 180000
# https://github.com/llvm/llvm-project/commit/7ffabb61a5569444b5ac9322e22e5471cc5e4a77
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index df57654a615e00..ecf2fcce2d923b 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -46,17 +46,10 @@ else
KBUILD_LDFLAGS += -melf32lriscv
endif
-ifndef CONFIG_RISCV_USE_LINKER_RELAXATION
- KBUILD_CFLAGS += -mno-relax
- KBUILD_AFLAGS += -mno-relax
-ifndef CONFIG_AS_IS_LLVM
- KBUILD_CFLAGS += -Wa,-mno-relax
- KBUILD_AFLAGS += -Wa,-mno-relax
-endif
# LLVM has an issue with target-features and LTO: https://github.com/llvm/llvm-project/issues/59350
# Ensure it is aware of linker relaxation with LTO, otherwise relocations may
# be incorrect: https://github.com/llvm/llvm-project/issues/65090
-else ifeq ($(CONFIG_LTO_CLANG),y)
+ifeq ($(CONFIG_LTO_CLANG),y)
KBUILD_LDFLAGS += -mllvm -mattr=+c -mllvm -mattr=+relax
endif