Re:Building Outer Wonders for Linux
by AnIdiotOnTheNet on Sunday May 23, 2021 @09:24AM
(#27254851)
Is there a way to do that for every symbol? I'm asking because from what I've read from developers the only reliable way to do this is to compile on an old distribution with an old libc. So either there are problems with using this method or it is very poorly documented.
I haven't found a way, although I never had the need. I remember you could compile your software targeting a specific LSB release, and there were some tools to do that, but I don't know if it would be the same.
For example, if you wanted to make your program use the "realpath" version from glibc 2.0, instead of the current one, you could do something like this:
__asm__(".symver realpath,realpath@GLIBC_2.0");
So, even if the glibc version in the build system is more modern (lets say 2.3), your code will also work with older ones, such as 2.0.