[Compile error] Invalid or unknown z ISA extension: 'zvl'

294 views
Skip to first unread message

Yong Pan

unread,
Feb 8, 2022, 10:20:01 PM2/8/22
to RISC-V SW Dev
Hi everyone,

I want to consult a question about the alignment between LLVM and RISC-V GNU Toolchain.

I used 'LLVM + RISC-V GNU Toolchain' to cross-compile my RISC-V project. I mean use Clang/LLVM's frontend/codegen, and use RISC-V GNU Toolchain's lib/linker/etc. It worked well before.

But I meet some issue with recent version's LLVM. In Jan. 23rd, it seems that "V" extension has been removed from experimental tag, and officially added to official tag. So I change my compiling option as below to align this update.

Old command:
clang --gcc-toolchain=./riscv --sysroot=./riscv/riscv64-unknown-elf -mcmodel=medany -g -mabi=lp64f -march=ev64gcv0p10 -menable-experimental-extensions -Wall rvv_intrinsic.c -o rvv_intrinsic

New command:
clang --gcc-toolchain=./riscv --sysroot=./riscv/riscv64-unknown-elf -mcmodel=medany -g -mabi=lp64f -march=rv64gcv -Wall rvv_intrinsic.c -o rvv_intrinsic

Then I meet one error as below,
./riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: -march=rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0_v1p0_zvl128b1p0_zvl32b1p0_zvl64b1p0: Invalid or unknown z ISA extension: 'zvl'

I guess the reason is that in llvm, the if I add 'v' in -march, 'zvl' is used, but in RISC-V GNU Toolchain, this extension has not been supported.

How I can resolve this issue? Maybe I used wrong option?

Thanks

Best Regards
Yong


Jim Wilson

unread,
Feb 9, 2022, 11:06:55 PM2/9/22
to Yong Pan, RISC-V SW Dev
On Tue, Feb 8, 2022 at 7:20 PM Yong Pan <panyo...@gmail.com> wrote:
New command:
clang --gcc-toolchain=./riscv --sysroot=./riscv/riscv64-unknown-elf -mcmodel=medany -g -mabi=lp64f -march=rv64gcv -Wall rvv_intrinsic.c -o rvv_intrinsic

Then I meet one error as below,
./riscv/lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: -march=rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0_v1p0_zvl128b1p0_zvl32b1p0_zvl64b1p0: Invalid or unknown z ISA extension: 'zvl'

The V extension was only just ratified late last year.  It will take time for all tools to properly support it, especially for the late changes made to the standard shortly before it was ratified.  This is one of the late changes.  Binutils does support the zvl extensions now, but only the very latest release will have it, i.e. binutils-2.38 which was just released today.  Before that vector support was on a branch and not part of FSF release.  I don't know if we have checked llvm/gnu compatibility yet, so we might need some bug fixes if there are issues.  It will be a while before the toolchain vector support will be stable.

Jim

Reply all
Reply to author
Forward
0 new messages