I want to build binary for mips32-linux
architecture, I build it inside amd64
architecutre fresh VM with OS ubuntu-22.04-lts
.
Asked ChatGPT, here is the answer:
To manually perform the build process for MIPS Linux on your Ubuntu VM, you can follow these steps:
-
Clone the GitHub repository:
git clone <repository_url> cd <repository_directory>
-
Install musl-tools for Linux:
sudo apt install musl-tools
-
Install Rust toolchain:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh rustup override set stable rustup target add mips-unknown-linux-musl
-
Build the project:
cargo build --target mips-unknown-linux-musl --release
This will compile your project for the MIPS architecture using the musl
libc implementation, producing the release binary.
After the build completes successfully, you’ll find the built binary in the target/mips-unknown-linux-musl/release/
directory within your project folder. You can then transfer this binary to your MIPS system and run it.
But I ended fail in step adding rustup target add mips-unknown-linux-musl
that returns
error: component 'rust-std' for target 'mips-unknown-linux-gnu' is unavailable for download for channel 'stable'