Hacking vs Feature Request to Compiler
Hacking vs Feature Request to Compiler
Posted Oct 11, 2024 19:03 UTC (Fri) by rywang014 (subscriber, #167182)Parent article: FFI type mismatches in Rust for Linux
Sounds like this "LTO only for C called in Rust" is totally doable on LLVM end, but nobody had that need before so there isn't a feature for it. Instead of hacking around LLVM bytecode, IR manipulation and flags, why don't we make a feature request to LLVM (and later GCC) to do it for R4L?
Something I can think of: mark the helpers.o symbols as "inline only". When linking: any objects referencing those symbols are force-LTO'ed; and after all linkings, delete those text and symbols.