5 ms·
I have a less charitable explanation, but a container fan on our team convinced me recently to switch to fully static binaries which did indeed simplify many th
by gumby 9y ago
I have a less charitable explanation, but a container fan on our team convinced me recently to switch to fully static binaries which did indeed simplify many things. So there is something to be said for this in an age of cheap storage.
- jacquesm 9y agoStatic linking was the norm until someone figured out that all the copies of glibc were taking up a lot of space in a time when disk space will still expensive. Today it makes much less sense than it did back then but there is one more advantage: updating a library (which is trivial because almost all these systems are online all the time now) will automatically cause all new instances of the rest of the software on the system to use the new library without having to re-link all the binaries.
- gumby 9y ago> ...Static linking was the norm until someone figured out that all the copies of glibc were taking up a lot of space Dynamic (with and without relocation) linking far predates the existence of glibc, much less Linux, by decades.
- jacquesm 9y agoMake that libc or the X libraries or any other large chunk of code that was replicated over and over again in every linked binary. The principle remains the same, and yes, it predates Linux by a comfortable margin. I'm trying to remember if the old mainframe I worked on had it but I'm not 100% sure.
- gumby 9y agoIt was core functionality of the design of Multics in the 1960s and Multics adopted it from prior art.
- jacquesm 9y agoInteresting! I worked with a PDP/11 running Unix in the 80's and it definitely did not have dynamic linking. All the library files were simply linked to the executables and stripped of symbols before shipping to save space. Anybody here have VAX 11/7XX experience? I wonder how it was on other DEC products.
- maxxxxx 9y ago"there is one more advantage: updating a library (which is trivial because almost all these systems are online all the time now) will automatically cause all new instances of the rest of the software on the system to use the new library without having to re-link all the binaries." In Windows this is called "DLL hell". Too often the new version will have some subtle incompatibilities breaking a lot of stuff. I am a fan of static linking or putting DLLs into a dedicated folder so these shared libraries are actually not shared.
- jacquesm 9y agoHm. DLL Hell to me was on Windows to have to upgrade a DLL for which some other dependency had to be downgraded which was the original reason for starting the upgrade in the first place. But I've seen your trick used in lots of places, in a way that trick is a predecessor to containers, you isolate a functional unit and all dependencies somehow from the rest of the system.
- TimJYoung 9y agoThis is essentially what MS did with .NET and assemblies: they made it pretty difficult to install assemblies in the global assembly cache (GAC), and encouraged application developers to simply distribute/load application-specific assemblies in application-specific directories (\Program Files tree). This was all done with the prior experience gained from the system-wide DLL versioning issues that were finally resolved in (I believe) XP/2003.
- kazinator 9y ago
- snarfy 9y agoDisk space might be a lot cheaper but RAM is still expensive. If you have a dozen apps running that are statically linked to libc then you have dozen copies of libc in memory. If you have a dozen apps that are dynamically linked to libc, they all get a single copy-on-write version of the same libc. This results in the library code getting shared while library data gets copied.
- jacquesm 9y agoThat's true, but there would be 100's or even 1000's of copies of that stuff on your harddrive and with drives being a lot smaller that was a real problem. RAM was always expensive so that's a valid point. There used to be such a thing as an optimizing linker that would throw out all library code that could not be reached.
- eeZah7Ux 9y agoThe security aspect is critical! We cannot expect organizations to be ready to rebuild tons of software, in a short time, every time there's a new vulnerability in a popular library like OpenSSL.