Open Serentty opened 4 years ago
Thanks!
I'm not sure I understand, though. I think it's really both a frontend for gcc and a backend for rustc. But do you mean that it should use librustc_codegen_ssa
?
I think he means that you use can execute rustc
with an extra flag instead of gcc
with a rust file to use gcc-rust. This makes it easier to support cargo.
In cg_clif I use -Zcodegen-backend
to load a .so as backend. That .so file just needs to provide a __rustc_codegen_backend
symbol: https://github.com/bjorn3/rustc_codegen_cranelift/blob/6652f466efc93a8706c07cda0502fd487ce8219d/src/lib.rs#L286
My impression of gcc so far is that doing this without libgccjit would be difficult, and in any case it might not integrate as well with gcc.
That is unfortunate.
I was talking to Centril about this project, and he suggested that it would make more sense to structure it as a codegen target for the Rust compiler instead of a GCC frontend. These were his words, specifically:
I'm not familiar with compiler internals and have no opinion on this myself, but given that Centril is a central figure in the development of Rust, I figured it would be a good idea to pass this on.