libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] ltmain.in: defer warn dependency to static library


From: Alexandre Janniaux
Subject: [PATCH 2/2] ltmain.in: defer warn dependency to static library
Date: Tue, 6 Apr 2021 10:22:15 +0200

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.
---
 build-aux/ltmain.in | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index d172deae..ecd9a5a0 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -5891,9 +5891,11 @@ func_mode_link ()
                ;;
              esac
              if $valid_a_lib; then
-               echo
-               $ECHO "*** Warning: Linking the shared library $output against 
the"
-               $ECHO "*** static library $deplib is not portable!"
+               if test yes != "$build_old_libs"; then
+                       echo
+                       $ECHO "*** Warning: Linking the shared library $output 
against the"
+                       $ECHO "*** static library $deplib is not portable!"
+               fi
                deplibs="$deplib $deplibs"
              else
                echo
-- 
2.31.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]