nathanchance · GitHub

After llvm/llvm-project@ 22e199e , RISC-V builds using GNU binutils older than 2.36 (i.e., current Debian stable, which is what TuxSuite uses) fail with:

riscv64-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_c2p0_zicsr2p0_zifencei2p0: Invalid or unknown z ISA extension: 'zifencei'
riscv64-linux-gnu-ld: failed to merge target specific data of file fs/efivarfs/file.o
riscv64-linux-gnu-ld: -march=rv64i2p0_m2p0_a2p0_c2p0_zicsr2p0_zifencei2p0: Invalid or unknown z ISA extension: 'zifencei'
riscv64-linux-gnu-ld: failed to merge target specific data of file fs/efivarfs/super.o

https://storage.tuxsuite.com/public/clangbuiltlinux/continuous-integration2/builds/2M5r1HzVI5BhnbtCzitcWytFr0q/build.log
https://lore.kernel.org/CA+G9fYt9T=ELCLaB9byxaLW2Qf4pZcDO=huCA0D8ug2V2+irJQ@mail.gmail.com/

It seems like we will need something similar to https://git.kernel.org/linus/b8c86872d1dc171d8f1c137917d6913cae2fa4f2 for zicsr and zifencei but @ConchuOD mentioned upstream we might need some additional handling depending on the ISA specification.

cc @asb, I do not really think there is much that LLVM can do about this since the assembling/compiling stage is distinct from the linking one in the kernel, so we will just have to make sure all the tools support the same ISA extension before using it. However, I did not want a repeat of #1777, hence the ping.

Read the original on github.com ↗