How can I compile rust for 16bit x86 (Intel 8086)?

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • llvm-mos

    Port of LLVM to the MOS 6502 and related processors

  • You could look at LLVM-MOS, the port of LLVM to the 6502. It might give you some ideas around the problems to solve https://llvm-mos.org/wiki/Welcome https://github.com/llvm-mos/llvm-mos

  • rv51

    A RISC-V emulator for the 8051 (MCS-51) microcontroller.

  • One (hacky) way to target CPUs not supported by Rust/LLVM, is to write emulator in language that works on that target (C/Asm) of a platform that rust can compile to. For example, someone made Rust work on 8051 by writing Risc-V emulator in 8051 assembly: https://github.com/cyrozap/rv51

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • rusty-dos

    A Rust skeleton for an MS-DOS program for IBM compatibles and the PC-98, including some PC-98-specific functionality

  • I assume that's what rusty-dos is using, given this bit from the README:

  • gcc-ia16

    Fork of Lambertsen & Jenner (& al.)'s IA-16 (Intel 16-bit x86) port of GNU compilers ― added far pointers & more • use https://github.com/tkchia/build-ia16 to build • Ubuntu binaries at https://launchpad.net/%7Etkchia/+archive/ubuntu/build-ia16/ • DJGPP/MS-DOS binaries at https://gitlab.com/tkchia/build-ia16/-/releases • mirror of https://gitlab.com/tkchia/gcc-ia16

  • or GCC IA 16 (https://github.com/tkchia/gcc-ia16) gets someday mainlined (also a multi month/years project) and then gccrs can maybe use it as backend

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts