Comment by fjfaase

1 day ago

The idea of bootstrapping is that you start with nothing, or at least with almost nothing. In case of stage0 (the first stage of live-bootstrap) this a small program that converts a file with hexadecimal characters (in pairs) to a binary file. From there you have to build everything. To compile Rust, you need a Rust or C compiler, I understand. I have no idea how hard it would be to build a minimal Rust compiler that could compile itself, one that not necessary performs all the checks that the (full) Rust compiler would do.

I think that Rust is build as part of live-bootstrap, but at a much later stage when the latest version of the GNU C compiler has been build.

You would get a C++ compiler going and then build mrustc and then use that to build rustc and then use that to build the version of rustc you want.

  • The latest version of g++ is written in C++. If I am not mistaken g++ 4.7.4 is the oldest version that is written in C. But it does not support the C++ version in which the latest version of g++ is written. For that you have to compile g++ 10.4.0 first. And g++ 4.7.4 cannot be compiled by the Tiny C Compiler (tcc). The total chain then becomes:

    tcc 0.9.26 → tcc 0.9.27 → gcc 4.0.4 → g++ 4.7.4 → g++ 10.4.0 → g++ 13.1.0