|
|
Subscribe / Log in / New account

Debian, Rust, and librsvg

Debian, Rust, and librsvg

Posted Nov 14, 2018 15:18 UTC (Wed) by cesarb (subscriber, #6266)
In reply to: Debian, Rust, and librsvg by glaubitz
Parent article: Debian, Rust, and librsvg

A simpler possibility might be to lower Rust's MIR to GCC's IR instead of LLVM's IR.


to post comments

Debian, Rust, and librsvg

Posted Nov 14, 2018 23:29 UTC (Wed) by roc (subscriber, #30627) [Link]

This idea sounds good!

Debian, Rust, and librsvg

Posted Nov 16, 2018 10:50 UTC (Fri) by Ieee754 (guest, #128655) [Link] (3 responses)

That would be a possibility, if GCC wasn't explicitly designed to prevent this from happening.

There are already prototypes of Rust frontend supporting other backends, but this only works if Rust generates some IR for the backend, and then the backend compiles this IR.

GCC's IRs are designed to be incompatible with this model, to prevent industry from reusing GCC as a backend. The GCC IRs require a lot of back and forth between the different frontend and backend phases to work. This means that you can't use a front-end designed to support multiple "reasonable" backends with GCC, because it is, by design, an unreasonable backend.

Debian, Rust, and librsvg

Posted Nov 18, 2018 9:21 UTC (Sun) by drago01 (subscriber, #50715) [Link] (2 responses)

Wouldn't it be easier to add llvm ir support to gcc? (i.e as if it was any other language) - would allow gcc to work with anything that generates llvm it not just rust.

Debian, Rust, and librsvg

Posted Nov 18, 2018 10:33 UTC (Sun) by hsivonen (subscriber, #91034) [Link]

As the post you are replying to points out, GCC has intentionally been designed, for licensing strategy reasons, not to support some technically reasonable things. Adding a GCC capability to ingest LLVM IR would circumvent the licensing strategy, so it's unlikely that such a capability would be accepted in the upstream GCC unless the licensing strategy is first revised. (The existence of LLMV pretty much foils strategy's fundamental assumption in the context of ISAs that are still in chip production.)

Debian, Rust, and librsvg

Posted Nov 29, 2018 22:13 UTC (Thu) by tschwinge (subscriber, #43910) [Link]

Adding a LLVM IR front end to GCC is precisely what I suggested in <https://users.rust-lang.org/t/rust-front-end-to-gcc/11601/12>. Alas, I still lack a big enough chunk of time to dedicate to that. :-/


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds