2

I compiled Apache httpd on CentOS 6.x. Works fine there.

Then I moved the binary files to CentOS 7. I needed to install some missing libraries and now works fine there.

Then I moved the binary files to Archlinux. As I expected it did not started directly:

httpd: symbol lookup error: /software_pack/httpd-2.2.25/lib/libapr-1.so.0: undefined symbol: dlopen

However, if I do ldd /software_pack/httpd-2.2.25/lib/libapr-1.so.0 it gives different results on CentOS and Archlinux. On Archlinux, libdl.so is not shown at all?

Where from CentOS knows the file needs libdl.so.2 ?

CentOS 6.x:

# ls -la /software_pack/httpd-2.2.25/lib/libaprutil-1.so.0
lrwxrwxrwx 1 root root 21 Jul 30 09:47 /software_pack/httpd-2.2.25/lib/libaprutil-1.so.0 -> libaprutil-1.so.0.5.2
# ldd /software_pack/httpd-2.2.25/lib/libaprutil-1.so.0.5.2
        linux-vdso.so.1 =>  (0x00007fffec400000)
        libexpat.so.0 => /software_pack/httpd-2.2.25/lib/libexpat.so.0 (0x00007f5ec94d8000)
        libapr-1.so.0 => /software_pack/httpd-2.2.25/lib/libapr-1.so.0 (0x00007f5ec92a8000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f5ec9098000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f5ec8e60000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f5ec8c40000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f5ec88a8000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f5ec9928000)
        libfreebl3.so => /lib64/libfreebl3.so (0x00007f5ec8630000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f5ec8428000)   <<<<<<<< Missing in arch

On Archlinux:

# ls -la /software_pack/httpd-2.2.25/lib/libaprutil-1.so.0
lrwxrwxrwx 1 root root 21 Jul 30 10:47 /software_pack/httpd-2.2.25/lib/libaprutil-1.so.0 -> libaprutil-1.so.0.5.2
# ldd /software_pack/httpd-2.2.25/lib/libaprutil-1.so.0.5.2
        linux-vdso.so.1 (0x00007fff7cdd3000)
        libexpat.so.0 => /software_pack/httpd-2.2.25/lib/libexpat.so.0 (0x00007f5aef4e7000)
        libapr-1.so.0 => /software_pack/httpd-2.2.25/lib/libapr-1.so.0 (0x00007f5aef2ba000)
        librt.so.1 => /usr/lib/librt.so.1 (0x00007f5aef084000)
        libcrypt.so.1 => /usr/lib/libcrypt.so.1 (0x00007f5aeee4b000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f5aeec2d000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007f5aee87f000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x00007f5aef934000)
fuero
  • 9,879
Nick
  • 902

1 Answers1

3

dlopen is normally provided by libdl.so.2. On Arch Linux libdl.so.2 is provided by glibc package. It would be very strange if you didn't have glibc installed, but anyway, check if you have libdl.so.2 on your system.

You can also use readelf command to output a symbol table for a shared object and check if particular symbol is exported:

readelf -Ws /usr/lib/libdl.so.2

Some info on why ldd output for the same binary may differ on different systems can be found here:

https://stackoverflow.com/questions/12714219/ldd-different-output-same-binary-different-distros

grekasius
  • 2,066