]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtool.m4: Fix postdeps in NetBSD
authorAnthony Mallet <anthony.mallet@laas.fr>
Sun, 23 Mar 2025 12:56:14 +0000 (13:56 +0100)
committerIleana Dumitrescu <ileanadumitrescu95@gmail.com>
Fri, 28 Mar 2025 16:34:16 +0000 (18:34 +0200)
commit:c7be1f229 addresses an issue with building C++ modules on NetBSD, by
removing -lgcc_s and -lgcc. This may sometimes not work correctly, depending
on the architecture, as libgcc_s.so and libgcc.a may contain required code to
properly link the shared object. On NetBSD, libgcc.a is compiled with -fPIC
and can be linked to a shared object without any issue.

Reported: https://savannah.gnu.org/support/index.php?111210

m4/libtool.m4

index 434f9ba72e1cdb830f51dd4cbf6e32f76f7252e9..dd665d10b790d1b25e50f609d60a93574546b576 100644 (file)
@@ -7313,9 +7313,11 @@ if test yes != "$_lt_caught_CXX_error"; then
          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
          _LT_TAGVAR(hardcode_direct, $1)=yes
          _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       else
+         _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
        fi
-       # Workaround some broken pre-1.5 toolchains
-       output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:--as-needed -lgcc_s --no-as-needed -lgcc -lc --as-needed -lgcc_s --no-as-needed -lgcc::"'
+       output_verbose_link_cmd=func_echo_all
        ;;
 
       *nto* | *qnx*)