Skip to content

Commit ef21fa7

Browse files
xmzzzpalmer-dabbelt
authored andcommitted
riscv: Fix build errors using binutils2.37 toolchains
When building the kernel with binutils 2.37 and GCC-11.1.0/GCC-11.2.0, the following error occurs: Assembler messages: Error: cannot find default versions of the ISA extension `zicsr' Error: cannot find default versions of the ISA extension `zifencei' The above error originated from this commit of binutils[0], which has been resolved and backported by GCC-12.1.0[1] and GCC-11.3.0[2]. So fix this by change the GCC version in CONFIG_TOOLCHAIN_NEEDS_OLD_ISA_SPEC to GCC-11.3.0. Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=f0bae2552db1dd4f1995608fbf6648fcee4e9e0c [0] Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=ca2bbb88f999f4d3cc40e89bc1aba712505dd598 [1] Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d29f5d6ab513c52fd872f532c492e35ae9fd6671 [2] Fixes: ca09f77 ("riscv: Handle zicsr/zifencei issue between gcc and binutils") Reported-by: Conor Dooley <conor.dooley@microchip.com> Cc: <stable@vger.kernel.org> Signed-off-by: Mingzheng Xing <xingmingzheng@iscas.ac.cn> Link: https://lore.kernel.org/r/20230824190852.45470-1-xingmingzheng@iscas.ac.cn Closes: https://lore.kernel.org/all/20230823-captive-abdomen-befd942a4a73@wendy/ Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Tested-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent e2de164 commit ef21fa7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/riscv/Kconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -580,15 +580,15 @@ config TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
580580
and Zifencei are supported in binutils from version 2.36 onwards.
581581
To make life easier, and avoid forcing toolchains that default to a
582582
newer ISA spec to version 2.2, relax the check to binutils >= 2.36.
583-
For clang < 17 or GCC < 11.1.0, for which this is not possible, this is
584-
dealt with in CONFIG_TOOLCHAIN_NEEDS_OLD_ISA_SPEC.
583+
For clang < 17 or GCC < 11.3.0, for which this is not possible or need
584+
special treatment, this is dealt with in TOOLCHAIN_NEEDS_OLD_ISA_SPEC.
585585

586586
config TOOLCHAIN_NEEDS_OLD_ISA_SPEC
587587
def_bool y
588588
depends on TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
589589
# https://github.com/llvm/llvm-project/commit/22e199e6afb1263c943c0c0d4498694e15bf8a16
590-
# https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b03be74bad08c382da47e048007a78fa3fb4ef49
591-
depends on (CC_IS_CLANG && CLANG_VERSION < 170000) || (CC_IS_GCC && GCC_VERSION < 110100)
590+
# https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d29f5d6ab513c52fd872f532c492e35ae9fd6671
591+
depends on (CC_IS_CLANG && CLANG_VERSION < 170000) || (CC_IS_GCC && GCC_VERSION < 110300)
592592
help
593593
Certain versions of clang and GCC do not support zicsr and zifencei via
594594
-march. This option causes an older ISA spec compatible with these older

0 commit comments

Comments
 (0)