]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
ltmain.in: defer warn dependency to static library
authorAlexandre Janniaux <ajanni@videolabs.io>
Fri, 2 Apr 2021 11:14:41 +0000 (13:14 +0200)
committerIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Thu, 21 May 2026 18:07:31 +0000 (21:07 +0300)
When linking old library to any libtool target that is not an
executable, libtool warns that it might not be portable, in particular
because shared libraries need PIC from the static library to be working.

However, when adding an old library as dependency to a static libtool
library, there is no linkage, and thus no portability issue, so there's
no reason to warn. If the static libtool library is then linked to a
shared library, the dependency will be forwarded and the warning will
happen at this time.

Reported: https://savannah.gnu.org/patch/?10569

build-aux/ltmain.in

index 7947a3bf601a9314199d010030cba94967555666..e874b44a0a7e7eb59ce20c98c96a31867826bb45 100644 (file)
@@ -6246,7 +6246,9 @@ func_mode_link ()
                ;;
              esac
              if $valid_a_lib; then
-               func_warning "Linking the shared library $output against the static library $deplib is not portable!"
+               if test yes != "$build_old_libs"; then
+                 func_warning "Linking the shared library $output against the static library $deplib is not portable!"
+               fi
                deplibs="$deplib $deplibs"
              else
                func_warning "Trying to link with static lib archive $deplib."