by kazinator · 3y ago · 0 comments
There is no official, hassle-free way to generate a statically-compiled binary with C for GNU/Linux.
A C program compiled on Deb 12 might not work on 11, if it requests a new version of some function, or a new function.
Go and Rust can, but they are silos.
Glibc dropped support for static linking years ago. You can't deploy a new library to close a library security hole, for programs that have statically linked it.
Rust and Go are doing a stupid thing.
Of course you can. You just recompile affected programs. Just like you need to do in the case of header-only C/C++ libraries like much of widely-used Boost. And if the library is not strictly header-only, but still has significant code in headers, as is often the case in C++, if you only swap the dynamic library, the program is still broken, or much more likely: it becomes broken, even though it originally wasn’t.