]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Allow statically linking compiler support libraries when linking a library
authorMartin Storsjö <martin@martin.st>
Mon, 19 Aug 2019 10:34:51 +0000 (13:34 +0300)
committerIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Mon, 19 May 2025 16:40:01 +0000 (19:40 +0300)
For cases with deplibs_check_method="file_magic ..." (as it is for mingw),
there were previously no way that a static library could be accepted
here.

build-aux/ltmain.in

index a948158edb0c58d85a9b9d546b8df3ded0de8331..38b56a71118df65c7c6987e4de7513b8633adffb 100644 (file)
@@ -6101,8 +6101,15 @@ func_mode_link ()
          fi
          case $linkmode in
          lib)
-           # Linking convenience modules into shared libraries is allowed,
-           # but linking other static libraries is non-portable.
+           # Linking convenience modules and compiler provided static libraries
+           # into shared libraries is allowed, but linking other static
+           # libraries is non-portable.
+           case $deplib in
+             */libgcc*.$libext | */libclang_rt*.$libext)
+               deplibs="$deplib $deplibs"
+               continue
+             ;;
+           esac
            case " $dlpreconveniencelibs " in
            *" $deplib "*) ;;
            *)