ltmain: Keep compiler deps as-is

Keep the library dependency list generated by the compiler as-is.
Some libraries are given multiple times to satisfy proper symbol
resolution, don't break it.

Refer to rhbz#2043517 [1] for more details.

Patch proposal sent upstream [2].

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2043517
[2] https://lists.gnu.org/archive/html/libtool-patches/2022-02/msg00000.html

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
Frederic Berat 2022-02-07 14:41:36 +01:00
parent 91e23976a9
commit 2103f3557e
2 changed files with 66 additions and 1 deletions

View File

@ -0,0 +1,58 @@
diff -r -U5 libtool-2.4.6/build-aux/ltmain.in libtool-2.4.6.new/build-aux/ltmain.in
--- libtool-2.4.6/build-aux/ltmain.in 2022-02-22 09:21:35.317958251 +0100
+++ libtool-2.4.6.new/build-aux/ltmain.in 2022-02-22 09:16:10.117571787 +0100
@@ -501,21 +501,14 @@
fi
# preserve --debug
test : = "$debug_cmd" || func_append preserve_args " --debug"
- case $host in
- # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
- # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
- *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
- # don't eliminate duplications in $postdeps and $predeps
- opt_duplicate_compiler_generated_deps=:
- ;;
- *)
- opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
- ;;
- esac
+ # Keeping compiler generated duplicates in $postdeps and $predeps is not
+ # harmful, and is necessary in a majority of systems that use it to satisfy
+ # symbol dependencies.
+ opt_duplicate_compiler_generated_deps=:
$opt_help || {
# Sanity checks first:
func_check_version_match
diff -r -U5 libtool-2.4.6/build-aux/ltmain.sh libtool-2.4.6.new/build-aux/ltmain.sh
--- libtool-2.4.6/build-aux/ltmain.sh 2015-02-15 17:15:12.000000000 +0100
+++ libtool-2.4.6.new/build-aux/ltmain.sh 2022-02-22 09:16:44.783613061 +0100
@@ -2413,21 +2413,14 @@
fi
# preserve --debug
test : = "$debug_cmd" || func_append preserve_args " --debug"
- case $host in
- # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
- # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
- *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
- # don't eliminate duplications in $postdeps and $predeps
- opt_duplicate_compiler_generated_deps=:
- ;;
- *)
- opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
- ;;
- esac
+ # Keeping compiler generated duplicates in $postdeps and $predeps is not
+ # harmful, and is necessary in a majority of systems that use it to satisfy
+ # symbol dependencies.
+ opt_duplicate_compiler_generated_deps=:
$opt_help || {
# Sanity checks first:
func_check_version_match

View File

@ -8,7 +8,7 @@
Summary: The GNU Portable Library Tool
Name: libtool
Version: 2.4.6
Release: 49%{?dist}
Release: 50%{?dist}
License: GPLv2+ and LGPLv2+ and GFDL
URL: http://www.gnu.org/software/libtool/
@ -50,6 +50,10 @@ Patch7: libtool-2.4.6-use-ld.patch
# https://bugs.launchpad.net/ubuntu/+source/gcc-4.4/+bug/503448
Patch8: libtool-2.4.6-disable_non-pic_arm.patch
# rhbz#2047389, patch sent upstream
# https://lists.gnu.org/archive/html/libtool-patches/2022-02/msg00000.html
Patch9: libtool-2.4.6-keep-compiler-deps.patch
%if ! 0%{?_module_build}
Patch100: libtool-nodocs.patch
%endif
@ -176,6 +180,9 @@ rm -f %{buildroot}%{_libdir}/libltdl.{a,la}
%changelog
* Thu Feb 17 2022 Frederic Berat <fberat@redhat.com> - 2.4.6-50
- Keep compiler generated list of library dependencies.
* Sun Feb 13 2022 Jeff Law <jeffreyalaw@gmail.com> - 2.4.6-49
- Re-enable LTO (completing change from Nov 29, 2021)