libtool-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] change order of -L options when relinking


From: Charles Wilson
Subject: Re: [PATCH] change order of -L options when relinking
Date: Fri, 31 Oct 2003 13:57:16 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624

Hallelujah!  This fixes the problem demonstrated by the testcase here:
http://mail.gnu.org/archive/html/libtool/2003-05/msg00022.html

--
Chuck


Scott James Remnant wrote:
Now I've got the copyright assignment paperwork out of the way, it's
time to provide all the patches I've written for Debian's libtool
package and see if we can get into sync.

I'm going to provide the patches against CVS HEAD rather than the 1.5
release, on the basis that these should probably be destined for there
rather than branch-1-5 anyway.

First up, a simple patch to change the order that the -L options are
constructed when relinking so that $add_dir is put before the directory
with the $inst_prefix rather than after it.

This fixes a problem where you have a program depending on a shared
library from within the same source tree, you have an OLDER version of
that shared library on the system already and you install the newer
version using a prefix= or DESTDIR= diversion.

Libtool currently supplies "-L/tmp/usr/lib -L/usr/lib -lfoo" to the
linker, which means the linker will actually pick up /usr/lib/libfoo.so
-- the OLDER version of the shared library.  If this library has
different dependencies, things can go very wrong indeed.

The patch changes the order to "-L/usr/lib -L/tmp/usr/lib -lfoo"
instead, which causes /tmp/usr/lib/libfoo.so to be picked up, the right
version.

The origin of this patch is myself, after figuring out was wrong with a
large number of (mostly GNOMEish) packages.  It turns out that the patch
is identical to one RedHat use as well, so it must be doing the right
thing for both of us.





reply via email to

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