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

Build and test riscv32 #700

Merged
merged 3 commits into from
Sep 23, 2023
Merged

Build and test riscv32 #700

merged 3 commits into from
Sep 23, 2023

Conversation

chfast
Copy link
Member

@chfast chfast commented Sep 2, 2023

This uses a pre-built RISC-V toolchain to build and test evmone.

This compiles evmone and dependencies to rv32imafdc with ilp32d ABI. I.e. this target has hardware support for floating point.

Our preference would be to compile for rv32imac with ilp32 ABI. However, there are some obstacles to get there:

  1. The pre-built toolchain is built for ilp32d. We would need to build the toolchain ourselves.
  2. We can hack it by setting -march=rv32imac -mabi=ilp32d. The compiler is not very happy about using architecture with incompatible ABI but it will proceed anyway. Unfortunately, the dependencies have some floating-point code so we also need to provide soft-float library. I was not able to make it build so far.

@chfast chfast requested review from axic, gumb0 and rodiazet September 2, 2023 13:29
circle.yml Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 2, 2023

Codecov Report

Merging #700 (541efbb) into master (e1ac92c) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #700   +/-   ##
=======================================
  Coverage   97.60%   97.60%           
=======================================
  Files          94       94           
  Lines        8644     8644           
=======================================
  Hits         8437     8437           
  Misses        207      207           
Flag Coverage Δ
blockchaintests 62.37% <ø> (ø)
statetests 73.51% <ø> (ø)
statetests-silkpre 22.61% <ø> (ø)
unittests 95.58% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


set(RISCV /usr/local/riscv)

set(CMAKE_SYSTEM_PROCESSOR riscv32)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we specify the riscv32imac triple?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value is only informational, but you can modify the compiler flags.

By default it builds as rv32imafdc. If we switch to rv32imac it will not build because the included glibc is not compatible (the ABI for floating-point values is different). We can configure and build the toolchain ourselves but seems to be a lot of work for the start.

@chfast chfast force-pushed the riscv32 branch 7 times, most recently from b6b1fe0 to 52c710e Compare September 2, 2023 17:15
Use CMake target name directly in add_test()
to make it work with `CROSSCOMPILING_EMULATOR`.
@chfast chfast merged commit edf3aec into master Sep 23, 2023
@chfast chfast deleted the riscv32 branch September 23, 2023 11:32
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.

3 participants