The Atrocious State Of Binary Compatibility on Linux and How To Address It

27 points by calvin


fanf

We think a better approach would be breaking GLIBC into distinct libraries, something like this:

  • libsyscall – Handles making system calls and nothing else. This is provided as a static library only. Used by libheap, libthread and libc to gain access to shared system call code. Since it’s static it’s embedded in all three. You can pretend this library otherwise does not exist.

[…]

  • libthread – Deals with threading and TLS, links against libheap. Provided only as a dynamic library. Cannot ever be linked against statically.

It isn’t that easy, I’m afraid. System calls depend on TLS: the classic one is errno, but the vdso interfaces are also thread-local: the per-core rate/phase parameters for clock_gettime(), the per-thread getrandom() state. Probably other things I don’t know about!

max-headroom

Notably not considered: Nix. Nix would give you what you want from containers (the binary and ALL its dependencies) and none of what you don’t want from them (runtime isolation which you need to work around).