GNU bug report logs - #9223
Random (re)-linking order

Previous Next

Package: libtool;

Reported by: Elias Pipping <pipping <at> lavabit.com>

Date: Tue, 2 Aug 2011 18:00:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Elias Pipping <pipping <at> lavabit.com>
To: 9223 <at> debbugs.gnu.org
Subject: bug#9223: Random (re)-linking order
Date: Tue, 02 Aug 2011 19:17:36 +0200 (CEST)
Hello,

I have gnutls 2.10.5 installed which provides
/usr/lib64/libgnutls.so.26.

I'm trying to install gnutls 3.0.0 which will provide
/usr/lib64/libgnutls.so.28.

To that end, I run

  % ./configure --prefix=$HOME/tmp \
      --without-p11-kit \
      --enable-openssl-compatibility
  % make
  % make install

Note that --enable-openssl-compatibility is actually the default.

Once `make` finishes to run, I'll have a
libextra/.libs/libgnutls-openssl.so.

Calling `readelf -d` on this file will reveal that it was correctly
linked against the newly built version of gnutls:

  0x0000000000000001 (NEEDED)             Shared library: [libgnutls.so.28]

Here's how that file was created:

  libtool: link: gcc -std=gnu99 -shared  .libs/gnutls_openssl.o \
    .libs/openssl_compat.o  -Wl,--whole-archive ../gl/.libs/libgnu.a \
    -Wl,--no-whole-archive  -Wl,-rpath -Wl,/usr/lib64 -Wl,-rpath \
    -Wl,/home/pipping/gnutls-3.0.0/lib/.libs -Wl,-rpath -Wl,/usr/lib64 \
    -Wl,-rpath -Wl,/home/pipping/tmp/lib /usr/lib64/libtasn1.so -lrt \
    ../lib/.libs/libgnutls.so    -Wl,-soname -Wl,libgnutls-openssl.so.27 \
    -o .libs/libgnutls-openssl.so.27.0.0

However, during installation, the following will happen:

  libtool: relink: gcc -std=gnu99 -shared  .libs/gnutls_openssl.o \
    .libs/openssl_compat.o  -Wl,--whole-archive ../gl/.libs/libgnu.a \
    -Wl,--no-whole-archive  -Wl,-rpath -Wl,/usr/lib64 -Wl,-rpath \
    -Wl,/home/pipping/tmp/lib -L/usr/lib64 -ltasn1 -lrt \
    -L/home/pipping/tmp/lib -lgnutls \
    -Wl,-soname -Wl,libgnutls-openssl.so.27 \
    -o .libs/libgnutls-openssl.so.27.0.0

Calling `readelf -d` on the installed libgnutls-openssl.so will reveal

 0x0000000000000001 (NEEDED)             Shared library: [libgnutls.so.26]

This should not happen. This is in particular a problem if I set
DESTDIR, then removed the old version of gnutls and moved the contents
of DESTDIR to '/' as is commonly done. My installation of gnutls would
then be broken.


Best regards,

Elias Pipping





This bug report was last modified 13 years and 345 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.