josecm / riscv-hyp-tests

A bare-metal application to test specific features of the risc-v hypervisor extension
GNU General Public License v3.0
36 stars 22 forks source link

Add Makefile condition to add '_zicsr' to -march for GCC versions >10 #8

Closed autley closed 1 year ago

autley commented 1 year ago

In versions of RISC-V gcc greater than 10, instructions such as csrwi are grouped separately under the zicsr extension and need to be specified explicitly by appending '_zicsr' string to the -march parameter of gcc. This commit adds a condition to the Makefile to detect if the GCC version is greater than 10 and automatically add the suffix.

on-behalf-of: @ventanamicro autley@ventanamicro.com

josecm commented 1 year ago

@autley I'd like to reproduce the issue. However, I'm still using a 10.2 toolchain indeed. Are you building the latest toolchain from source or getting some specific distribution? If so, could you point me to it?

autley commented 1 year ago

My work environment has riscv64-unknown-elf-gcc version 12.2.1 20220914 installed, which I believe our IT department built locally from source.

defermelowie commented 1 year ago

Same issue with riscv64-unknown-elf-gcc version 12.2.0