* [PATCH v1 2/2] RISC-V: make TOOLCHAIN_NEEDS_SPEC_20191213 gas only
[not found] <20230223220546.52879-1-conor@kernel.org>
@ 2023-02-23 22:05 ` Conor Dooley
2023-02-24 16:32 ` Nathan Chancellor
0 siblings, 1 reply; 2+ messages in thread
From: Conor Dooley @ 2023-02-23 22:05 UTC (permalink / raw)
To: palmer
Cc: conor, Conor Dooley, nathan, naresh.kamboju, linux-riscv, llvm,
stable
From: Conor Dooley <conor.dooley@microchip.com>
Quoting the llvm docs:
> Between versions 2.0 and 2.1 of the base I specification, a backwards
> incompatible change was made to remove selected instructions and CSRs
> from the base ISA. These instructions were grouped into a set of new
> extensions, but were no longer required by the base ISA. (snip) LLVM
> currently implements version 2.0 of the base specification. Thus,
> instructions from these extensions are accepted as part of the base
> ISA.
There is therefore no need (at present!) to carry out a $cc-option
check, and instead just gate presence of zicsr and zifencei in march
on the version of binutils that commit 6df2a016c0c8 ("riscv: fix build
with binutils 2.38") highlights as the introduction of the requirement.
In fact, the status quo creates some issues with mixed llvm/binutils
builds, specifically building with llvm-17 and ld from binutils-2.35.
Odd combo you may think, but this is what tuxsuite's debian stable uses
while testing 5.10 stable kernels as doesn't support LLD.
CC: stable@vger.kernel.org # needs RISC-V: move zicsr/zifencei spec version check to Kconfi
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Link: https://lore.kernel.org/all/CA+G9fYt9T=ELCLaB9byxaLW2Qf4pZcDO=huCA0D8ug2V2+irJQ@mail.gmail.com/
Suggested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
arch/riscv/Kconfig | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 4eb0ef8314b3..c6902f4c5650 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -291,8 +291,7 @@ endchoice
config TOOLCHAIN_NEEDS_SPEC_20191213
bool
default y
- depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zicsr_zifencei)
- depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zicsr_zifencei)
+ depends on AS_IS_GNU && AS_VERSION >= 23800
help
Newer binutils versions default to ISA spec version 20191213 which
moves some instructions from the I extension to the Zicsr and Zifencei
--
2.39.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1 2/2] RISC-V: make TOOLCHAIN_NEEDS_SPEC_20191213 gas only
2023-02-23 22:05 ` [PATCH v1 2/2] RISC-V: make TOOLCHAIN_NEEDS_SPEC_20191213 gas only Conor Dooley
@ 2023-02-24 16:32 ` Nathan Chancellor
0 siblings, 0 replies; 2+ messages in thread
From: Nathan Chancellor @ 2023-02-24 16:32 UTC (permalink / raw)
To: Conor Dooley
Cc: palmer, Conor Dooley, naresh.kamboju, linux-riscv, llvm, stable
Hi Conor,
On Thu, Feb 23, 2023 at 10:05:46PM +0000, Conor Dooley wrote:
> From: Conor Dooley <conor.dooley@microchip.com>
>
> Quoting the llvm docs:
> > Between versions 2.0 and 2.1 of the base I specification, a backwards
> > incompatible change was made to remove selected instructions and CSRs
> > from the base ISA. These instructions were grouped into a set of new
> > extensions, but were no longer required by the base ISA. (snip) LLVM
> > currently implements version 2.0 of the base specification. Thus,
> > instructions from these extensions are accepted as part of the base
> > ISA.
>
> There is therefore no need (at present!) to carry out a $cc-option
> check, and instead just gate presence of zicsr and zifencei in march
> on the version of binutils that commit 6df2a016c0c8 ("riscv: fix build
> with binutils 2.38") highlights as the introduction of the requirement.
>
> In fact, the status quo creates some issues with mixed llvm/binutils
> builds, specifically building with llvm-17 and ld from binutils-2.35.
> Odd combo you may think, but this is what tuxsuite's debian stable uses
> while testing 5.10 stable kernels as doesn't support LLD.
>
> CC: stable@vger.kernel.org # needs RISC-V: move zicsr/zifencei spec version check to Kconfi
I think it would be better to drop this comment and just mark patch 1
for stable directly. However, if it remains, 'Kconfi' -> 'Kconfig' :)
> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> Link: https://lore.kernel.org/all/CA+G9fYt9T=ELCLaB9byxaLW2Qf4pZcDO=huCA0D8ug2V2+irJQ@mail.gmail.com/
> Suggested-by: Nathan Chancellor <nathan@kernel.org>
> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Thanks for helping getting down to the bottom of this!
> ---
> arch/riscv/Kconfig | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 4eb0ef8314b3..c6902f4c5650 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -291,8 +291,7 @@ endchoice
> config TOOLCHAIN_NEEDS_SPEC_20191213
> bool
> default y
> - depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zicsr_zifencei)
> - depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zicsr_zifencei)
> + depends on AS_IS_GNU && AS_VERSION >= 23800
> help
> Newer binutils versions default to ISA spec version 20191213 which
> moves some instructions from the I extension to the Zicsr and Zifencei
> --
> 2.39.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-24 16:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20230223220546.52879-1-conor@kernel.org>
2023-02-23 22:05 ` [PATCH v1 2/2] RISC-V: make TOOLCHAIN_NEEDS_SPEC_20191213 gas only Conor Dooley
2023-02-24 16:32 ` Nathan Chancellor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).