8 ms·
C doesn't either, but statically linking still pulls only the object files which are actually needed into the executable.
by Vogtinator 3y ago
C 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.