(unknown)

Ileana Dumitrescu <[email protected]> Fri, 15 May 2026 14:26:04 -0400 (EDT)
Newsgroups gmane.comp.gnu.libtool.cvs
Message-ID <[email protected]>
branch: development
commit f3845d561c054ac66c85ef91e6ddf51228f9e146
Author: Anthony Mallet <[email protected]>
AuthorDate: Thu May 7 00:20:33 2026 +0300

    ltmain.in: overlinking dependency_libs when linking against a libtool library
    
    On NetBSD, linking a shared lib A with a libtool shared library B always
    adds B's dependency to the dependencies of A, which is wrong on ELF systems.
    
    Reported: https://savannah.gnu.org/support/?111406
    
    * build-aux/ltmain.in: Move section of code to avoid overlinking
      dependency_libs on ELF systems.
---
 build-aux/ltmain.in | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index 3c30492b..45e0668f 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -6347,19 +6347,19 @@ func_mode_link ()
 	    # It is a libtool convenience library, so add in its objects.
 	    func_append convenience " $ladir/$objdir/$old_library"
 	    func_append old_convenience " $ladir/$objdir/$old_library"
+	    tmp_libs=
+	    for deplib in $dependency_libs; do
+	      deplibs="$deplib $deplibs"
+	      if $opt_preserve_dup_deps; then
+	        case "$tmp_libs " in
+	          *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+	        esac
+	      fi
+	      func_append tmp_libs " $deplib"
+	    done
 	  elif test prog != "$linkmode" && test lib != "$linkmode"; then
 	    func_fatal_error "'$lib' is not a convenience library"
 	  fi
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    deplibs="$deplib $deplibs"
-	    if $opt_preserve_dup_deps; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
-	      esac
-	    fi
-	    func_append tmp_libs " $deplib"
-	  done
 	  continue
 	fi # $pass = conv