Rust on the GBA: Revisited
It's been almost a year since I initially wrote my Getting Rust on the GBA series, and it's time I revisited it, and consolidated my explorations into one set of instructions.
A few things have changed in the Rust ecosystem since then, and I'm going to adapt this guide to use them.
- Rustup has replaced multirust
- xargo now exists! It's wonderful.
xargo is billed as "Effortless cross compilation of Rust programs to custom bare-metal targets like ARM Cortex-M", which is perfect for this project. And it lives up to it's name.
Now instead of downloading a copy of the Rust source code, and cross compiling core to the gba and sticking the library in some magic place, we can just say xargo build --target=gba
instead of cargo build --target=gba.json
.
But in addition to using this new tool, I've also updated my version of Rustc, and the old gba.json
file stopped working. Turns out the data-layout
field needs to be changed for some reason. But thanks to the IRC channel, I found the new data layout and it seems to work just fine now.
I also had to update the lang.rs
files, as the stack_exhausted
fn is no longer required or understood.
The newest vesion is already pushed to github, so take a look.