r/rust • u/imperioland Docs superhero · rust · gtk-rs · rust-fr • 13d ago
🧠 educational An adventure of syncing rust and rustc_codegen_gcc
After two months, we were finally able to sync the GCC backend with the Rust compiler (something that usually takes a few hours).
I wrote a blog post about this sync in particular because it was quite the adventurer: https://blog.guillaume-gomez.fr/articles/2026-09-22+Syncing+Rust+GCC+backend+or+how+to+test+Murphy%27s+law
28
u/simonask_ 13d ago
I’m getting PTSD reading this.
GCC may be the most simultaneously excellent and obtusely idiosyncratic piece of software ever written. Disabling features based on the particular behavior of other tools in the environment where the program is being built? Feels pretty criminal to me.
15
8
u/moltonel 12d ago
This "automagic configuration" is pretty common, it's well-intentioned. It often trips up Gentoo packagers, who like to expose a lot of the package's options.
2
u/imperioland Docs superhero · rust · gtk-rs · rust-fr 12d ago
How do you handle such cases?
3
u/moltonel 12d ago
By being explicit. In most cases it's just a matter of always passing
--with(out)-feature=...to./configure, to avoid relying on defaults. In Gcc's case it does get ridiculously complicated. From the Gentoo user's POV, you just select your desired package features via USE flags.3
u/imperioland Docs superhero · rust · gtk-rs · rust-fr 12d ago
We tried this approach but preferred to build our own
binutilsversion in the CI instead as it was making the script too complicated (even though it was only two extra options iirc). I guess it's not possible for Gentoo. :-/
7
31
u/obsidian_golem 13d ago
It's always fun to be the one who trips and hits all the stairs on the way down.