libtool-patches
[Top][All Lists]
Advanced

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

fix order of -L flags added for libtool dep libs


From: Alexandre Oliva
Subject: fix order of -L flags added for libtool dep libs
Date: 04 Apr 2005 15:44:03 -0300
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Consider the following scenario:

We're building a package that introduces libraries libA and libB, such
that libA links with libB, and both link with a pre-installed libtool
library /old/libC.la

A previous version of the package is already installed, providing
older, incompatible versions of libA and libB in say /old

For this build, we're installing libA and libB in a separate location,
say /new.


The problem here is that, when we relink libA for installation, we
start with tmp_libs="-lB -L/new" (it's in reverse order), and then we
add prepend -lC but *append* -L/old to tmp_libs.  Later on, when we
de-reverse it, we end up searching -L/old before -L/new, so we try to
link with the old -lB, and fail.

This patch, for the 1.5 branch, fixes the problem.  Ok to install?


The scenario above was actually made up, but an original scenario
involving staged installs actually came up at
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=132435


Index: ChangeLog
from  Alexandre Oliva  <address@hidden>

        * ltmain.in (link mode): Add to tmp_libs paths for libtool dep
        libs in reverse order as well.

Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltmain.in,v
retrieving revision 1.334.2.65
diff -u -p -r1.334.2.65 ltmain.in
--- ltmain.in 16 Mar 2005 17:31:02 -0000 1.334.2.65
+++ ltmain.in 4 Apr 2005 18:32:10 -0000
@@ -2872,7 +2872,7 @@ EOF
              esac
              case " $deplibs " in
              *" $path "*) ;;
-             *) deplibs="$deplibs $path" ;;
+             *) deplibs="$path $deplibs" ;;
              esac
            done
          fi # link_all_deplibs != no
-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   address@hidden, gcc.gnu.org}
Free Software Evangelist  address@hidden, gnu.org}

reply via email to

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