Skip to content
Snippets Groups Projects
Commit dca039cf authored by Sergey Kosukhin's avatar Sergey Kosukhin
Browse files

Add a Libtool patch from Debian that prevents implicit overlinking.

parent ca514a1d
No related branches found
No related tags found
No related merge requests found
......@@ -33,20 +33,19 @@ cd "$script_dir"
autoreconf -fvi || exit $?
# The following is not needed as long as we do not patch libtool.m4:
# # Patch libtool.m4:
# for patch in \
# ; do
# echo "applying $patch"
# patch -p 1 --no-backup-if-mismatch --forward -r - -i $patch -d .
# # The program 'patch' exits with exitcode=1 if the patch has already been applied.
# # Consider this a normal scenario:
# exitcode=$?; if test $exitcode -ne 0 && test $exitcode -ne 1; then exit $exitcode; fi
# done
# autoconf -f || exit $?
# # Reset libtool.m4 timestamps to avoid confusing make:
# touch -r m4/ltversion.m4 m4/libtool.m4 || exit $?
# Patch libtool.m4:
for patch in \
contrib/000link_all_deplibs-patch/link_all_deplibs.patch \
; do
echo "applying $patch"
patch -p 1 --no-backup-if-mismatch --forward -r - -i $patch -d .
# The program 'patch' exits with exitcode=1 if the patch has already been applied.
# Consider this a normal scenario:
exitcode=$?; if test $exitcode -ne 0 && test $exitcode -ne 1; then exit $exitcode; fi
done
autoconf -f || exit $?
# Reset libtool.m4 timestamps to avoid confusing make:
touch -r m4/ltversion.m4 m4/libtool.m4 || exit $?
# Patch the rest of the files:
for patch in \
......
This patch is borrowed from the Debian project:
http://deb.debian.org/debian/pool/main/libt/libtool/libtool_2.4.6-15.debian.tar.xz
The comment for the patch in the aformentioned archive says:
## Do not link against deplibs. This is not needed for shared libs
## on atleast ELF systems since those already know which libs they
## need themself. This seems to break a few things and will be fixed
## in a better way in a future upstream version.
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -7568,7 +7568,10 @@ func_mode_link ()
case $pass in
dlopen) libs=$dlfiles ;;
dlpreopen) libs=$dlprefiles ;;
- link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ link)
+ libs="$deplibs %DEPLIBS%"
+ test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
+ ;;
esac
fi
if test lib,dlpreopen = "$linkmode,$pass"; then
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -4936,6 +4936,9 @@ m4_if([$1], [CXX], [
;;
esac
;;
+ linux* | k*bsd*-gnu | gnu*)
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ ;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
@@ -4998,6 +5001,9 @@ dnl Note also adjust exclude_expsyms for C++ above.
openbsd* | bitrig*)
with_gnu_ld=no
;;
+ linux* | k*bsd*-gnu | gnu*)
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ ;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
@@ -5773,6 +5779,7 @@ _LT_EOF
if test yes = "$lt_cv_irix_exported_symbol"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
fi
+ _LT_TAGVAR(link_all_deplibs, $1)=no
else
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment