Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify -march and -mabi in README.md example #1362

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MarekVCodasip
Copy link

Some toolchains (notably the The xPack GNU RISC-V Embedded GCC) build 32 bit binaries by default, spike runs 64 by default, causing an error. This pull request specifies needed parameters to avoid this problem in the example.

@aswaterman
Copy link
Collaborator

This one cuts both ways. Some toolchains don't include multilibs for rv64imac/lp64, so this may break elsewhere. I would think that using riscv64-unknown-elf-gcc with no args is more likely to work for more people, and really should be producing RV64 code (riscv32-unknown-elf-gcc would seem like the right name for a compiler that defaults to RV32 code).

@MarekVCodasip
Copy link
Author

MarekVCodasip commented May 22, 2023

So in that case, would adding a note about it suffice? Something along the lines of:

NOTE: Depending on your toolchain, it might build 32 bit binaries by default, add -march=rv64imac -mabi=lp64 to GCC to prevent this.

@aswaterman
Copy link
Collaborator

Yeah, seems reasonable.

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.

2 participants