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

README suggestion #14

Open wasd003 opened 1 year ago

wasd003 commented 1 year ago

I'm trying to use riscv toolchain to compile this project, but encouter following error:

libgcc.a: can't link double-float modules with soft-float modules

I compiled my toolchain using riscv-gnu-toolchain: 2023.06.09 with default configuration. It turns out that the ABI in libgcc.a was set to double-float, whereas the Makefile specified soft-float.

I strongly recommend that the README include instructions for configuring the riscv-gnu-toolchain compilation settings. Below is the configuration that allowed me to successfully compile this repository.

./configure --prefix=${RISCV_TOOLCHAIN_PATH} --disable-multilib --with-cmodel=medany --with-arch=rv64i --with-abi=lp64

Moreover, I also modified Makefile from (1) to (2) to support zicsr

GENERIC_FLAGS += -march=rv64imac -mabi=lp64 -g3 -mcmodel=medany -O3 $(inc_dirs) (1)
GENERIC_FLAGS += -march=rv64imac_zicsr -mabi=lp64 -g3 -mcmodel=medany -O3 $(inc_dirs) (2)

It would be helpful if the README included the above information to assist others in leveraging the repository smoothly.

josecm commented 1 year ago

Thanks for the suggestions @wasd003. I don't have much time to maintain this repo, but if you send your suggestions as a PR, I'll gladly accept it.

robert-hz commented 9 months ago

@wasd003 , I encountered same issue, your info is helpful to me, thanks. BTW, have you any idea on configuration on riscv-gnu-toolchain for this riscv-hyp-tests Makefile like this, i.e. to use mabi of lp64d:

ifdef GCCVERSION GENERIC_FLAGS += -march=rv64imafdc_zicsr else GENERIC_FLAGS += -march=rv64imafdc endif