3 ms·
And the main advantage of doing all that work vs statically linking is? Don’t get me wrong - dynamically linking for dev builds makes a lot of sense to cut down
by vlovich123 2y ago
And the main advantage of doing all that work vs statically linking is? Don’t get me wrong - dynamically linking for dev builds makes a lot of sense to cut down on relink times. But I just don’t see it for distribution since doing that RPath work reduces the main argument for dynamic linking (i.e. the OS can patch the vulnerability for all installed packages without waiting for each to release).
- Brian_K_White 2y agoThey didn't claim it was better than static. That doesn't make it worse than static either. They are two different answers for two different problems. It's simply that when you do want external but bundled neighboring libs, there is a good way to do it.
- vlovich123 2y agoWhat advantage does sibling libs provide over static linking?
- kazinator 2y agoThis becomes the same question as when and why are dynamic libraries useful over static linking! Suppose whatever you are shipping consists of five executables, which have a few hundred kilobytes of their own code and a 5 megabyte library. If they statically absorb the library, they all become 5.5 megabyte binaries. Adjust that to whatever sizes you would consider relevant. You can make it clear when a bug is fixed in a library or one of the executables. If you have a patch update, users can see that only a shared library changed or only a certain executable. When hunting a bug, you may have certain possibilities (within limits that depend on your library API maintenance), like trying an older executable with the same library, or older library with the same executable.
- vlovich123 2y agoBundle the executables into a single larger mega-executable with symlinks as the “true” entrypoint name.
- Brian_K_White 2y agoMeaningless question. Simetimes it's what you need. Sometimes it's not. Sometimes you want to write the arabic digit 3, sometimes you want to write the word three. What is the advantage of writing out three? The advantage is whatever the advantage is in those situations when you want it. The possible details are infinite.
- deleted 2y ago[deleted]
- kazinator 2y agoAll what work? Just adding -R '$ORIGiN' when linking the program will then cause it to look for shared libs in its own directory. The program still looks for libc in the system directory. The argument for this is that if you ship software that features multiple executables that share code, they can have it as shared libraries, and easily find it relative to their own location, just like on Windows.