Closed starnight closed 1 year ago
I use riscv64-elf-gcc as the compiler, which is built from the upstream source.
Here lists the supported architectures:
$ riscv64-elf-gcc --print-multi-lib
.;
rv32i/ilp32;@march=rv32i@mabi=ilp32
rv32im/ilp32;@march=rv32im@mabi=ilp32
rv32iac/ilp32;@march=rv32iac@mabi=ilp32
rv32imac/ilp32;@march=rv32imac@mabi=ilp32
rv32imafc/ilp32f;@march=rv32imafc@mabi=ilp32f
rv64imac/lp64;@march=rv64imac@mabi=lp64
rv64imafdc/lp64d;@march=rv64imafdc@mabi=lp64d
You need to set default isa spec to 2.2, see here https://github.com/riscv-collab/riscv-gnu-toolchain#set-default-isa-spec-version
or add -misa-spec=2.2
when compile application, you can add it here https://github.com/Nuclei-Software/nuclei-sdk/blob/56f4572b80325980f0faa16e76c608243a1fd36f/Build/Makefile.conf#L203
COMMON_FLAGS += -g -misa-spec=2.2
This will only for gcc12 and later version, will not be compatiable with previous gcc10
Thanks for @fanghuaqi's reply! It solves the issue.
When I build the example application with upstream RISC-V toolchain (12.2.0) for Longan Nano equipped with GD32VF103C8T6, it will show the error: