I am working on creating an AppImage for postgres.
I've found all the dynamic libraries it uses and placed them in a custom folder and run postgres prefixed with LD_LIBRARY_PATH=/data2/root/usr/lib/aarch64-linux-gnu:/data2/root/lib/aarch64-linux-gnu
It works great for some libraries, for example:
Quote:
51: find library=liblber-2.4.so.2 [0]; searching
51: search path=/data2/root/usr/lib/aarch64-linux-gnu:/data2/root/lib/aarch64-linux-gnu (LD_LIBRARY_PATH)
51: trying file=/data2/root/usr/lib/aarch64-linux-gnu/liblber-2.4.so.2
|
I can see ld is searching for libraries and using the ones in my custom folder /data2/root/...
however it's not working with libm.so.6 and ends up using the system library for this instead, which doesn't work on older distros (buster):
Quote:
/lib/aarch64-linux-gnu/libm.so.6: error: version lookup error: version `GLIBC_2.29' not found (required by /data2/root/usr/lib/postgresql/12/bin/postgres) (continued)
/data2/root/usr/lib/postgresql/12/bin/postgres: /lib/aarch64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /data2/root/usr/lib/postgresql/12/bin/postgres)
|
When I run the command with LD_DEBUG=libs I get this:
Quote:
50: find library=libm.so.6 [0]; searching
50: search path=/data2/root/usr/lib/aarch64-linux-gnu:/data2/root/lib/aarch64-linux-gnu (LD_LIBRARY_PATH)
50: trying file=/data2/root/usr/lib/aarch64-linux-gnu/libm.so.6
50: trying file=/data2/root/lib/aarch64-linux-gnu/libm.so.6
50: search cache=/etc/ld.so.cache
50: trying file=/lib/aarch64-linux-gnu/libm.so.6
|
which is quite strange because you can see ld is looking at my provided copy of libm.so,
/data2/root/lib/aarch64-linux-gnu/libm.so.6, but its skipping it even though (when I run this on bullseye which is where I sourced libm.so from) you can see it both exists and is identical to the system one:
Quote:
root@95ebc03dd154:/# md5sum /data2/root/lib/aarch64-linux-gnu/libm.so.6
d2aa3efcdac8c0c00393ec248dfbf264 /data2/root/lib/aarch64-linux-gnu/libm.so.6
root@95ebc03dd154:/# md5sum /lib/aarch64-linux-gnu/libm.so.6
d2aa3efcdac8c0c00393ec248dfbf264 /lib/aarch64-linux-gnu/libm.so.6
|
So my question here is, why is it the case that ld is skipping over the libm.so I provide and falling back to the system one? Even if I move libm.so from bullseye to buster directly and overwrite /lib/aarch64-linux-gnu/libm.so.6 it appears that ld will even start ignoring /lib/aarch64-linux-gnu/libm.so.6 and say the module isn't found.