docs: add riscv64 native build instructions#608
Open
gounthar wants to merge 1 commit intoWebAssembly:mainfrom
Open
docs: add riscv64 native build instructions#608gounthar wants to merge 1 commit intoWebAssembly:mainfrom
gounthar wants to merge 1 commit intoWebAssembly:mainfrom
Conversation
Document how to build WASI SDK from source on native riscv64 Linux hardware. The build requires zero source patches — only cmake flags for skipping compiler tests and limiting to WASIP1 targets. Tested on Banana Pi F3 (SpacemiT K1, rv64gc, 16 GB RAM, Debian Trixie) with WASI SDK v30. Stage 1 (LLVM) takes ~8-10 hours, Stage 2 (sysroot) takes ~15-20 minutes. Ref: WebAssembly#607
Collaborator
|
Thanks for this! I'm not sure that this documentation is all that much different from the Given that I think it might be reasonable to add a note in the README about disabling wasip2/wasip3 for non-allow-listed architectures (or perhaps better yet, codify that in CMake). Another possible alternative would be implementing/documenting downloading the wasi-sysroot from this repository and plopping it into a toolchain. There's no need to build the sysroot on all platforms, for example. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add documentation for building WASI SDK from source on native riscv64 Linux hardware.
The build completes with zero source patches — only cmake configuration flags are needed:
-DCMAKE_C_COMPILER_WORKS=ONto skip compiler test (Stage 1 Clang only targets wasm32)-DWASI_SDK_TARGETS="wasm32-wasi;wasm32-wasip1"to skip WASIP2 (wit-bindgen/wasm-tools/wkg don't ship riscv64 binaries)Tested on Banana Pi F3 (SpacemiT K1, rv64gc, 8 cores, 16 GB RAM, Debian Trixie) with WASI SDK v30. Full self-hosted loop verified: C → Clang (native rv64) → .wasm → iwasm (native rv64).
Ref: #607
What this enables
Self-hosted WebAssembly development on RISC-V hardware without needing an x86 or ARM host for compilation.
Test plan