On Sun, Jul 30, 2023 at 01:36:49AM +0800, Mingzheng Xing wrote:
I reproduced the error with gcc-12.2.0 and binutils-2.35. I tried a different solution, which I think makes the logic easier. Showing the new patch code:
It is indeed simpler, neat.
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 4c07b9189c86..a6fa1eed895c 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -569,25 +569,24 @@ config TOOLCHAIN_HAS_ZIHINTPAUSE
config TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI def_bool y - # https://sourceware.org/git/?p=binutils-gdb.git%3Ba=commit%3Bh=aed44286efa8ae... - depends on AS_IS_GNU && AS_VERSION >= 23800 + depends on AS_IS_GNU && AS_VERSION >= 23600 help - Newer binutils versions default to ISA spec version 20191213 which - moves some instructions from the I extension to the Zicsr and Zifencei - extensions. + Binutils has supported zicsr and zifencei extensions since version 2.36, + try to adapt to the changes by using explicit zicsr and zifencei via + -march.
This sentence no longer makes sense to me, the motivation for why we are doing this is lost. Please preserve the link & explanation about the 20191213 version of the spec, adding to it the commentary about how we can relax the check to 2.36, since that makes our lives easier.
The rest of this looks fine to me, if you resubmit I'll look at it further on Monday.