diff --git a/SOURCES/binutils-common-sym-versioning.patch b/SOURCES/binutils-common-sym-versioning.patch new file mode 100644 index 0000000..b51e8d6 --- /dev/null +++ b/SOURCES/binutils-common-sym-versioning.patch @@ -0,0 +1,29 @@ +--- binutils.orig/bfd/elflink.c 2020-12-08 17:45:26.487260908 +0000 ++++ binutils-2.30/bfd/elflink.c 2020-12-08 17:48:06.650728413 +0000 +@@ -1895,7 +1895,7 @@ _bfd_elf_add_default_symbol (bfd *abfd, + if (skip) + goto nondefault; + +- if (hi->def_regular) ++ if (hi->def_regular || ELF_COMMON_DEF_P (hi)) + { + /* If the undecorated symbol will have a version added by a + script different to H, then don't indirect to/from the +@@ -2236,7 +2236,7 @@ _bfd_elf_link_assign_sym_version (struct + + /* We only need version numbers for symbols defined in regular + objects. */ +- if (!h->def_regular) ++ if (!h->def_regular && !ELF_COMMON_DEF_P (h)) + return TRUE; + + bed = get_elf_backend_data (info->output_bfd); +@@ -9957,7 +9957,7 @@ elf_link_output_extsym (struct bfd_hash_ + Elf_Internal_Versym iversym; + Elf_External_Versym *eversym; + +- if (!h->def_regular) ++ if (!h->def_regular && !ELF_COMMON_DEF_P (h)) + { + if (h->verinfo.verdef == NULL + || (elf_dyn_lib_class (h->verinfo.verdef->vd_bfd) diff --git a/SPECS/binutils.spec b/SPECS/binutils.spec index dffae80..819376f 100644 --- a/SPECS/binutils.spec +++ b/SPECS/binutils.spec @@ -1,8 +1,45 @@ +# Determine if this is a native build or a cross build. +# +# For a cross build add --define "binutils_target " to the command +# line when building the rpms. +# +# For example: +# --define "binutils_target aarch64-linux-gnu" +# +# Cross builds will create a set of binutils executables that will run on the +# host machine but which will create binaries suitable for running on the +# target machine. The cross tools will have the target name as a prefix, +# but for compatibility with the kernel the rpms will use the target name +# as an infix. So for example building with the above define will create a +# set of rpms like this: +# +# binutils-aarch64-linux-gnu-2.35.1-14.fc34.x86_64.rpm +# binutils-aarch64-linux-gnu-debuginfo-2.35.1-14.fc34.x86_64.rpm +# [etc] +# +# and the rpms will contain files like: +# +# /usr/bin/aarch64-linux-gnu-addr2line +# /usr/bin/aarch64-linux-gnu-ar +# /usr/bin/aarch64-linux-gnu-as +# [etc] + +%if 0%{!?binutils_target:1} +%define binutils_target %{_target_platform} +%define isnative 1 +%define enable_shared 1 +%else +%define cross %{binutils_target}- +%define name_cross -%{binutils_target} +%define isnative 0 +%define enable_shared 0 +%endif + Summary: A GNU collection of binary utilities -Name: %{?cross}binutils%{?_with_debug:-debug} +Name: binutils%{?name_cross}%{?_with_debug:-debug} Version: 2.30 -Release: 87%{?dist} +Release: 90%{?dist} License: GPLv3+ URL: https://sourceware.org/binutils @@ -17,6 +54,7 @@ URL: https://sourceware.org/binutils # --with debug Build without optimizations and without splitting # the debuginfo into a separate file. # --without docs Skip building documentation. +# Default is with docs, except when building a cross binutils. # --without testsuite Do not run the testsuite. Default is to run it. # --without gold Disable building of the GOLD linker. # --with clang To force building with the CLANG. @@ -64,6 +102,8 @@ URL: https://sourceware.org/binutils %bcond_without docs # Default: Always run the testsuite. %bcond_without testsuite +# Default: Build the gold linker. +%bcond_without gold %if %{with bootstrap} %undefine with_docs @@ -74,16 +114,6 @@ URL: https://sourceware.org/binutils %undefine with_testsuite %endif -%if 0%{!?binutils_target:1} -%define binutils_target %{_target_platform} -%define isnative 1 -%define enable_shared 1 -%else -%define cross %{binutils_target}- -%define isnative 0 -%define enable_shared 0 -%endif - #---------------------------------------------------------------------------- # Note - the Linux Kernel binutils releases are too unstable and contain @@ -506,15 +536,25 @@ Patch80: binutils-ld-IR-override.patch # Lifetime: Fixed in 2.31 Patch81: binutils-x86-tpause.patch -# Purpose: Add support for Aarch64 GNU Property notes +# Purpose: Add support for AArch64 GNU Property notes # Lifetime: Fixed in 2.34 Patch82: binutils-aarch64-properties.patch +# Purpose: Fix the version selected when merging common symbols +# and normal symbols. +# Lifetime: Fixed in 2.36 +Patch83: binutils-common-sym-versioning.patch + #---------------------------------------------------------------------------- Provides: bundled(libiberty) +BuildRequires: autoconf automake +%if %{with gold} %define gold_arches %{ix86} x86_64 %{arm} aarch64 %{power64} s390x +%else +%define gold_arches none +%endif %if %{with bootstrap} %define build_gold no @@ -716,6 +756,7 @@ using libelf instead of BFD. %patch80 -p1 %patch81 -p1 %patch82 -p1 +%patch83 -p1 # We cannot run autotools as there is an exact requirement of autoconf-2.59. # FIXME - this is no longer true. Maybe try reinstating autotool use ? @@ -1119,12 +1160,14 @@ exit 0 %if %{with docs} %{_mandir}/man1/* +%if %{isnative} %{_infodir}/as.info.gz %{_infodir}/binutils.info.gz %{_infodir}/gprof.info.gz %{_infodir}/ld.info.gz %{_infodir}/standards.info.gz %endif +%endif %if %{enable_shared} %{_libdir}/lib*.so @@ -1153,6 +1196,16 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Mon Jan 1 2021 Nick Clifton - 2.30-90 +- NVR bump in order to regain access to gating test results. + +* Wed Dec 09 2020 Nick Clifton - 2.30-89 +- Fix snafu preventing the building of the GOLD linekr. + +* Wed Dec 09 2020 Nick Clifton - 2.30-88 +- Fix versioning when merging common and normal symbols. (#1904942) +- Add cross binutils support. + * Wed Nov 25 2020 Nick Clifton - 2.30-87 - Fix bug in patch for AArch64 GNU Property notes support. (#1889643)