From: Jan Palus Date: Sat, 6 Aug 2022 15:32:58 +0000 (+0200) Subject: up to 2.39 (gasp disabled by default) X-Git-Tag: auto/th/binutils-2.39-1~2 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=4a5e8616ae6af7297c01b1479e8eff91141522cb;p=packages%2Fbinutils.git up to 2.39 (gasp disabled by default) - gasp no longer links, feel free to maintain the patch - enabled jansson and msgpack by default - CVE-2019-1010204 affects binutils until 2.31.1 so should be fixed for a while now hence dropped the patch --- diff --git a/binutils-CVE-2019-1010204.patch b/binutils-CVE-2019-1010204.patch deleted file mode 100644 index 56434b1..0000000 --- a/binutils-CVE-2019-1010204.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- binutils.orig/gold/fileread.cc 2019-08-06 14:22:08.669313110 +0100 -+++ binutils-2.32/gold/fileread.cc 2019-08-06 14:22:28.799177543 +0100 -@@ -381,6 +381,12 @@ File_read::do_read(off_t start, section_ - ssize_t bytes; - if (this->whole_file_view_ != NULL) - { -+ // See PR 23765 for an example of a testcase that triggers this error. -+ if (((ssize_t) start) < 0) -+ gold_fatal(_("%s: read failed, starting offset (%#llx) less than zero"), -+ this->filename().c_str(), -+ static_cast(start)); -+ - bytes = this->size_ - start; - if (static_cast(bytes) >= size) - { diff --git a/binutils.spec b/binutils.spec index 5392b5b..f6d49b9 100644 --- a/binutils.spec +++ b/binutils.spec @@ -7,7 +7,10 @@ %bcond_with pax # without PaX flags (for upstream bugreports) %bcond_without gold # don't build gold (no C++ dependencies) %bcond_without default_bfd # default ld.bfd instead of gold -%bcond_without gasp # gasp +%bcond_with gasp # gasp +%bcond_without gprofng # gprofng +%bcond_without jansson # Package Metadata embedding support +%bcond_without msgpack # msgpack support %bcond_with tests # check target %ifnarch %{ix86} %{x8664} x32 aarch64 %{arm} @@ -16,6 +19,9 @@ %ifarch %{arm} %undefine with_gasp %endif +%ifnarch %{ix86} %{x8664} aarch64 +%undefine with_gprofng 1 +%endif Summary: GNU Binary Utility Development Utilities Summary(de.UTF-8): GNU Binary Utility Development Utilities @@ -27,13 +33,13 @@ Summary(ru.UTF-8): Набор инструментов GNU для построе Summary(tr.UTF-8): GNU geliştirme araçları Summary(uk.UTF-8): Набір інструментів GNU для побудови виконуваних програм Name: binutils -Version: 2.38 -Release: 2 +Version: 2.39 +Release: 1 Epoch: 4 License: GPL v3+ Group: Development/Tools Source0: https://ftp.gnu.org/gnu/binutils/%{name}-%{version}.tar.lz -# Source0-md5: a54dd3cba0f276a52063b7de151e6334 +# Source0-md5: 061a1460a09cc71e51886c008be55d44 Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2 # Source1-md5: a717d9707ec77d82acb6ec9078c472d6 Patch0: %{name}-gasp.patch @@ -45,18 +51,20 @@ Patch6: %{name}-absolute-gnu_debuglink-path.patch Patch7: %{name}-libtool-m.patch Patch9: %{name}-tooldir.patch Patch10: %{name}-sanity-check.patch -Patch11: binutils-CVE-2019-1010204.patch -Patch12: x86_crash.patch URL: http://www.sourceware.org/binutils/ BuildRequires: autoconf >= 2.69 BuildRequires: automake >= 1:1.11 BuildRequires: bison BuildRequires: flex BuildRequires: gettext-tools +%{?with_jansson:BuildRequires: jansson-devel} %{?with_gold:BuildRequires: libstdc++-devel >= 6:4.0-1} %{?with_tests:BuildRequires: libstdc++-static >= 6:4.0} BuildRequires: lzip +%{?with_msgpack:BuildRequires: msgpack-devel} BuildRequires: perl-tools-pod +BuildRequires: pkgconfig +BuildRequires: rpmbuild(macros) >= 1.527 %ifarch sparc sparc32 BuildRequires: sparc32 %endif @@ -173,8 +181,8 @@ niektórych pakietów. %patch7 -p1 %patch9 -p1 %patch10 -p1 -%patch11 -p1 -%patch12 -p1 + +%{__sed} -i -e '1s,.*env perl,#!%{__perl},' gprofng/gp-display-html/gp-display-html.in # file contains hacks for ac 2.69 only %{__rm} config/override.m4 @@ -227,6 +235,7 @@ sparc32 \ --libdir=%{_libdir} \ --infodir=%{_infodir} \ --mandir=%{_mandir} \ + --sysconfdir=%{_sysconfdir} \ --disable-debug \ --disable-silent-rules \ --disable-werror \ @@ -247,6 +256,8 @@ sparc32 \ %if %{with gold} --enable-gold%{!?with_default_bfd:=default} --enable-ld%{?with_default_bfd:=default} \ %endif + %{__enable_disable msgpack} \ + %{__enable_disable jansson} %{__make} @@ -321,11 +332,20 @@ rm -rf $RPM_BUILD_ROOT %defattr(644,root,root,755) %doc README %{?with_gold:%doc gold-doc} +%{?with_gprofng:%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/gprofng.rc} %attr(755,root,root) %{_bindir}/addr2line %attr(755,root,root) %{_bindir}/ar %attr(755,root,root) %{_bindir}/as %attr(755,root,root) %{_bindir}/c++filt %attr(755,root,root) %{_bindir}/elfedit +%if %{with gprofng} +%attr(755,root,root) %{_bindir}/gp-archive +%attr(755,root,root) %{_bindir}/gp-collect-app +%attr(755,root,root) %{_bindir}/gp-display-html +%attr(755,root,root) %{_bindir}/gp-display-src +%attr(755,root,root) %{_bindir}/gp-display-text +%attr(755,root,root) %{_bindir}/gprofng +%endif %attr(755,root,root) %{_bindir}/gprof %attr(755,root,root) %{_bindir}/ld %attr(755,root,root) %{_bindir}/ld.bfd @@ -341,17 +361,36 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_bindir}/size %attr(755,root,root) %{_bindir}/strings %attr(755,root,root) %{_bindir}/strip +%if %{with gprofng} +%dir %{_libdir}/gprofng +%attr(755,root,root) %{_libdir}/gprofng/libgp-collector.so +%attr(755,root,root) %{_libdir}/gprofng/libgp-collectorAPI.so +%attr(755,root,root) %{_libdir}/gprofng/libgp-heap.so +%attr(755,root,root) %{_libdir}/gprofng/libgp-iotrace.so +%attr(755,root,root) %{_libdir}/gprofng/libgp-sync.so +%attr(755,root,root) %{_libdir}/gprofng/libgprofng.so.*.*.* +%attr(755,root,root) %{_libdir}/gprofng/libgprofng.so.0 +%endif %{_prefix}/lib/ldscripts %{_infodir}/as.info* %{_infodir}/binutils.info* %{_infodir}/ctf-spec.info* %{_infodir}/gprof.info* +%{?with_gprofng:%{_infodir}/gprofng.info*} %{_infodir}/ld.info* %{_mandir}/man1/addr2line.1* %{_mandir}/man1/ar.1* %{_mandir}/man1/as.1* %{_mandir}/man1/c++filt.1* %{_mandir}/man1/elfedit.1* +%if %{with gprofng} +%{_mandir}/man1/gp-archive.* +%{_mandir}/man1/gp-collect-app.* +%{_mandir}/man1/gp-display-html.* +%{_mandir}/man1/gp-display-src.* +%{_mandir}/man1/gp-display-text.* +%{_mandir}/man1/gprofng.1* +%endif %{_mandir}/man1/gprof.1* %{_mandir}/man1/ld.1* %{_mandir}/man1/nm.1* @@ -388,6 +427,7 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_libdir}/libctf.so %attr(755,root,root) %{_libdir}/libctf-nobfd.so %attr(755,root,root) %{_libdir}/libopcodes.so +%{?with_gprofng:%attr(755,root,root) %{_libdir}/gprofng/libgprofng.so} %{_libdir}/libbfd.la %{_libdir}/libctf.la %{_libdir}/libctf-nobfd.la @@ -403,6 +443,11 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/plugin-api.h %{_includedir}/symcat.h %{_includedir}/libiberty +%if %{with gprofng} +%{_includedir}/collectorAPI.h +%{_includedir}/libcollector.h +%{_includedir}/libfcollector.h +%endif %{_infodir}/bfd.info* %files static diff --git a/x86_crash.patch b/x86_crash.patch deleted file mode 100644 index 469243f..0000000 --- a/x86_crash.patch +++ /dev/null @@ -1,79 +0,0 @@ -From ae1cab7d3f39686d9c7ddadbac297e9ae76ffccf Mon Sep 17 00:00:00 2001 -From: "H.J. Lu" -Date: Tue, 15 Feb 2022 15:03:02 -0800 -Subject: [PATCH] i386: Update I386_NEED_DYNAMIC_RELOC_TYPE_P for DT_TEXTREL - -Update I386_NEED_DYNAMIC_RELOC_TYPE_P to allow R_386_TLS_IE for relocation -in read-only section. - -bfd/ - - PR ld/28894 - * elfxx-x86.h (I386_NEED_DYNAMIC_RELOC_TYPE_P): Allow - R_386_TLS_IE. - -ld/ - PR ld/28894 - * testsuite/ld-i386/i386.exp: Run pr28894. - * testsuite/ld-i386/pr28894.d: New file. - * testsuite/ld-i386/pr28894.s: Likewise. - -(cherry picked from commit 3319ba7a8d6a42ba071d691789bc184632399331) ---- - bfd/elfxx-x86.h | 1 + - ld/testsuite/ld-i386/i386.exp | 1 + - ld/testsuite/ld-i386/pr28894.d | 3 +++ - ld/testsuite/ld-i386/pr28894.s | 7 +++++++ - 4 files changed, 12 insertions(+) - create mode 100644 ld/testsuite/ld-i386/pr28894.d - create mode 100644 ld/testsuite/ld-i386/pr28894.s - -diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h -index 3219f363a9a..77fb1ad72bc 100644 ---- a/bfd/elfxx-x86.h -+++ b/bfd/elfxx-x86.h -@@ -80,6 +80,7 @@ - #define I386_NEED_DYNAMIC_RELOC_TYPE_P(TYPE) \ - (I386_SIZE_TYPE_P (TYPE) \ - || I386_RELATIVE_RELOC_TYPE_P (TYPE) \ -+ || (TYPE) == R_386_TLS_IE \ - || (TYPE) == R_386_TLS_LE \ - || (TYPE) == R_386_TLS_LE_32) - #define X86_NEED_DYNAMIC_RELOC_TYPE_P(IS_X86_64, TYPE) \ -diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp -index d997c757325..fadbd160420 100644 ---- a/ld/testsuite/ld-i386/i386.exp -+++ b/ld/testsuite/ld-i386/i386.exp -@@ -510,6 +510,7 @@ run_dump_test "pr27491-4" - run_dump_test "dt-relr-1a" - run_dump_test "dt-relr-1b" - run_dump_test "pr28870" -+run_dump_test "pr28894" - - if { !([istarget "i?86-*-linux*"] - || [istarget "i?86-*-gnu*"] -diff --git a/ld/testsuite/ld-i386/pr28894.d b/ld/testsuite/ld-i386/pr28894.d -new file mode 100644 -index 00000000000..a8d1111eb1f ---- /dev/null -+++ b/ld/testsuite/ld-i386/pr28894.d -@@ -0,0 +1,3 @@ -+#as: --32 -+#ld: -shared -melf_i386 --warn-shared-textrel --fatal-warnings -+#error: .*warning: creating DT_TEXTREL in a shared object -diff --git a/ld/testsuite/ld-i386/pr28894.s b/ld/testsuite/ld-i386/pr28894.s -new file mode 100644 -index 00000000000..1d3e3f37f3e ---- /dev/null -+++ b/ld/testsuite/ld-i386/pr28894.s -@@ -0,0 +1,7 @@ -+ .text -+ addl foo@INDNTPOFF, %eax -+ .section .tbss,"awT",@nobits -+ .globl foo -+ .hidden foo -+foo: -+ .byte 0 --- -2.27.0 -