Transfer shared library to another version of libc

I have a shared linux library (.so) compiled with a specific version of libc (GLIBC2.4) and I need to use it on a system with a different version of libc. I have no sources for the library, so I can not recompile the new system. Is there any way to change the dependencies in this library to another libc?

+2
source share
3 answers

If you need .so on a system with old glibc, you will need the source code and recompile / reinstall it with the old glibc. An alternative is to install the required glibc on the old system in a non-standard location and configure LD_LIBRARY_PATH for the executable that needs this .so

If there is a newer glibc, this will usually not be a problem, since glibc tends to be backward compatible.

+2
source

If your library really uses interfaces that have been changed (unlikely), you can simply specify version links in the resulting file .so. In any case, this is text.

+3
source

It is best to compile the old version of glibc for your system and then build the application using this glibc and your shared library. Ugly though ...

+1
source

Source: https://habr.com/ru/post/1759751/


All Articles