[PATCH v2 09/12] riscv: Remove ld.lld version checks from many TOOLCHAIN_HAS configs

Nathan Chancellor posted 12 patches 1 month, 1 week ago
[PATCH v2 09/12] riscv: Remove ld.lld version checks from many TOOLCHAIN_HAS configs
Posted by Nathan Chancellor 1 month, 1 week ago
Now that the minimum supported version of LLVM for building the kernel
has been bumped to 15.0.0, several ld.lld version checks become
tautological, as they are always true. Replace them with a simple
CONFIG_LD_IS_LLD check.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: linux-riscv@lists.infradead.org
---
 arch/riscv/Kconfig | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index d482236e93f4..850ba4b4b534 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -620,7 +620,7 @@ config TOOLCHAIN_HAS_V
 	default y
 	depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64imv)
 	depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32imv)
-	depends on LLD_VERSION >= 140000 || LD_VERSION >= 23800
+	depends on LD_IS_LLD || LD_VERSION >= 23800
 	depends on AS_HAS_OPTION_ARCH
 
 config RISCV_ISA_V
@@ -721,7 +721,7 @@ config TOOLCHAIN_HAS_ZBB
 	default y
 	depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbb)
 	depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbb)
-	depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
+	depends on LD_IS_LLD || LD_VERSION >= 23900
 	depends on AS_HAS_OPTION_ARCH
 
 # This symbol indicates that the toolchain supports all v1.0 vector crypto
@@ -736,7 +736,7 @@ config TOOLCHAIN_HAS_ZBA
 	default y
 	depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zba)
 	depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zba)
-	depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
+	depends on LD_IS_LLD || LD_VERSION >= 23900
 	depends on AS_HAS_OPTION_ARCH
 
 config RISCV_ISA_ZBA
@@ -771,7 +771,7 @@ config TOOLCHAIN_HAS_ZBC
 	default y
 	depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbc)
 	depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbc)
-	depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
+	depends on LD_IS_LLD || LD_VERSION >= 23900
 	depends on AS_HAS_OPTION_ARCH
 
 config RISCV_ISA_ZBC
@@ -794,7 +794,7 @@ config TOOLCHAIN_HAS_ZBKB
 	default y
 	depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbkb)
 	depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbkb)
-	depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
+	depends on LD_IS_LLD || LD_VERSION >= 23900
 	depends on AS_HAS_OPTION_ARCH
 
 config RISCV_ISA_ZBKB

-- 
2.50.1
Re: [PATCH v2 09/12] riscv: Remove ld.lld version checks from many TOOLCHAIN_HAS configs
Posted by Conor Dooley 1 month, 1 week ago
On Thu, Aug 21, 2025 at 02:15:46PM -0700, Nathan Chancellor wrote:
> Now that the minimum supported version of LLVM for building the kernel
> has been bumped to 15.0.0, several ld.lld version checks become
> tautological, as they are always true. Replace them with a simple
> CONFIG_LD_IS_LLD check.
> 
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Re: [PATCH v2 09/12] riscv: Remove ld.lld version checks from many TOOLCHAIN_HAS configs
Posted by Alexandre Ghiti 1 month, 1 week ago
On 8/21/25 23:15, Nathan Chancellor wrote:
> Now that the minimum supported version of LLVM for building the kernel
> has been bumped to 15.0.0, several ld.lld version checks become
> tautological, as they are always true. Replace them with a simple
> CONFIG_LD_IS_LLD check.
>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> Cc: Palmer Dabbelt <palmer@dabbelt.com>
> Cc: Alexandre Ghiti <alex@ghiti.fr>
> Cc: linux-riscv@lists.infradead.org
> ---
>   arch/riscv/Kconfig | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index d482236e93f4..850ba4b4b534 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -620,7 +620,7 @@ config TOOLCHAIN_HAS_V
>   	default y
>   	depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64imv)
>   	depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32imv)
> -	depends on LLD_VERSION >= 140000 || LD_VERSION >= 23800
> +	depends on LD_IS_LLD || LD_VERSION >= 23800
>   	depends on AS_HAS_OPTION_ARCH
>   
>   config RISCV_ISA_V
> @@ -721,7 +721,7 @@ config TOOLCHAIN_HAS_ZBB
>   	default y
>   	depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbb)
>   	depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbb)
> -	depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
> +	depends on LD_IS_LLD || LD_VERSION >= 23900
>   	depends on AS_HAS_OPTION_ARCH
>   
>   # This symbol indicates that the toolchain supports all v1.0 vector crypto
> @@ -736,7 +736,7 @@ config TOOLCHAIN_HAS_ZBA
>   	default y
>   	depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zba)
>   	depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zba)
> -	depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
> +	depends on LD_IS_LLD || LD_VERSION >= 23900
>   	depends on AS_HAS_OPTION_ARCH
>   
>   config RISCV_ISA_ZBA
> @@ -771,7 +771,7 @@ config TOOLCHAIN_HAS_ZBC
>   	default y
>   	depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbc)
>   	depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbc)
> -	depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
> +	depends on LD_IS_LLD || LD_VERSION >= 23900
>   	depends on AS_HAS_OPTION_ARCH
>   
>   config RISCV_ISA_ZBC
> @@ -794,7 +794,7 @@ config TOOLCHAIN_HAS_ZBKB
>   	default y
>   	depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbkb)
>   	depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbkb)
> -	depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
> +	depends on LD_IS_LLD || LD_VERSION >= 23900
>   	depends on AS_HAS_OPTION_ARCH
>   
>   config RISCV_ISA_ZBKB
>

Acked-by: Alexandre Ghiti <alexghiti@rivosinc.com>

Thanks for the v2!

Alex