Skip to content

Add "zicsr" to fix build issue#380

Open
scjody wants to merge 1 commit intoGideonZ:masterfrom
scjody:zicsr
Open

Add "zicsr" to fix build issue#380
scjody wants to merge 1 commit intoGideonZ:masterfrom
scjody:zicsr

Conversation

@scjody
Copy link

@scjody scjody commented Nov 9, 2023

Fixes #379, tested on a U2+L with rv32i-131023 (GCC 13.2.0) from https://github.com/stnolting/riscv-gcc-prebuilt

@scjody scjody marked this pull request as draft November 9, 2023 23:03
@scjody scjody marked this pull request as ready for review November 9, 2023 23:39
@markusC64
Copy link

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.

@UffeJakobsen
Copy link

UffeJakobsen commented Nov 10, 2023

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)

@markusC64
Copy link

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.

@UffeJakobsen
Copy link

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

@GideonZ
Copy link
Owner

GideonZ commented Nov 11, 2023 via email

@GideonZ
Copy link
Owner

GideonZ commented Dec 28, 2023

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.

@rgc2000
Copy link
Contributor

rgc2000 commented Dec 29, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"zicsr" build issue with new toolchain

5 participants