I need to deploy my shared library (.so) in an ancient linux distro (CentOS 6.5).
The problem is that I'm actually compiling my code using CentOS 7 (gcc 4.8.2) and the libc versions are different.
My code depends on the GLIBC 2.14, however, the newest GLIBC version at CentOS 6.5 is 2.13.
I would like to use the RPATH mechanism and deploy the libc files along with the shared library file (.so).
Is this even possible?
What I did so far
I've created a directory containing:
$ ls
ld-linux-x86-64.so.2 libc.so.6 libgcc_s.so.1 libm.so.6 libstdc++.so.6
-static-libgcc and -static-libstdc++
These help with the problem of GLIBCXX. However, the GLIBC version problem remains:
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by sss_reactions/libsss_reactions.so)
--rpath and --dynamic-linker
Using the readelf
utility I saw that the RPATH was correctly set, and calling ldd
on the library also points to the correct directory (containing the newer libc).
However, when I try to load the library with dlopen()
I get the same error:
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by sss_reactions/libsss_reactions.so)
Setting LD_LIBRARY_PATH
In this case, I get this error:
$ LD_LIBRARY_PATH=../dist/ ./Dlopen
./Dlopen: relocation error: ../dist/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference