Prerequisites
Option A: Using cross (Recommended)
The cross tool uses Docker containers with pre-configured ARM toolchains:
- Docker installed and running
- ~1 GB disk space for Docker images
- Zero configuration required
- Consistent builds across machines
- Handles all dependencies automatically
Option B: Manual Cross-Compiler
Install ARM cross-compilers directly on your system: Ubuntu/Debian:- No Docker required
- Faster builds (no container overhead)
- More complex setup
- Platform-dependent configuration
Build Script
OneClaw includesscripts/cross-build.sh for automated cross-compilation.
Usage
What It Does
Builds for ARM targets
Compiles for multiple architectures:
aarch64-unknown-linux-gnu— Raspberry Pi 4/5 64-bit, Orange Pi, NanoPiarmv7-unknown-linux-gnueabihf— Raspberry Pi 3/Zero 32-bit, older ARM boards
Build Output
Manual Cross-Compilation
If you prefer manual control:Using cross
Using cargo (manual toolchain)
Target Setup
Available Targets
| Target | Architecture | Use Case |
|---|---|---|
aarch64-unknown-linux-gnu | ARM64 | Raspberry Pi 4/5 (64-bit), modern ARM boards |
armv7-unknown-linux-gnueabihf | ARMv7 | Raspberry Pi 3/Zero (32-bit), legacy ARM |
x86_64-unknown-linux-gnu | x86-64 | Intel NUC, edge gateways, development |
Adding Targets
If usingcargo directly, add the target to Rust:
cross, targets are handled automatically.
Binary Location
After building, binaries are in:Using cross-build.sh
Manual Build
Deployment
After cross-compiling, copy binaries to your edge device:Dependency Configuration
OneClaw is configured for seamless cross-compilation:SQLite (Bundled)
bundled feature compiles SQLite from C source, eliminating the need for system SQLite libraries on the target.
TLS (Pure Rust)
rustls-tls instead of native-tls avoids OpenSSL dependencies, which are difficult to cross-compile.
No System Dependencies
OneClaw has zero runtime dependencies:- No libc dynamic linking required
- No OpenSSL required
- No system SQLite required
Troubleshooting
cross Build Fails
Symptom: Docker errors or missing images
Solution:
Linker Errors (Manual cargo)
Symptom: ld: cannot find -lgcc
Solution: Install cross-compiler toolchain:
Wrong Architecture
Symptom: Binary fails on Pi with “cannot execute binary file: Exec format error” Solution: Verify target matches Pi architecture:Build Takes Forever
Symptom: Cross-compilation is very slow Solutions:- Use
crosswith Docker (caches dependencies) - Enable
sccachefor incremental builds:
Next Steps
Deploy to Raspberry Pi
Install cross-compiled binaries on edge devices
systemd Service
Set up OneClaw as a system service