Files
tkmind_go/RISCV_SETUP.md
T

63 lines
1.6 KiB
Markdown
Raw Normal View History

2026-09-09 19:37:11 +00:00
# Building goose for RISC-V (riscv64gc-unknown-linux-gnu)
This document describes how to build goose-cli for RISC-V 64-bit systems.
2026-09-09 19:37:11 +00:00
> [!WARNING]
> This is an experimental, community-contributed build process. RISC-V is not
> officially supported by the goose project.
## Prerequisites
- The Rust toolchain pinned in `rust-toolchain.toml`
2026-09-09 19:37:11 +00:00
- Target: `rustup target add riscv64gc-unknown-linux-gnu`
- For cross-compilation, a RISC-V toolchain such as `gcc-riscv64-linux-gnu`
and the target libraries required by Goose's native dependencies
2026-09-09 19:37:11 +00:00
### Linker configuration
2026-09-09 19:37:11 +00:00
Building on RISC-V hardware uses the native linker automatically.
2026-09-09 19:37:11 +00:00
Cross-compiling (e.g. from x86_64) needs the cross linker. Either export:
2026-09-09 19:37:11 +00:00
```bash
export CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER=riscv64-linux-gnu-gcc
```
or add to `.cargo/config.toml` (or `~/.cargo/config.toml`):
```toml
[target.riscv64gc-unknown-linux-gnu]
linker = "riscv64-linux-gnu-gcc"
```
Adjust the binary name if your distribution ships the cross gcc under a
different name.
## Build
2026-09-09 19:37:11 +00:00
Run from the repository root:
```bash
cargo build --release --target riscv64gc-unknown-linux-gnu -p goose-cli --bin goose
```
Output: `target/riscv64gc-unknown-linux-gnu/release/goose`
Self-update is unavailable on RISC-V because release artifacts are not published
for this platform. Rebuild from source to update.
2026-09-09 19:37:11 +00:00
## Verification
Check the binary's architecture:
2026-09-09 19:37:11 +00:00
```bash
file target/riscv64gc-unknown-linux-gnu/release/goose
```
2026-09-09 19:37:11 +00:00
On RISC-V hardware, run:
```bash
2026-09-09 19:37:11 +00:00
./target/riscv64gc-unknown-linux-gnu/release/goose --version
./target/riscv64gc-unknown-linux-gnu/release/goose doctor
```