Skip to content

RISC-V support #22354

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

Closed
DavidBurela opened this issue Feb 20, 2021 · 9 comments
Closed

RISC-V support #22354

DavidBurela opened this issue Feb 20, 2021 · 9 comments

Comments

@DavidBurela
Copy link

DavidBurela commented Feb 20, 2021

Rationale

RISC-V CPUs are becoming a hot topic, especially in the conversation of decentralization + Open Hardware.
Ensuring that go-ethereum can compile for the target cpu architecture would be a good enhancement to help with an open network.

Implementation

Current status:
Because it has been written in Golang, it is already mostly CPU agnostic.
But right now it does not compile on the current version of Go 1.15.8, as not all of the included libraries used by geth have had RISC-V support

Getting it working:
Compiling the latest version of Golang available on GitHub does successfully compile and run geth. I was able to have it compile, connect, and start syncing with the network on an emulated RISC-V cpu architecture.

I have capture the research and steps it took to get working https://blog.davidburela.com/2020/12/03/ethereum-on-risc-v/

Steps:

  1. Install golang (to use as a boot strap)
  2. Pull latest golang from github, and compile it
  3. git clone go-ethereum
  4. Compile go-ethereum with -arch=riscv64 flag
  5. Can now run the RISC-V binary and start syncing with the network

Next steps

Creating this issue to track support as the golang support is updated. It might be a case of simply waiting for the next major version of golang that uses the current working version on GitHub.

@Shin-Asi
Copy link

Great work. The future is definitely RISC-V open source HW architecture David. Congratulations.

@ligi
Copy link
Member

ligi commented Feb 25, 2021

As the upstream issue is merged it should compile now - can we close this issue then?

@karalabe
Copy link
Member

Go 1.16 was released a while ago and it contains the fix you linked golang/go#36641. Is there anything to do now?

@MariusVanDerWijden
Copy link
Member

Thank you very much for your work @DavidBurela!

@DavidBurela
Copy link
Author

You are correct, go 1.16 source release was 9 days ago. But isn't on package management systems (apt, etc) which is why I missed it.
https://github.com/golang/go/releases/tag/go1.16

I tried building the latest go-ethereum source, on a RISC-V system, using go 1.16, and I can confirm it does now build successfully.

image

@DavidBurela
Copy link
Author

Next steps:

  • Should we add it as a standard release binary linux/riscv64?
  • Do we need to wait until the build pipeline upgrades to go 1.16?

@karalabe
Copy link
Member

We're already building with Go 1.16.
I don't think we want to add support to an exotic platform. We can definitely reconsider it if RISC V takes off, but until then I don't really see a reason to add maintenance overhead.

@karalabe
Copy link
Member

Wrt not being on APT, Go doesn't have official PPA distributions, so you can forget about that. You can either go with snap packages (done by the previous maintainer of the PPAs), download prebuilds or build from source if you want a reasonable new Go release.

@DavidBurela
Copy link
Author

Closing this issue.
Codebase now builds with latest version of Golang.

Later if it makes sense to create an Epic to track support, it can be recreated then.

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

No branches or pull requests

6 participants