1541ultimate
1541ultimate copied to clipboard
Add "zicsr" to fix build issue
Fixes https://github.com/GideonZ/1541ultimate/issues/379, tested on a U2+L with rv32i-131023
(GCC 13.2.0) from https://github.com/stnolting/riscv-gcc-prebuilt
You shouldn't need that patch. Just use a proper toolchain.
git clone https://github.com/riscv/riscv-gnu-toolchainriscv-gnu-toolchain-rv32i cd riscv-gnu-toolchain-rv32i git submoduleupdate --init --recursive mkdir build; cd build ../configure--with-arch=rv32i_zicsr --with-abi=ilp32 --prefix=/opt/riscv32i_ilp32
( note that the "prefix"on the configure command is just a directory, not to confuse with the prefixof the cross compiling toolchain ) make
Using that toolchain, the option in the makefile isn't necessary at all.
IMHO I think that the change request is reasonable The change would enable use of pre-built riscv gcc toolchain packages - many linux distributions already ship these...
With the current source I believe that it is possible to supply make MARCH=rv32i_zicsr
and thereby overload the contents of the existing Makefile
(this is an untested claim)
Probably correct. On the other hand, in order to create merge requests with improvements, its better to have a toolchain that works with current sources.
its better to have a toolchain that works with current sources.
I'm currently unable to test if if the change breaks anything on a custom-built (home made) toolchain
Well, in this case it is progress made on the definition of the RiscV infrastructure. zicsr is no longer part of the RV32I definition, so in fact, it is correct to add it to the MARCH.
Message ID: @.***>
I tested this with my version of the compiler (riscv32-unknown-elf-gcc (GCC) 10.2.0), and this architecture specification does not work yet. So I'll leave it like this for now.
I am using a tool chain which needs this "fix" but I don't need to change the Makefiles. I have declared in my .profile (or .bashrc if you prefer) the line :
export MARCH=rv32i_zicsr_zifencei
This way the Makefile will use the env variable instead of the default value (that's the meaning of ?= in the Makefile)