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.
This commit is contained in:
Andreas Schwab 2004-09-22 22:46:12 +00:00 committed by Gary V. Vaughan
parent 8c7eb9e5c9
commit a2ad2dce32
2 changed files with 23 additions and 0 deletions

View File

@ -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

View 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"