Jus test for < 2.34
[...]
All possible solution mentions loading libc and use get_version_number
[...]
and therein lies the problem - you need to load libc in order to get the version number, but you
need to know the version number
before you load libc!
i have come up with a solution that can work around this, but it is
very very ugly. you have a compressed binary of your application, and a difference file (also compressed) that allows patching the (once uncompressed) binary from 2.2.5 compatible to 2.34 compatible. these are both bundled up into a simple console application (with no libc dependencies) that unpacks the original into /tmp and decompresses it, then decides which version you need and if required applies the patch before running the binary from /tmp. it actually works pretty well, is transparent to the user, but requires quite a bit of work to put together.
also Fred vS has now got a patched version of FPC that can generate GLIBC_2.2.5 versioned binaries without need for fake libraries or any other tricks:
https://github.com/fredvs/freepascal-ootbit
appears that there is something 'odd' in
external that has thwarted efforts to simply specify the GLIBC version for symbols, i'm moving towards thinking it is a bug that creates an incompatibility with the way that GLIBC 2.34 and later structure the
/lib/x86_64-linux-gnu directory. basically there is a
libdl.so.2 placeholder library file in there, but FPC can not 'see' it. if renamed to
libdl.so then all is well from the FPC perspective and introducing versioned symbols is easy.
looking at an
old linux (Mint 19.3, GLIBC 2.27) it seems there may
never have been a
libdl.so file or symlink, which leaves me a little surprised that the linux related code in dl.pp
ever worked as intended.
now one could just hack the
/lib/x86_64-linux-gnu directory, but that is a rather impolite thing to do and may break things elsewhere in GLIBC.
cheers,
rob :-)