]> git.baikalelectronics.ru Git - kernel.git/commit
riscv: fix detection of toolchain Zihintpause support
authorConor Dooley <conor.dooley@microchip.com>
Thu, 6 Oct 2022 17:35:21 +0000 (18:35 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 27 Oct 2022 22:13:06 +0000 (15:13 -0700)
commit5148530c9493249f098414678f3c64d131a8c455
tree93c3b45399e77552e941e87c1c21ad5bddcddb40
parent439793cba207a74438730f7257238f6908596fc4
riscv: fix detection of toolchain Zihintpause support

It is not sufficient to check if a toolchain supports a particular
extension without checking if the linker supports that extension
too. For example, Clang 15 supports Zihintpause but GNU bintutils
2.35.2 does not, leading build errors like so:

riscv64-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_c2p0_zihintpause2p0: Invalid or unknown z ISA extension: 'zihintpause'

Add a TOOLCHAIN_HAS_ZIHINTPAUSE which checks if each of the compiler,
assembler and linker support the extension. Replace the ifdef in the
vdso with one depending on this new symbol.

Fixes: 2f888089acfd ("arch/riscv: add Zihintpause support")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20221006173520.1785507-3-conor@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/Kconfig
arch/riscv/Makefile
arch/riscv/include/asm/vdso/processor.h