Re: [TECH TOPIC] Rust for Linux

Miguel Ojeda
2021-07-06T18:36:55Z

On Tue, Jul 6, 2021 at 8:00 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> I brought this up for discussion with Miguel et al and it turns out
> the project to develop a GCC front-end for Rust is now well under
> way and there is already a frankencompiler using LLVM first
> and then feeding that into GCC IIUC.

By the latter, I think you are referring to `rustc_codegen_gcc` -- in
that case, a quick note: it does not involve LLVM. `rustc` has its own
set of IRs which then gets translated into LLVM IR (in the most common
backend), but in the case of `rustc_codegen_gcc` it gets translated
into something libgccjit can consume. There is also a third backend in
the works, called cranelift, for different use cases.

So `rustc_codegen_gcc` is basically a very quick way of supporting the
entirety of the Rust language (exactly as `rustc` supports it) but
having a GCC codegen path.

Cheers,
Miguel