Linking statically, and glibc breaking userspace for fun
glibc is annoyingly eager to break userspace. You can’t just build something that only depends on libc and expect it to work on all linux systems of that architecture.
I don’t know why Linus Torvalds keeps insisting “we do not break userspace” as a policy for the kernel when libc seems to make that exact thing a hobby. And either way the userspace programs break.
Compiling static (including libc) is frowed upon, and has even had known breakages left unaddressed.
E.g. setlocale() had a strange bug where for new threads you had to
first set the locale to the wrong locale, and then call it again to
set it to the right one. Otherwise the new thread would be in a weird
state where the local is wrong, but it thought it’s right, so won’t
allow you to change it to what it thought it already was.
I can’t find the bug now (I ran into this around 2004-2005), but the official response was basically “well don’t compile statically, then”.
And DNS can be broken with static glibc. “a statically linked glibc can’t use NSS (Name Service Switch) modules from a different glibc version, so if you statically link Continue reading
s like for a traditional media outlet to go up against the vast agglomeration of economic and digital power known as Big Tech—and to do so without the benefit of what economist John Kenneth Galbraith defined as countervailing power.
