I am compiling on a machine with GLIBC_2.27
(Ubuntu 18.04) a shared library to be loaded on a machine with GLIBC_2.17
(Centos 7). While essentially every other library can be linked statically into my shared library, glibc cannot. So, I scanned the library with readelf
for references to GLIBC_2.27 and rewrote every function linked to it. That was successful for every function except for glob@GLIBC_2.27
. I do not call glob()
explicitly. How do I find which function or library called glob()
?
Asked
Active
Viewed 388 times
0

KevinZ
- 3,036
- 1
- 18
- 26
-
1I have no idea if this works, but what if you ran the program in `gdb`, put a breakpoint on `glob()` and get the backtrace (`bt`) from there? – Justin Sep 07 '18 at 16:58
-
3I would strongly suggest you just compile your shared library on the OS (CentOS 7) you need to use it instead of Ubuntu - this will save you a lot of pain and time. – nos Sep 07 '18 at 17:06
-
2Get yourself a Docker and then (even possibly **older**) Centos image and build your image there. This is actually how many many Python C extensions for Linux are built [(manylinux)](https://github.com/pypa/manylinux). – Antti Haapala -- Слава Україні Sep 07 '18 at 17:20
-
@AnttiHaapala The docker solution worked perfectly. – KevinZ Sep 23 '18 at 18:26
-
1@KevinZ then you should write an answer about it :D (and modify the question slightly - not how to tell which library called, but how to compile :D) – Antti Haapala -- Слава Україні Sep 23 '18 at 18:41
-
@AnttiHaapala I changed the question name. If you repost your comment as an answer, I will accept it, because I have nothing significant to add to your answer. It was a linking issue to begin with. – KevinZ Sep 23 '18 at 18:50
-
@KevinZ but I don't know how *you* did it :D – Antti Haapala -- Слава Україні Sep 23 '18 at 19:06