Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version GLIBC_2.2.5 not defined in file libc.so.6 #486

Closed
git801 opened this issue Mar 21, 2023 · 2 comments
Closed

version GLIBC_2.2.5 not defined in file libc.so.6 #486

git801 opened this issue Mar 21, 2023 · 2 comments

Comments

@git801
Copy link

git801 commented Mar 21, 2023

I would like to run a test tool (i have no source code) that complied with GLIBC 2.17 on a host that GLIBC 2.12,
from this question I learned to use "readelf" to change GLIBC 2.17 to 2.2.5 ,
and i learned to use "patchelf" to Add a declared dependency on a dynamic library,
because in the old version of glibc clock_gettime is provided by the librt library, and also version 2.2.5

patchelf --add-needed librt.so.1 libpython3.6m.so.1.0

I thought it would solve every issue but no, there was again one more issue:

[58454] Error loading Python lib '/home/jhon/Desktop/test/libpython3.6m.so.1.0': dlopen: /home/jhon/Desktop/test/libpython3.6m.so.1.0: symbol clock_gettime, version GLIBC_2.2.5 not defined in file libc.so.6 with link time reference

But I do have this after patchelf:

1

I couldn't find any useful information online, except this page.

I'm using Cent OS 6.10.

If anyone has any clue, I would highly appreciate it. Thank you.

@git801
Copy link
Author

git801 commented Mar 21, 2023

readelf -sV libc.so.6 result :

3

in '.gnu.version' and '.dynsym' ,there are mayn GLIBC_2.2.5, but in '.gnu.version_r' no GLIBC_2.2.5

@Mic92
Copy link
Member

Mic92 commented Apr 23, 2023

librt.so is part of the glibc. You cannot only replace librt as it will be not be compatible with the old glibc on the system. You would need to ship also install glibc 2.17 on the machine where you want to run this program and than do something like this: yournew-libc/ld-linux-x86-64.so.2 yourbinary (this can be also done by setting the interpreter path in the binary).
I provide more information about what the elf interpreter does in this article: https://blog.thalheim.io/2022/12/31/nix-ld-a-clean-solution-for-issues-with-pre-compiled-executables-on-nixos/

@Mic92 Mic92 closed this as completed Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants