News for hackers. Stuff that matters.
Re:A Not-Called Function Can Cause a 5X Slowdown by cesarb on Tuesday December 04, 2018 @01:13PM (#18602024)
> I've never gotten the hate for static linking

I believe most of the dislike for static linking can be traced to a single incident: a really bad (as in "remote code execution" bad) vulnerability in zlib, CVE-2002-0059. Back then, it was common to statically link to zlib (and zlib is a very popular library, the DEFLATE algorithm it implements being the "standard" compression algorithm), so instead of just replacing a single dynamic library and rebooting, everything had to be audited for the presence of embedded copies of zlib.

Quoting from a message from a few years later (http://mail.openjdk.java.net/pipermail/build-dev/2007-May/00...):

"[...] Updating the main system zlib package was easy, but finding all the embedded copies was a nightmare. I think we ended up grepping every binary and library in every package for symbols and other bits of code that looked like zlib. All the different versions involved compounded this. And when everything is found and patched and built and tested there's the cost of bandwidth to distribute all the extra stuff. So when people talk of removing static libraries they're talking about real costs -- time and money. After zlib there was a definite feeling of "never again"."

Re:A Not-Called Function Can Cause a 5X Slowdown by Hello71 on Tuesday December 04, 2018 @01:34PM (#18602246)
That's not a complaint about static linking though, that's a complaint about library embedding. Lots of Professional Enterprise Software as well as poorly designed games use a buttload of dynamic linking, but a few patches here and there and some API/ABI ignorance later, the libraries are impossible to replace.
Re:A Not-Called Function Can Cause a 5X Slowdown by TFortunato on Tuesday December 04, 2018 @03:06PM (#18603164)
Unfortunately, this is conflating static linking with bad dependency management. ("Just copy it into your own repo", is a different step, that is unnecessary to do the second step, "and link it statically")

There is no reason I see why you couldn't just have a build that produces the library .a file for zlib, which can then be pulled in as a dependency of your build / linked in statically.

I totally agree, they had a nightmare situation on their hands, but I don't think static linking was solely to blame :-)

Re:A Not-Called Function Can Cause a 5X Slowdown by tedunangst on Tuesday December 04, 2018 @03:51PM (#18603497)
I have 100s of binaries on my system. Which ones do I need relink?
Re:A Not-Called Function Can Cause a 5X Slowdown by juliangoldsmith on Tuesday December 04, 2018 @04:15PM (#18603663)
You can write a script to look at package files' makedepends, and rebuild everything that uses the offending library.