libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libtool setting DT_RPATH in .libs/lt-foo binaries


From: Roger Leigh
Subject: libtool setting DT_RPATH in .libs/lt-foo binaries
Date: Sat, 20 Dec 2003 19:19:01 +0000
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

I have found an odd problem with libtool, which I'm unsure is possible
to work around.  The problem is with libtool 1.4.3, used in the
Gimp-Print stable branch (our development branch is using the latest
libtool, which I have yet to test).

One of the programs built is run during the build to generate some
data files.  This uses a shared library, libgimpprint.la, built
previously in the same build.  In some situations, the library in the
build tree is not used, since a version installed on the system is
used in preference.

After some hunting, this is because DT_RPATH is set incorrectly in the
binary:

objdump -p gives:
  NEEDED      libgimpprint.so.1
  RPATH       /tmp/gimp-print-4.2.6-rc2/src/main/.libs:/usr/local/lib

This is OK.

This is broken though:
  NEEDED      libgimpprint.so.1
  RPATH       /usr/lib:/tmp/gimp-print-4.2.6-rc2/src/main/.libs:/usr/local/lib


/usr/lib has been hard-coded into the DT_RPATH!  This is because the
program was linked with the output of `cups-config --image --libs`:

  -lcupsimage -ltiff -ljpeg -lpng -lm -lz -lcups -L/usr/lib -lgnutls -lnsl
                                                 ^^^^^^^^^^
On older systems which don't have '-L/usr/lib' the problem is not seen.

$ grep CUPS_LIBS config.status
address@hidden@%-Wl,-rpath,/usr/lib -lcupsimage -ltiff -ljpeg -lpng -lm -lz 
-lcups -L/usr/lib -lgnutls -lnsl%g
$ grep CUPS_LIBS src/cups/Makefile
CUPS_LIBS = -Wl,-rpath,/usr/lib -lcupsimage -ltiff -ljpeg -lpng -lm -lz -lcups 
-L/usr/lib -lgnutls -lnsl
            ^^^^^^^^^^^^^^^^^^^
Here something (I assume libtool) has taken it into its head to put
/usr/lib in the RPATH.  Is there any way to prevent this?


Unfortunately, we're stuck with libtool 1.4.3 for the stable series,
but this is the last 4.2 stable release we're going to make.  The
problem has only become apparent with recent versions of CUPS, which
started putting '-L/usr/lib' in the cups-config output.

I would be very grateful for any suggestions you might have.


Many thanks,
Roger

-- 
Roger Leigh

                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]