Compare commits

...

No commits in common. "c8s" and "c9" have entirely different histories.
c8s ... c9

12 changed files with 212 additions and 43 deletions

1
.gitignore vendored
View File

@ -1,2 +1 @@
SOURCES/libtool-2.4.6.tar.xz SOURCES/libtool-2.4.6.tar.xz
/libtool-2.4.6.tar.xz

1
.libtool.metadata Normal file
View File

@ -0,0 +1 @@
3e7504b832eb2dd23170c91b6af72e15b56eb94e SOURCES/libtool-2.4.6.tar.xz

View File

@ -0,0 +1,53 @@
Enabling lto will result in failure during test phase, to be precise test 67 will cause it.
Compiler flags for this test (and most likely for rest of them) are inherited from actual build phase.
I'm not sure if this is expected.
Most distribution disables this test. We try to keep it by stripping lto flags for it.
Origin for this tests: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=391427
--- a/tests/link-order2.at 2015-01-16 19:52:04.000000000 +0100
+++ b/tests/link-order2_new.at 2021-11-30 02:01:09.574451906 +0100
@@ -47,6 +47,8 @@
AT_KEYWORDS([libtool])
AT_KEYWORDS([interactive])dnl running 'wrong' may cause a popup window.
+NO_LTO_CFLAGS=${CFLAGS/-flto*-ffat-lto-objects }
+
eval `$LIBTOOL --config | $EGREP '^(shlibpath_var|allow_undefined_flag)='`
undefined_setting=-no-undefined
@@ -89,12 +91,12 @@
EOF
for file in a0 a1 b; do
- $LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c $file.c
+ $LIBTOOL --mode=compile $CC $CPPFLAGS $NO_LTO_CFLAGS -c $file.c
done
-$CC $CPPFLAGS $CFLAGS -c main.c
+$CC $CPPFLAGS $NO_LTO_CFLAGS -c main.c
# Build an old, installed library.
-$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $static -o liba0.la a0.lo -rpath $deflibdir
+$LIBTOOL --mode=link $CC $NO_LTO_CFLAGS $LDFLAGS $static -o liba0.la a0.lo -rpath $deflibdir
$LIBTOOL --mode=install cp liba0.la $deflibdir/liba0.la
$LIBTOOL --mode=clean rm -f liba0.la
@@ -118,13 +120,13 @@
esac
test non-libtool,-static-libtool-libs = "$type_of_depdepl,$static" &&
static=-all-static
- $LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $static -o liba1.la a1.lo -rpath $libdir
- $LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $static -o libb.la b.lo liba1.la -rpath $libdir
- AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $static -o main$EXEEXT main.$OBJEXT libb.la -la0],
+ $LIBTOOL --mode=link $CC $NO_LTO_CFLAGS $LDFLAGS $static -o liba1.la a1.lo -rpath $libdir
+ $LIBTOOL --mode=link $CC $NO_LTO_CFLAGS $LDFLAGS $static -o libb.la b.lo liba1.la -rpath $libdir
+ AT_CHECK([$LIBTOOL --mode=link $CC $NO_LTO_CFLAGS $LDFLAGS $static -o main$EXEEXT main.$OBJEXT libb.la -la0],
[], [ignore], [ignore])
LT_AT_EXEC_CHECK([./main])
# Now test that if we reverse the link order, the program fails.
- AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $static -o wrong$EXEEXT main.$OBJEXT -la0 libb.la],
+ AT_CHECK([$LIBTOOL --mode=link $CC $NO_LTO_CFLAGS $LDFLAGS $static -o wrong$EXEEXT main.$OBJEXT -la0 libb.la],
[], [ignore], [ignore])
if test yes, != "$shared_fails,$static"; then
LT_AT_EXEC_CHECK([./wrong], [1], [], [ignore], [|| (exit 1)])

View File

@ -0,0 +1,34 @@
From 350082b6aa89f9ef603fcebbb4cf33f15a743f2f Mon Sep 17 00:00:00 2001
From: Bert Wesarg <bert.wesarg@googlemail.com>
Date: Mon, 13 Jun 2016 22:28:47 +0200
Subject: [PATCH] libtool: exit verbosely for fatal configure problems
Instead of calling not-existing function and processing subsequent
shell code.
* build-aux/ltmain.in (func_fatal_configuration): Fix typo in
func_fatal_error call.
Copyright-paperwork-exempt: Yes
Upstream: 350082b6aa89f9ef603fcebbb4cf33f15a743f2f
---
build-aux/ltmain.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index 0ad021db..c3058f21 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -212,7 +212,7 @@ fi
# a configuration failure hint, and exit.
func_fatal_configuration ()
{
- func__fatal_error ${1+"$@"} \
+ func_fatal_error ${1+"$@"} \
"See the $PACKAGE documentation for more information." \
"Fatal configuration error."
}
--
2.17.1

View File

@ -0,0 +1,40 @@
libtool: Enable hardening in libltdl
See the rhbz#1289759 and rhbz#1214506. We disable hardening namely because
that bakes the CFLAGS/LDFLAGS into installed /bin/libtool and ltmain.sh files.
At the same time we want to have libltdl.so hardened. Downstream-only patch.
---
diff --git a/Makefile.am b/Makefile.am
index 13dfc63..5c5603a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -309,10 +309,27 @@
## Libltdl. ##
## -------- ##
include libltdl/ltdl.mk
+libltdl_libltdl_la_CFLAGS = $(CUSTOM_LTDL_CFLAGS)
+libltdl_libltdl_la_LDFLAGS += $(CUSTOM_LTDL_LDFLAGS)
+
+libltdl_dlopen_la_LDFLAGS += $(CUSTOM_LTDL_LDFLAGS)
+libltdl_dld_link_la_LDFLAGS += $(CUSTOM_LTDL_LDFLAGS)
+libltdl_dyld_la_LDFLAGS += $(CUSTOM_LTDL_LDFLAGS)
+libltdl_load_add_on_la_LDFLAGS += $(CUSTOM_LTDL_LDFLAGS)
+libltdl_loadlibrary_la_LDFLAGS += $(CUSTOM_LTDL_LDFLAGS)
+libltdl_shl_load_la_LDFLAGS += $(CUSTOM_LTDL_LDFLAGS)
+
+libltdl_dlopen_la_CFLAGS = $(CUSTOM_LTDL_CFLAGS)
+libltdl_dld_link_la_CFLAGS = $(CUSTOM_LTDL_CFLAGS)
+libltdl_dyld_la_CFLAGS = $(CUSTOM_LTDL_CFLAGS)
+libltdl_load_add_on_la_CFLAGS = $(CUSTOM_LTDL_CFLAGS)
+libltdl_loadlibrary_la_CFLAGS = $(CUSTOM_LTDL_CFLAGS)
+libltdl_shl_load_la_CFLAGS = $(CUSTOM_LTDL_CFLAGS)
+
lt_aclocal_m4 = $(srcdir)/$(ltdl_dir)/aclocal.m4
lt_config_h_in = $(srcdir)/$(ltdl_dir)/config-h.in
lt_configure = $(srcdir)/$(ltdl_dir)/configure
lt_configure_ac = $(srcdir)/$(ltdl_dir)/configure.ac
stamp_mk = $(srcdir)/$(ltdl_dir)/stamp-mk

View File

@ -8,10 +8,9 @@
Summary: The GNU Portable Library Tool Summary: The GNU Portable Library Tool
Name: libtool Name: libtool
Version: 2.4.6 Version: 2.4.6
Release: 25%{?dist} Release: 46%{?dist}
License: GPLv2+ and LGPLv2+ and GFDL License: GPLv2+ and LGPLv2+ and GFDL
URL: http://www.gnu.org/software/libtool/ URL: http://www.gnu.org/software/libtool/
Group: Development/Tools
Source: http://ftp.gnu.org/gnu/libtool/libtool-%{version}.tar.xz Source: http://ftp.gnu.org/gnu/libtool/libtool-%{version}.tar.xz
@ -31,6 +30,14 @@ Patch2: libtool-2.4.6-specs.patch
%undefine _hardened_build %undefine _hardened_build
Patch3: libtool-2.4.6-hardening.patch Patch3: libtool-2.4.6-hardening.patch
# rhbz#1622611, upstream 350082b6aa89f9ef603fcebbb4cf33f15a743f2f
Patch4: libtool-2.4.6-fatal-handler.patch
# The testsuite seems to not properly handle template instantiation and as
# a result fails. libtool itself appears to be OK from my by-hand testing. (by Jeff Law)
# Disable LTO for link-order2 test (Related: #1988112)
Patch5: libtool-2.4.6-disable-lto-link-order2.patch
%if ! 0%{?_module_build} %if ! 0%{?_module_build}
Patch100: libtool-nodocs.patch Patch100: libtool-nodocs.patch
%endif %endif
@ -41,8 +48,6 @@ Patch100: libtool-nodocs.patch
# number changes need libtool rebuilding. # number changes need libtool rebuilding.
Requires: gcc(major) = %{gcc_major} Requires: gcc(major) = %{gcc_major}
Requires: autoconf, automake, sed, tar, findutils Requires: autoconf, automake, sed, tar, findutils
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
%if ! 0%{?_module_build} %if ! 0%{?_module_build}
BuildRequires: texinfo BuildRequires: texinfo
@ -53,6 +58,9 @@ BuildRequires: help2man
# make sure we can configure all supported langs # make sure we can configure all supported langs
BuildRequires: libstdc++-devel, gcc-gfortran BuildRequires: libstdc++-devel, gcc-gfortran
BuildRequires: gcc, gcc-c++
BuildRequires: make
%description %description
GNU Libtool is a set of shell scripts which automatically configure UNIX and GNU Libtool is a set of shell scripts which automatically configure UNIX and
@ -72,11 +80,8 @@ and GNU Automake).
%package ltdl %package ltdl
Summary: Runtime libraries for GNU Libtool Dynamic Module Loader Summary: Runtime libraries for GNU Libtool Dynamic Module Loader
Group: System Environment/Libraries
Provides: %{name}-libs = %{version}-%{release} Provides: %{name}-libs = %{version}-%{release}
License: LGPLv2+ License: LGPLv2+
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
%description ltdl %description ltdl
@ -91,7 +96,6 @@ the rest of the GNU Autotools (including GNU Autoconf and GNU Automake).
%package ltdl-devel %package ltdl-devel
Summary: Tools needed for development using the GNU Libtool Dynamic Module Loader Summary: Tools needed for development using the GNU Libtool Dynamic Module Loader
Group: Development/Libraries
Requires: automake = %automake_version Requires: automake = %automake_version
Requires: %{name}-ltdl = %{version}-%{release} Requires: %{name}-ltdl = %{version}-%{release}
License: LGPLv2+ License: LGPLv2+
@ -107,6 +111,8 @@ Static libraries and header files for development with ltdl.
%patch1 -p1 -b .test %patch1 -p1 -b .test
%patch2 -p1 -b .gcc-specs %patch2 -p1 -b .gcc-specs
%patch3 -p1 -b .ltdl-hardening %patch3 -p1 -b .ltdl-hardening
%patch4 -p1 -b .fatal-handler
%patch5 -p1 -b .disable-lto-link-order2
%if ! 0%{?_module_build} %if ! 0%{?_module_build}
%patch100 -p1 -b .nodocs %patch100 -p1 -b .nodocs
%endif %endif
@ -117,7 +123,7 @@ autoreconf -v
export CC=gcc export CC=gcc
export CXX=g++ export CXX=g++
export F77=gfortran export F77=gfortran
export CFLAGS="$RPM_OPT_FLAGS -fPIC" export CFLAGS="$RPM_OPT_FLAGS -fPIC -fstack-protector-strong"
%configure --prefix=%{_prefix} \ %configure --prefix=%{_prefix} \
--exec-prefix=%{_prefix} \ --exec-prefix=%{_prefix} \
@ -152,22 +158,6 @@ rm -f %{buildroot}%{_infodir}/dir
rm -f %{buildroot}%{_libdir}/libltdl.{a,la} rm -f %{buildroot}%{_libdir}/libltdl.{a,la}
%post
/sbin/install-info %{_infodir}/libtool.info.gz %{_infodir}/dir || :
%post ltdl -p /sbin/ldconfig
%preun
if [ "$1" = 0 ]; then
/sbin/install-info --delete %{_infodir}/libtool.info.gz %{_infodir}/dir || :
fi
%postun ltdl -p /sbin/ldconfig
%files %files
%license COPYING %license COPYING
%doc AUTHORS NEWS README THANKS TODO ChangeLog* %doc AUTHORS NEWS README THANKS TODO ChangeLog*
@ -198,8 +188,75 @@ fi
%changelog %changelog
* Fri May 18 2018 Pavel Raiskup <praiskup@redhat.com> - 2.4.6-25 * Thu Jun 06 2024 Frederic Berat <fberat@redhat.com> - 2.4.6-46
- bump for automake 1.16 - Harden libltdl loaders (RHEL-39991)
* Tue Jan 11 2022 Marek Kulik <mkulik@redhat.com> - 2.4.6-45
- Enable LTO build
- Add disable-lto-link-order2.patch to pass tests
- Resolves: #1988112
* Mon Aug 23 2021 Ondrej Dubaj <odubaj@redhat.com> - 2.4.6-44
- added -fstack-protector-strong to CFLAGS (#1988402)
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.4.6-43
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Aug 6 2021 Florian Weimer <fweimer@redhat.com> - 2.4.6-42
- Rebuild to pick up new build flags from redhat-rpm-config (#1984652)
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.4.6-41
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.6-40
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Dec 07 2020 Jakub Jelinek <jakub@redhat.com> - 2.4.6-39
- bump: for gcc 11.* in eln
* Sun Dec 06 2020 Jakub Jelinek <jakub@redhat.com> - 2.4.6-38
- bump: for gcc 11.* in rawhide
* Wed Oct 21 2020 Jakub Jelinek <jakub@redhat.com> - 2.4.6-37
- bump: for gcc 11.* in eln
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.6-36
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Apr 21 2020 Jeff Law <law@redhat.com> - 2.4.6-35
- Disable LTO
* Tue Apr 21 2020 Pavel Raiskup <praiskup@redhat.com> - 2.4.6-34
- bump for new automake, rhbz#1815814
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.6-33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Jan 20 2020 Jakub Jelinek <jakub@redhat.com> - 2.4.6-32
- bump: for gcc 10.*
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.6-31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Wed Apr 24 2019 Björn Esser <besser82@fedoraproject.org> - 2.4.6-30
- Remove hardcoded gzip suffix from GNU info pages
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.6-29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Jan 21 2019 Björn Esser <besser82@fedoraproject.org> - 2.4.6-28
- bump: for gcc 9.*
* Tue Aug 28 2018 Pavel Raiskup <praiskup@redhat.com> - 2.4.6-27
- BR gcc, gcc-c++ (rhbz#1623078)
* Tue Aug 28 2018 Pavel Raiskup <praiskup@redhat.com> - 2.4.6-26
- cleanup post/postun, there are RPM triggers nowadays
- fix error: line 2642: func__fatal_error: command not found (rhbz#1622611)
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.6-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Apr 20 2018 Pavel Raiskup <praiskup@redhat.com> - 2.4.6-24 * Fri Apr 20 2018 Pavel Raiskup <praiskup@redhat.com> - 2.4.6-24
- harden libltdl.so (rhbz#1548751) - harden libltdl.so (rhbz#1548751)

View File

@ -1,14 +0,0 @@
diff --git a/Makefile.am b/Makefile.am
index 13dfc63..5c5603a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -311,6 +311,9 @@ libtool: $(ltmain_sh) $(config_status) $(dotversion)
include libltdl/ltdl.mk
+libltdl_libltdl_la_CPPFLAGS += $(CUSTOM_LTDL_CFLAGS)
+libltdl_libltdl_la_LDFLAGS += $(CUSTOM_LTDL_LDFLAGS)
+
lt_aclocal_m4 = $(srcdir)/$(ltdl_dir)/aclocal.m4
lt_config_h_in = $(srcdir)/$(ltdl_dir)/config-h.in
lt_configure = $(srcdir)/$(ltdl_dir)/configure

View File

@ -1 +0,0 @@
SHA512 (libtool-2.4.6.tar.xz) = a6eef35f3cbccf2c9e2667f44a476ebc80ab888725eb768e91a3a6c33b8c931afc46eb23efaee76c8696d3e4eed74ab1c71157bcb924f38ee912c8a90a6521a4