Many programs are dynamically linked to at the very least, libc. If the system libc is older than what the binary was developed for, it will often fail. Failures going the other direction are less common, but can and do still happen. If the binary was statically linked with everything it needs, you've got a pretty good chance it'll work, but that's a bit harder to do with GUI programs that need to interact with X or Wayland.
I had to run a Linux binary compiled for Ubuntu 10.something a few years ago. I couldn't get the drivers to work properly in libvirt and getting the binary to run on modern Linux was practically impossible, even with 32 bit support installed.
The downside of dynamically linked binaries: every tool of medium complexity needs a close-enough version of a common library, and once those get upgraded, the tool dies.
Most statically compiled version should work with a compatible enough libc, but I haven't seen many old programs like that.
Wine, on the other hand, runs tools from the 90s just fine, as long as they're 32 bit.
You don't need to go full static linking. Just bundle every library that doesn't have string backwards guarantees or rather bundle everything except base system libraires. The same is also how things work on Windows (and thus Wine really). Wine won't be able to run a binary that links to some random libpng or whatever that the compiler found in your System32. The only difference is that Microsoft makes an SDK that gives your some idea of whats a system library you can rely on as well as the ability to target older versions than the system you are building on. The latter can be done on Linux as well but there is no-pre made SDK so the easiest solution ends up being a VM or chroot with older libraries.
It depends. I've found for example, if i compile on Ubuntu or Debian, it will probably work on any Ubuntu, Debian, or Debian-based distro released at or newer than the one I compiled it on. There are other cross-compatible examples.
More broadly, there are things like manylinux and MUSL which allow cross-distro applications.
I agree - the model I use for why containers (Docker etc) exist is to abstract over Linux ABI incompatibility. I don't think they're a great solution, as it complicates software distribution. I should be able to distribute an executable and have it just work.
Yesterday I built a binary in an Ubuntu 24.04 Podman container and tried to run it on my Debian Bookworm system:
Because I have glibc 2.36, you see.
The other way around works fine, though, and you can avoid it by statically linking the binary when you build it.
Many programs are dynamically linked to at the very least, libc. If the system libc is older than what the binary was developed for, it will often fail. Failures going the other direction are less common, but can and do still happen. If the binary was statically linked with everything it needs, you've got a pretty good chance it'll work, but that's a bit harder to do with GUI programs that need to interact with X or Wayland.
I had to run a Linux binary compiled for Ubuntu 10.something a few years ago. I couldn't get the drivers to work properly in libvirt and getting the binary to run on modern Linux was practically impossible, even with 32 bit support installed.
The downside of dynamically linked binaries: every tool of medium complexity needs a close-enough version of a common library, and once those get upgraded, the tool dies.
Most statically compiled version should work with a compatible enough libc, but I haven't seen many old programs like that.
Wine, on the other hand, runs tools from the 90s just fine, as long as they're 32 bit.
You don't need to go full static linking. Just bundle every library that doesn't have string backwards guarantees or rather bundle everything except base system libraires. The same is also how things work on Windows (and thus Wine really). Wine won't be able to run a binary that links to some random libpng or whatever that the compiler found in your System32. The only difference is that Microsoft makes an SDK that gives your some idea of whats a system library you can rely on as well as the ability to target older versions than the system you are building on. The latter can be done on Linux as well but there is no-pre made SDK so the easiest solution ends up being a VM or chroot with older libraries.
AFAIK Wine will run 16-bit applications just fine now, through WoW64.
It depends. I've found for example, if i compile on Ubuntu or Debian, it will probably work on any Ubuntu, Debian, or Debian-based distro released at or newer than the one I compiled it on. There are other cross-compatible examples.
More broadly, there are things like manylinux and MUSL which allow cross-distro applications.
Containers fix this.
As long as the container bundles the right libc, the program should work.
I agree - the model I use for why containers (Docker etc) exist is to abstract over Linux ABI incompatibility. I don't think they're a great solution, as it complicates software distribution. I should be able to distribute an executable and have it just work.
4 replies →
Just like Python venv, The system is too broken that it's the only real practical fix