But to link against an old glibc version, you need to compile on an old distro, on a VM. And you'll have a rough time if some part of the build depends on a tool too new for your VM. It would be infinitely simpler if one could simply 'cross-compile' down to older symbol versions, but the tooling does not make this easy at all.
It's actually doable without an old glibc as it was done by the Autopackage project: https://github.com/DeaDBeeF-Player/apbuild
That never took off though, containers are easier. Wirh distrobox and other tools this is quite easy, too.
> It would be infinitely simpler if one could simply 'cross-compile' down to older symbol versions, but the tooling does not make this easy at all.
It's definitely not easy, but it's possible: using the `.symver` assembly (pseudo-)directive you can specify the version of the symbol you want to link against.
Huh? Bullshit. You could totally compile and link in a container.
Check out `zig cc`. It let's you target specific glibc versions. It's a pretty amazing C toolchain.
https://andrewkelley.me/post/zig-cc-powerful-drop-in-replace...