3 ms·
Rust can't do this very well because it doesn't build std as part of the project, that's still an unstable option. It's linking object code.
by zozbot234 3y ago
Rust can't do this very well because it doesn't build std as part of the project, that's still an unstable option. It's linking object code.
- lifthrasiir 3y agoLink-time optimization should have been beneficial for this case... unless you absolutely needed quite a bit of `std` to print backtraces.
- Vogtinator 3y agoC doesn't either, but statically linking still pulls only the object files which are actually needed into the executable.
- flohofwoe 3y agoI think that's the main reason why every stdlib function lives in its own source file in MUSL: https://git.musl-libc.org/cgit/musl/tree/src/stdio https://git.musl-libc.org/cgit/musl/tree/src/stdio Not sure if this can easily be replicated in Rust though and LTO must be used instead for dead code removal.
- zozbot234 3y agoA Rust crate is a single translation unit. It's the precise equivalent of a C source or object file.