FreeBSD has a system of compatibility layers through its
compat packages that install older versions of libraries in a special directory. I’m not super familiar with how this works in practice, like how you’d tell the linker to get those packages instead of later ones, but there’s probably a way. The issue with doing this on Linux (or any POSIX system) is that when you load a binary, the first thing that gets loaded into its address space is libc, not the actual program. This is why sometimes even containerized formats will fail to run, bc they depend on the wrong version of libc and getting the system to use a different libc for a specific program is difficult. I’m not sure what the FreeBSD solution to this is, perhaps it’s to maintain an ultrastable libc ABI, or maybe they’ve figured out how to force their system to switch libcs without much hassle.