4 ms·
Is there something like "50% statically-linked". I'm trying to understand if static linking can be partial. I often see it done it all in or none.
by alpb 9y ago
Is there something like "50% statically-linked". I'm trying to understand if static linking can be partial. I often see it done it all in or none.
- zeroxfe 9y agoTechnically, no, but in practice, yes. For example, default static linking does not include the base C libraries that are pretty much available in every OS. You have to explicitly tell the linker to also link those in.
- steveklabnik 9y agoRemember that ultimately, you link multiple things in, and each can be linked dynamically or statically. So, a "100% statically linked" binary would have every library statically linked, a "100% dynamically linked" binary would have every library dynamically linked, with all the ranges in between. This comes up with Rust due to what's in the article: > This part can be skipped if you don’t need 100% static linking. Rust statically links most libraries by default anyway, except for things like libc. Rust statically links Rust code by default, but has a dynamic link to libc. So Rust binaries are "mostly statically linked" for this reason. MUSL lets you link that final dependency, getting up to 100%.
- IshKebab 9y agoSure, it means 50% of its dependencies are linked to statically.