]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
The dlpreopen pass over libraries reverses the elements in the
authorAndreas Schwab <schwab@suse.de>
Wed, 22 Sep 2004 22:46:12 +0000 (22:46 +0000)
committerGary V. Vaughan <gary@gnu.org>
Wed, 22 Sep 2004 22:46:12 +0000 (22:46 +0000)
$deplibs list.  This causes problems when the link pass tries to
find libraries when they are located in non-standard places
denoted by -L options.  Due to the reversed order these -L options
occur after the libraries that need them, and they are not found:

* config/ltmain.in: (Un)Reverse $deplibs list at the start of the
link pass in lib mode.

ChangeLog
config/ltmain.in

index 418885f3bbb8873cbcf7141e66d9609662c63c1f..95169080db374fc68ef154eb66f5261888b7e808 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2004-09-22  Andreas Schwab  <schwab@suse.de>
+
+       The dlpreopen pass over libraries reverses the elements in the
+       $deplibs list.  This causes problems when the link pass tries to
+       find libraries when they are located in non-standard places
+       denoted by -L options.  Due to the reversed order these -L options
+       occur after the libraries that need them, and they are not found:
+
+       * config/ltmain.in: (Un)Reverse $deplibs list at the start of the
+       link pass in lib mode.
+
 2004-09-22  Charles Wilson  <cwilson@spam.protected>
 
        * ltmain.in (func_generate_dlsyms) [cygwin, mingw]: when creating
index 69ed2f04650e7decba287e8bc9749b2e649dc7ec..dfe41b45418e43686db4f68a434d4dae6fedf0d4 100644 (file)
@@ -3289,6 +3289,18 @@ func_mode_link ()
     esac
 
     for pass in $passes; do
+      # The preopen pass in lib mode reverses $deplibs; put it back here
+      # so that -L comes before libs that need it for instance...
+      if test "$linkmode,$pass" = "lib,link"; then
+       ## FIXME: Find the place where the list is rebuilt in the wrong
+       ##        order, and fix it there properly
+        tmp_deplibs=
+       for deplib in $deplibs; do
+         tmp_deplibs="$deplib $tmp_deplibs"
+       done
+       deplibs="$tmp_deplibs"
+      fi
+
       if test "$linkmode,$pass" = "lib,link" ||
         test "$linkmode,$pass" = "prog,scan"; then
        libs="$deplibs"