Elektrine lite

← Feed

@blobjim@hexbear.net

2026-10-25 16:50 UTC

Is Rust support in GCC ready yet? It’s worrying that Linux is now becoming dependent on the massive LLVM project and the Rust reference implementation (and who knows how complex that is).

Replies (1)

  • @badmin@lemmy.today 2026-10-25 19:18

    To not depend on LLVM, you only need a non-LLVM code generator (i.e. replacing the LLVM IR generation step with another representation). A full fledged implementation in GCC is not strictly necessary. The “presumably complex” Rust implementation is actually modular like that. Multiple code generators already exist. rustc_codegen_gcc is progressing nicely. Priority is given to targets with no LLVM support whatsoever (architectures you probably never heard of) and x86_64. Using the latter as a target could become fully usable within months (90%+ of the work is already done). Another code generator that exists and is even more well supported is cranelift, but that strictly targets fast compilation (at the expense of slower binaries), so it’s mostly useful for faster development workflows. There are even code generators that generate C code, which manage to turn the full reference rust compiler itself to C 😉 The implement-Rust-in-GCC project is called gccrs, but that’s years away from reaching a fully usable state.

    Open ##5243467