3 ms·
IIRC the underlying implementation may be different on other systems. I think in particular, DNS resolution. Linux is the only system where static linking all
by klodolph 2y ago
IIRC the underlying implementation may be different on other systems. I think in particular, DNS resolution.
Linux is the only system where static linking all the way really makes any sense. For most systems, you don’t get a stable syscall ABI. Instead, you get a stable ABI to the library which does syscalls for you… Windows has kernel32.dll, macOS has libSystem.
Note that on Linux, the vDSO is dynamically linked.
Compilation speed is a big plus. For large projects, linking time can easily dominate the time needed for incremental rebuilds.
Due to tooling issues, PIE is a lot easier with dynamic linking, and this gives you better ASLR. These issues are solvable, but it’s a lot easier to get PIE if you use dynamic linking. If you want static PIE, you need to compile all your static libs as PIE—doable, but you don’t get it out of the box.