A fork of the Rust compiler with Z80 and SM83 (Game Boy) target support, using the llvm-z80 LLVM backend.
z80-unknown-none-elfsm83-nintendo-none-elf
rust-z80 bundles its LLVM backend as the src/llvm-project submodule (the
llvm-z80 fork) and builds it in-tree, so
the installed toolchain is self-contained: rustc, cargo, the SM83 ld.lld,
and the Z80 LLVM backend ship together.
git clone https://github.com/zlfn/rust rust-z80
cd rust-z80
git submodule update --init --depth 1 src/llvm-projectThe repo ships a working bootstrap.toml: it builds LLVM
in-tree with the X86 and Z80 backends (the Z80 backend also covers SM83),
bundles lld, and installs cargo. Adjust it only if your setup differs.
./x installBuilds the stage 2 compiler (the first run also compiles LLVM, which is slow)
and installs rustc, cargo, lld, and the core/alloc for the Z80 and
SM83 targets into install/.
rustup toolchain link rust-z80 installinstall/ holds the compiler, cargo, linker, and target std together, so
cargo +rust-z80 build works with no further configuration.
extern "sdcccall-0"— SDCC calling convention (feature gate:abi_sdcccall_0)extern "z80-interrupt"— Z80 interrupt handler (feature gate:abi_z80_interrupt)
Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.