rust cross build mipsel-unknown-linux-musl

同事的好用方案

安装 cross #

当然, 你需要提前安装rust和docker

cargo install cross --git https://github.com/cross-rs/cross

配置 cross #

在项目根目录新建: Cross.toml

[target.mipsel-unknown-linux-musl]
build-std = ["std", "alloc", "core", "proc_macro", "panic_abort"]
image = "docker.io/rustembedded/cross:mipsel-unknown-linux-musl"

编译命令 #

cross build --target mipsel-unknown-linux-musl --release --example=pishoo