From: Andreas Schwab Date: Wed, 22 Sep 2004 22:46:12 +0000 (+0000) Subject: The dlpreopen pass over libraries reverses the elements in the X-Git-Tag: release-1-9d~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2ad2dce324d514a617b94e352fac9e488457c78;p=thirdparty%2Flibtool.git 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. --- diff --git a/ChangeLog b/ChangeLog index 418885f3b..95169080d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-09-22 Andreas Schwab + + 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 * ltmain.in (func_generate_dlsyms) [cygwin, mingw]: when creating diff --git a/config/ltmain.in b/config/ltmain.in index 69ed2f046..dfe41b454 100644 --- a/config/ltmain.in +++ b/config/ltmain.in @@ -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"