RustInQemu/2022

From QEMU

Notes about possibilities for including Rust code in the Qemu project. Started after discussion at the Rust in Qemu BoF at KVM Forum 2021.

Rust target support for Qemu host platforms

Information sources:

QEMU discussion thread

Reddit post

Notes:

  • Some of the N/A entries I'm uncertain about
    • I think NetBSD lacks mips64 support, but I don't entirely know how to interpret the way they describe CPU architecture support, so again, I'm uncertain.
    • I don't believe macOS or Windows have ARM32 support, but I'm not sure where to confirm that
    • I believe macOS has dropped 32-bit x86 support, but I'm not sure if we support any old macOS versions which might support 32-bit x86
    • It's not clear to me if qemu supports 32-bit RISC-V as a built platform
  • In the colouring, I've considered Tier3* as "better than" Tier2. This is debatable, but the rationale is that if we don't have host tools, that's not really sufficient for a supported qemu build platform.
  • I've not investigated support on Solaris or other Unix variants. Those aren't mentioned here, but I'm not really sure if there are some users of qemu on those platforms.
Legend
Tier1* Rust Tier 1 with Host Tools supported target.
Tier2* Rust Tier 2 with Host Tools supported target
Tier3* Rust Tier 3 target, with full standard library, and host tool build support
Tier2 Rust Tier 2 target without host tools, but with full standard library.
Tier3 Rust Tier 3 target, but lacks either full standard library or host tool build support.
- Rust does not have support for this target
N/A OS doesn't support this architecture


Linux macOS Windows FreeBSD NetBSD OpenBSD
armv6 Tier2* N/A? N/A? Tier3* Tier3* N/A
armv7 Tier2* N/A? N/A? Tier3* Tier3* -
aarch64 Tier1* Tier2* Tier2* Tier3* Tier3* Tier3*
MIPS (32-bit) Tier2* N/A N/A - - N/A
MIPS (64-bit) Tier2* N/A N/A - N/A? -
PPC (32-bit) Tier2* N/A N/A - Tier2* Tier3
PPC (64-bit) Tier2* N/A N/A Tier3* N/A? N/A
RISC-V (64-bit) Tier2* N/A N/A - N/A N/A
s390x Tier2* N/A N/A N/A N/A N/A
SPARC (32-bit) Tier3 N/A N/A N/A - N/A
SPARC (64-bit) Tier2 N/A N/A N/A Tier3* Tier3
x86 (32-bit) Tier1* N/A? Tier1* Tier2 Tier3* Tier3*
x86 (64-bit) Tier1* Tier1* Tier1* Tier2* Tier2* Tier3*

Rust toolchain availability for Qemu host platforms

Notes:

  • Qemu build platforms / distros
  • Package availability information from Repology
  • Not sure what, if anything, should count as "packaged" for Windows
  • Not sure how to test how easy/effective it is to use Rustup to get a toolchain on various platforms
  • Suitable version is currently considered Rust 1.31.0 or later
    • This version is chosen since it's the first with Rust 2018 edition support, which we almost certainly want
    • There may well be important features since then that we want, but I don't yet know what they are
Legend
Packaged OS/distro has a prebuilt packages including rustc and cargo of suitable version
Rustup Rustup works well to install toolchain on this platform
Unknown Rust toolchain availability unknown


OS/distro Toolchain
Linux, CentOS
Linux, Debian
Linux, Fedora
Linux, openSUSE
Linux, RHEL
Linux, SLES
Linux, Ubuntu LTS
FreeBSD, ports
NetBSD, pkgsrc
OpenBSD, ports
MacOS, HomeBrew
Windows, ???