Compiling GnuPG XI: Libraries II

fmg Wednesday March 26, 2025

Situation

Last time we showed information related to dynamic libraries. This time we continue and show more to compare. Again: let's see which libraries are used by the compiled binaries (some irrelevant hex numbers are removed from the output):

Distribution Compiled
Copy to clipboard
$ ldd /usr/bin/gpg linux-vdso.so.1 (...) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (...) libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (...) libgcrypt.so.20 => /usr/lib/x86_64-linux-gnu/libgcrypt.so.20 (...) libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (...) libreadline.so.8 => /lib/x86_64-linux-gnu/libreadline.so.8 (...) libassuan.so.0 => /usr/lib/x86_64-linux-gnu/libassuan.so.0 (...) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (...) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (...) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (...) libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (...) /lib64/ld-linux-x86-64.so.2 (...)

This is considered to be the reference output.

Native Compiled & Location Changed
Copy to clipboard
$ mkdir /tmp/newlocation $ rsync -a /tmp/canary/native/ /tmp/newlocation/ $ ldd /tmp/newlocation/bin/gpg linux-vdso.so.1 (...) libz.so.1 => /tmp/newlocation/bin/../lib/libz.so.1 (...) libgcrypt.so.20 => /tmp/newlocation/bin/../lib/libgcrypt.so.20 (...) libassuan.so.9 => /tmp/newlocation/bin/../lib/libassuan.so.9 (...) libnpth.so.0 => /tmp/newlocation/bin/../lib/libnpth.so.0 (...) libgpg-error.so.0 => /tmp/newlocation/bin/../lib/libgpg-error.so.0 (...) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (...) /lib64/ld-linux-x86-64.so.2 (...)

This looks good - the only thing missing for usage is the path change in the file gpgconf.ctl. We have something portable, but there are things missing.

The libsqlite3 isn't listed in the self compiled versions. But in the native compiled lib/ folder it is available. This is odd. Does this mean it is used? Or just provided? Does the native compile method need additional configuration? The libbz2 is missing, too. Maybe this can be fixed by installing the distribution package libbz2-dev.

The testing part is quite time consuming since there are some things handled by configuration options and other things by environment variables.

To be continued...


Permalink: https://blog.shimps.org/blogpost406-Compiling-GnuPG-XI-Libraries-II