Re:Rust Dependencies Scare Me
by kccqzy on Friday May 09, 2025 @07:31PM
(#43941897)
Everywhere in this thread is debating whether LTO "completely" solves this or not, but why does this even need LTO in the first place? Dead code elimination across translation units in C++ is traditionally accomplished by something like -ffunction-sections, as well as judiciously moving function implementations to the header file (inline).
[ Parent
| on HN ]
Re:Rust Dependencies Scare Me
by jeremiahar on Friday May 09, 2025 @10:46PM
(#43942839)
Clang also supports virtual function elimination with -fvirtual-function-elimination, which AFAIK currently requires full LTO [0]. Normally, the virtual functions can't be removed because the vtable is referencing them. It's very helpful in cutting down on bloat from our own abstractions.
[0] https://clang.llvm.org/docs/ClangCommandLineReference.html#c...