-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get rid of C2Rust #19498
Comments
LTO should be the default anyway, as this yields significant gains; being able to run more apps without soldering in a new MCU with more RAM/ROM is something we should do, regardless of this discussions. With that, we don't gain anything from Getting our linker scripts compatible with other linkers is something that IMO would be worth some effort. I think that XFA may have raised the bar a bit here, though :/ |
I don't see any trouble with XFA: It's just another section that gets linked into RAM or ROM, that should be a regular feature. The trouble IIRC was that we did some constant arithmetic to be able to do things like accommodating different chips in a series with different sizes of memory in different situations of using or not using a boot loader and other flash size shenanigans -- where the alternative is to either have combinatorial lot of such files, or to generate them with a very small |
I can confirm that with fixed ldscripts, cross-language-lto works between Rust and RIOT's C code. |
Description
C2Rust is an extra that occasionally causes trouble, eg. in #19495 (comment), where I was tempted to answer:
… so instead, I'm opening this.
I'm not sure now is a good point in time, neither ever, but let's at least use this issue to hypothesize, and to collect material, show-stoppers and input.
Why we use C2Rust now
static inline
functions usable from a linked program. I'm marking this as "solved" because bindgen has learned to turn public static functions into non-static functions that can be linked when an extra generated C file containing all their implementations is linked -- so there is a viable solution, but see next point.for then we could both C and Rust code into LLVM object files and do cross-language LTO to eliminate any drawbacks of using non-static functions. (Cross-language LTO may have other issues, but right now we can't even test it because RIOT only works with ).
If we could tick all these boxes, we could migrate off C2Rust. But that'd probably only fly if there were other reasons as well that'd justify ticking the boxes. Do we have them?
The text was updated successfully, but these errors were encountered: