Bootstrapped Rust

Added by Igor Pashev over 4 years ago

After reading I have discovered a Rust compiler written in C++ - mrust. It only needed a few changes to make it work on Dyson. I have committed them to

When building a few troubles raised, the most important is that it needs a lot of memory, A LOT :). At some step there was a C file of size 760 MiB. I could not build it on a server with 12 GiB RAM and 40GiB swap (!), the server just hung. Then I spun up a VirtualBox instance with about 18GiB RAM (on a 24 GiB RAM server) plus 20 GiB swap. It took a while to compile, but finally it succeeded.

Here is a screenshot of the process:

mrust currently builds Rust 1.29, I have to add extra patch to make Rust work on Dyson. It adds new target (x86_64-pc-solaris) which seems to appear in later Rust versions, and disables Rust version detection in the regex crate, because it fails to find the rust compiler for some reason.

What I have now:

root@dyson:~/mrust# cat ~/
fn main ()
root@dyson:~/mrust# run_rustc/output/prefix/bin/rustc --version
rustc 1.29.0-stable-mrustc
root@dyson:~/mrust# run_rustc/output/prefix/bin/rustc ~/ -o /tmp/main
root@dyson:~/mrust# ldd /tmp/main =>        /lib/x86_64-illumos/ =>        /lib/x86_64-illumos/ =>         /lib/x86_64-illumos/ =>     /lib/x86_64-illumos/ =>     /lib/x86_64-illumos/ =>   /lib/x86_64-illumos/ =>    /lib/x86_64-illumos/ =>    /lib/x86_64-illumos/
root@dyson:~/mrust# file /tmp/main
/tmp/main: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/amd64/, BuildID[sha1]=2c927fc72b5c16174196c35914d80a1f0cc8a75b, not stripped
root@dyson:~/mrust# /tmp/main
rust-bootstrap2.png (33.8 KB) rust-bootstrap2.png Igor Pashev, 2019-12-02 09:31 AM
rustc-1.29.0.dyson.patch (3.73 KB) rustc-1.29.0.dyson.patch Igor Pashev, 2019-12-02 09:34 AM