More on the Rust bootstrapping process (2018): https://guix.gnu.org/blog/2018/bootstrapping-rust/
Building from Source All the Way Down - https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-...
For this, gcc-rs[1][2] is the most promising candidate.
If you're going to go to all this effort for an old target though, wouldn't the effort be better spent on making it an LLVM target? Then you'd get Rust and a bunch of other languages for free.
But maybe there are required parts of the LLVM IR that make this undesirable for certain targets, maybe requiring specific hardware features, I don't know. I guess also WASM-as-IR is a possible way to go. (Is that a thing?)
Edit: sorry I see that this point was already raised in this thread by ivanjermakov. Ignore.
Yes, actually I've heard of some projects compiling a language to Wasm, then using wasm2c to translate to C.
https://github.com/WebAssembly/wabt/blob/main/wasm2c/README....
The Zig project does something similar for their bootstrapping process with a custom wasm2c implementation with just the features they need.
https://github.com/ziglang/zig/blob/master/stage1/wasm2c.c
I get the feeling this is an underappreciated technique with more potential.
But it doesn't mean rustc generates code for that target, only that you can run it there. You'd still have to teach LLVM about the target. Although that might already have been done.
It's not that useful for retro computers because the Rust compiler needs too much memory for most machines of the 32-bit era.
It is said microsoft rust syntax is on the same brain damage complexity level than ISO c++. That, and I don't even talk about the technical cost of its runtime (not far from the toxicity of a jvm?)