%global run_testsuite 1 Name: mingw-binutils Version: 2.34 Release: 10 Summary: Cross-compiled version of binutils for Win32 and Win64 environments License: GPLv2+ and LGPLv2+ and GPLv3+ and LGPLv3+ URL: http://www.gnu.org/software/binutils/ Source0: http://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.bz2 ### Patches from native package # Unneeded, mingw does not have lib64 # Patch01: binutils-2.20.51.0.2-libtool-lib64.patch # Purpose: Appends a RHEL or Fedora release string to the generic binutils # version string. # Lifetime: Permanent. This is a RHEL/Fedora specific patch. Patch02: binutils-2.25-version.patch # Purpose: Exports the demangle.h header file (associated with the libiberty # sources) with the binutils-devel rpm. # Lifetime: Permanent. This is a RHEL/Fedora specific patch. Patch03: binutils-export-demangle.h.patch # Purpose: Disables the check in the BFD library's bfd.h header file that # config.h has been included before the bfd.h header. See BZ # #845084 for more details. # Lifetime: Permanent - but it should not be. The bfd.h header defines # various types that are dependent upon configuration options, so # the order of inclusion is important. # FIXME: It would be better if the packages using the bfd.h header were # fixed so that they do include the header files in the correct # order. Patch04: binutils-2.22.52.0.4-no-config-h-check.patch # Purpose: Include the filename concerned in readelf error messages. This # makes readelf's output more helpful when it is run on multiple # input files. # Lifetime: Permanent. This patch changes the format of readelf's output, # making it better (IMHO) but also potentially breaking tools that # depend upon readelf's current format. Hence it remains a local # patch. Patch05: binutils-2.29-filename-in-error-messages.patch # Unneeded, affects ELF only # Patch06: binutils-2.29-revert-PLT-elision.patch # Purpose: Changes readelf so that when it displays extra information about # a symbol, this information is placed at the end of the line. # Lifetime: Permanent. # FIXME: The proper fix would be to update the scripts that are expecting # a fixed output from readelf. But it seems that some of them are # no longer being maintained. Patch07: binutils-readelf-other-sym-info.patch # Unneeded, affects ELF only # Patch08: binutils-2.27-aarch64-ifunc.patch # Purpose: Stop the binutils from statically linking with libstdc++. # Lifetime: Permanent. Patch09: binutils-do-not-link-with-static-libstdc++.patch # Unneeded, affects ELF only # Patch10: binutils-attach-to-group.patch # Purpose: Stop gold from complaining about relocs in the .gnu.build.attribute # section that reference symbols in discarded sections. # Lifetime: Fixed in 2.33 (maybe) Patch11: binutils-gold-ignore-discarded-note-relocs.patch # Purpose: Allow OS specific sections in section groups. # Lifetime: Might be fixed in 2.33 Patch12: binutils-special-sections-in-groups.patch # Purpose: Fix linker testsuite failures. # Lifetime: Fixed in 2.33 (possibly) Patch13: binutils-fix-testsuite-failures.patch # Purpose: Stop gold from aborting when input sections with the same name # have different flags. # Lifetime: Fixed in 2.35 (maybe) Patch14: binutils-gold-mismatched-section-flags.patch # Purpose: Fix a potential use of an initialised field by readelf. # Lifetime: Fixed in 2.35 Patch15: binutils-readelf-compression-header-size.patch # Purpose: Add a check to the GOLD linker for a corrupt input file # with a fuzzed section offset. # Lifetime: Fixed in 2.35 (maybe) Patch16: binutils-CVE-2019-1010204.patch # Backport fix for CVE-2020-16592 # https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7ecb51549ab1ec22aba5aaf34b70323cf0b8509a Patch17: binutils_CVE-2020-16592.patch # Backport fix for CVE-2020-16598 # https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ca3f923f82a079dcf441419f4a50a50f8b4b33c2 Patch18: binutils_CVE-2020-16598.patch # Backport fixes for CVE-2021-20197 Patch19: binutils-gdb.git-365f5fb6d0f0da83817431a275e99e6f6babbe04.patch Patch20: binutils-gdb.git-1a1c3b4cc17687091cff5a368bd6f13742bcfdf8.patch Patch21: binutils-gdb.git-014cc7f849e8209623fc99264814bce7b3b6faf2.patch # Backport fix for CVE-2021-3487 # https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=647cebce12a6b0a26960220caff96ff38978cf24 Patch22: CVE-2021-3487.patch # update Autoconf version to 2.71 Patch23: binutils-update-autoconf-version-to-2.71.patch ### MINGW specific patches Patch102: binutils-config.patch BuildRequires: make BuildRequires: gcc BuildRequires: flex BuildRequires: bison BuildRequires: texinfo BuildRequires: zlib-devel BuildRequires: mingw32-filesystem >= 102 BuildRequires: mingw64-filesystem >= 102 %if %{run_testsuite} BuildRequires: dejagnu BuildRequires: sharutils %endif Provides: bundled(libiberty) BuildRequires: autoconf, automake %description Cross compiled binutils (utilities like 'strip', 'as', 'ld') which understand Windows executables and DLLs. %package -n mingw-binutils-generic Summary: Utilities which are needed for both the Win32 and Win64 toolchains %description -n mingw-binutils-generic Utilities (like strip and objdump) which are needed for both the Win32 and Win64 toolchains %package -n mingw32-binutils Summary: Cross-compiled version of binutils for the Win32 environment Requires: mingw-binutils-generic = %{version}-%{release} # NB: This must be left in. Requires: mingw32-filesystem >= 95 %description -n mingw32-binutils Cross compiled binutils (utilities like 'strip', 'as', 'ld') which understand Windows executables and DLLs. %package -n mingw64-binutils Summary: Cross-compiled version of binutils for the Win64 environment Requires: mingw-binutils-generic = %{version}-%{release} # NB: This must be left in. Requires: mingw64-filesystem >= 95 %description -n mingw64-binutils Cross compiled binutils (utilities like 'strip', 'as', 'ld') which understand Windows executables and DLLs. %prep %autosetup -p1 -n binutils-%{version} # See Patch02 sed -i -e 's/%''{release}/%{release}/g' bfd/Makefile{.am,.in} %build # Dependencies are not set up to rebuild the configure files # in the subdirectories. So we just rebuild the ones we care # about pushd libiberty autoconf popd pushd intl autoconf popd # We call configure directly rather than via macros, thus if # we are using LTO, we have to manually fix the broken configure # scripts #[ %{_lto_cflags}x != x ] && %{_fix_broken_configure_for_lto} mkdir build_win32 pushd build_win32 CFLAGS="%{optflags}" \ ../configure \ --build=%_build --host=%_host \ --target=%{mingw32_target} \ --disable-nls \ --with-sysroot=%{mingw32_sysroot} \ --prefix=%{_prefix} \ --bindir=%{_bindir} \ --includedir=%{_includedir} \ --libdir=%{_libdir} \ --mandir=%{_mandir} \ --infodir=%{_infodir} %make_build popd mkdir build_win64 pushd build_win64 CFLAGS="%{optflags}" \ ../configure \ --build=%_build --host=%_host \ --target=%{mingw64_target} \ --disable-nls \ --with-sysroot=%{mingw64_sysroot} \ --prefix=%{_prefix} \ --bindir=%{_bindir} \ --includedir=%{_includedir} \ --libdir=%{_libdir} \ --mandir=%{_mandir} \ --infodir=%{_infodir} %make_build popd # Create multilib versions for the tools strip, objdump nm, and objcopy mkdir build_multilib pushd build_multilib CFLAGS="%{optflags}" \ ../configure \ --build=%_build --host=%_host \ --target=%{mingw64_target} \ --enable-targets=%{mingw64_target},%{mingw32_target} \ --disable-nls \ --with-sysroot=%{mingw64_sysroot} \ --prefix=%{_prefix} \ --bindir=%{_bindir} \ --includedir=%{_includedir} \ --libdir=%{_libdir} \ --mandir=%{_mandir} \ --infodir=%{_infodir} %make_build popd %check %if !%{run_testsuite} echo ====================TESTSUITE DISABLED========================= %else pushd build_win32 make -k check < /dev/null || : echo ====================TESTING WIN32 ========================= cat {gas/testsuite/gas,ld/ld,binutils/binutils}.sum echo ====================TESTING WIN32 END===================== for file in {gas/testsuite/gas,ld/ld,binutils/binutils}.{sum,log} do ln $file binutils-%{mingw32_target}-$(basename $file) || : done tar cjf binutils-%{mingw32_target}.tar.bz2 binutils-%{mingw32_target}-*.{sum,log} uuencode binutils-%{mingw32_target}.tar.bz2 binutils-%{mingw32_target}.tar.bz2 rm -f binutils-%{mingw32_target}.tar.bz2 binutils-%{mingw32_target}-*.{sum,log} popd pushd build_win64 make -k check < /dev/null || : echo ====================TESTING WIN64 ========================= cat {gas/testsuite/gas,ld/ld,binutils/binutils}.sum echo ====================TESTING WIN64 END===================== for file in {gas/testsuite/gas,ld/ld,binutils/binutils}.{sum,log} do ln $file binutils-%{mingw64_target}-$(basename $file) || : done tar cjf binutils-%{mingw64_target}.tar.bz2 binutils-%{mingw64_target}-*.{sum,log} uuencode binutils-%{mingw64_target}.tar.bz2 binutils-%{mingw64_target}.tar.bz2 rm -f binutils-%{mingw64_target}.tar.bz2 binutils-%{mingw64_target}-*.{sum,log} popd %endif %install %mingw_make_install DESTDIR=$RPM_BUILD_ROOT make -C build_multilib DESTDIR=$RPM_BUILD_ROOT/multilib install # These files conflict with ordinary binutils. rm -rf $RPM_BUILD_ROOT%{_infodir} rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty* # Keep the multilib versions of the strip, objdump and objcopy commands # We need these for the RPM integration as these tools must be able to # both process win32 and win64 binaries mv $RPM_BUILD_ROOT/multilib%{_bindir}/%{mingw64_strip} $RPM_BUILD_ROOT%{_bindir}/%{mingw_strip} mv $RPM_BUILD_ROOT/multilib%{_bindir}/%{mingw64_objdump} $RPM_BUILD_ROOT%{_bindir}/%{mingw_objdump} mv $RPM_BUILD_ROOT/multilib%{_bindir}/%{mingw64_objcopy} $RPM_BUILD_ROOT%{_bindir}/%{mingw_objcopy} mv $RPM_BUILD_ROOT/multilib%{_bindir}/%{mingw64_nm} $RPM_BUILD_ROOT%{_bindir}/%{mingw_nm} rm -rf $RPM_BUILD_ROOT/multilib %files -n mingw-binutils-generic %license COPYING %{_mandir}/man1/* %{_bindir}/%{mingw_strip} %{_bindir}/%{mingw_objdump} %{_bindir}/%{mingw_objcopy} %{_bindir}/%{mingw_nm} %files -n mingw32-binutils %{_bindir}/%{mingw32_target}-addr2line %{_bindir}/%{mingw32_target}-ar %{_bindir}/%{mingw32_target}-as %{_bindir}/%{mingw32_target}-c++filt %{_bindir}/%{mingw32_target}-dlltool %{_bindir}/%{mingw32_target}-dllwrap %{_bindir}/%{mingw32_target}-elfedit %{_bindir}/%{mingw32_target}-gprof %{_bindir}/%{mingw32_target}-ld %{_bindir}/%{mingw32_target}-ld.bfd %{_bindir}/%{mingw32_target}-nm %{_bindir}/%{mingw32_target}-objcopy %{_bindir}/%{mingw32_target}-objdump %{_bindir}/%{mingw32_target}-ranlib %{_bindir}/%{mingw32_target}-readelf %{_bindir}/%{mingw32_target}-size %{_bindir}/%{mingw32_target}-strings %{_bindir}/%{mingw32_target}-strip %{_bindir}/%{mingw32_target}-windmc %{_bindir}/%{mingw32_target}-windres %{_prefix}/%{mingw32_target}/bin/ar %{_prefix}/%{mingw32_target}/bin/as %{_prefix}/%{mingw32_target}/bin/dlltool %{_prefix}/%{mingw32_target}/bin/ld %{_prefix}/%{mingw32_target}/bin/ld.bfd %{_prefix}/%{mingw32_target}/bin/nm %{_prefix}/%{mingw32_target}/bin/objcopy %{_prefix}/%{mingw32_target}/bin/objdump %{_prefix}/%{mingw32_target}/bin/ranlib %{_prefix}/%{mingw32_target}/bin/readelf %{_prefix}/%{mingw32_target}/bin/strip %{_prefix}/%{mingw32_target}/lib/ldscripts %files -n mingw64-binutils %{_bindir}/%{mingw64_target}-addr2line %{_bindir}/%{mingw64_target}-ar %{_bindir}/%{mingw64_target}-as %{_bindir}/%{mingw64_target}-c++filt %{_bindir}/%{mingw64_target}-dlltool %{_bindir}/%{mingw64_target}-dllwrap %{_bindir}/%{mingw64_target}-elfedit %{_bindir}/%{mingw64_target}-gprof %{_bindir}/%{mingw64_target}-ld %{_bindir}/%{mingw64_target}-ld.bfd %{_bindir}/%{mingw64_target}-nm %{_bindir}/%{mingw64_target}-objcopy %{_bindir}/%{mingw64_target}-objdump %{_bindir}/%{mingw64_target}-ranlib %{_bindir}/%{mingw64_target}-readelf %{_bindir}/%{mingw64_target}-size %{_bindir}/%{mingw64_target}-strings %{_bindir}/%{mingw64_target}-strip %{_bindir}/%{mingw64_target}-windmc %{_bindir}/%{mingw64_target}-windres %{_prefix}/%{mingw64_target}/bin/ar %{_prefix}/%{mingw64_target}/bin/as %{_prefix}/%{mingw64_target}/bin/dlltool %{_prefix}/%{mingw64_target}/bin/ld %{_prefix}/%{mingw64_target}/bin/ld.bfd %{_prefix}/%{mingw64_target}/bin/nm %{_prefix}/%{mingw64_target}/bin/objcopy %{_prefix}/%{mingw64_target}/bin/objdump %{_prefix}/%{mingw64_target}/bin/ranlib %{_prefix}/%{mingw64_target}/bin/readelf %{_prefix}/%{mingw64_target}/bin/strip %{_prefix}/%{mingw64_target}/lib/ldscripts %changelog * Mon Feb 5 2024 yinhongchang - 2.34-10 - update changelog info * Sun Feb 4 2024 yinhongchang - 2.34-9 - update version to 2.34-9 * Thu Oct 08 2020 Zhiyi Weng - 2.32-7 - Initial version