Tue 25 Sep 2012 01:16:48 AM UTC, original submission:
Suppose we have a Gentoo Linux amd64 system. We have gnutls-2.12.20 installed. We are now upgrading it to gnutls-3.1.1. It is ./configure'd with --prefix=/usr --libdir=/usr/lib64 parameters, that is, system paths are specified. When build, it's make install'ed with DESTDIR=/var/tmp/directory. First is libgnutls.so.28 installed, and when installing libgnutls-openssl.so, libtool relinks to, as usual. And because -L/usr/lib64 -ltasn1 is specified in lib_LDFLAGS instead of lib_LIBADD, it is placed before -L/var/tmp/directory/usr/lib64 -lgnutls in the command line. So for -lgnutls system installation of libgnutls.so is picked up, instead of the new one, that is, libgnutls.so.26 instead of libgnutls.so.28. We need to rebuild gnutls to get a working libgnutls-openssl.so.
So external libraries (libtasn1 here) need to be placed in lib_LIBADD to maintain correct order. Furthermore, within lib_LIBADD libtool objects need to be specified before external libraries (specifically, before any -L/some/path options).
I'm attaching two patches:
1) gnutls-3.1.1-libadd-minimal.patch -- this patch fixes only this specific bug.
2) gnutls-3.1.1-libadd-complete.patch -- this patch contains the above patch, and moves all external libraries that were in LDFLAGS into LIBADD/LDADD, and fixes order within LIBADD/LDADD so that libtool objects go first. It looks invasive, and although it's pretty simple, it might break something, especially on win32. I tested it (only) on Linux.
|