%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}
%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
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
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
%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
--libdir=%{_libdir} \
--infodir=%{_infodir} \
--mandir=%{_mandir} \
+ --sysconfdir=%{_sysconfdir} \
--disable-debug \
--disable-silent-rules \
--disable-werror \
%if %{with gold}
--enable-gold%{!?with_default_bfd:=default} --enable-ld%{?with_default_bfd:=default} \
%endif
+ %{__enable_disable msgpack} \
+ %{__enable_disable jansson}
%{__make}
%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
%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*
%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
%{_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
+++ /dev/null
-From ae1cab7d3f39686d9c7ddadbac297e9ae76ffccf Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-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
-