78a2195
%global run_testsuite 1
78a2195
6914a78
Name:           mingw-binutils
7f3e599
Version:        2.25
d3ccc97
Release:        3%{?dist}
78a2195
Summary:        Cross-compiled version of binutils for Win32 and Win64 environments
e3393a4
e3393a4
License:        GPLv2+ and LGPLv2+ and GPLv3+ and LGPLv3+
e3393a4
Group:          Development/Libraries
78a2195
5f19d59
URL:            http://www.gnu.org/software/binutils/
7f79a3d
Source0:        http://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.bz2
7f79a3d
#Source0:        http://www.kernel.org/pub/linux/devel/binutils/binutils-%{version}.tar.bz2
e3393a4
e3393a4
BuildRequires:  flex
e3393a4
BuildRequires:  bison
e3393a4
BuildRequires:  texinfo
deef2d0
BuildRequires:  zlib-devel
e1cce8f
BuildRequires:  mingw32-filesystem >= 95
78a2195
BuildRequires:  mingw64-filesystem >= 95
78a2195
%if %{run_testsuite}
78a2195
BuildRequires:  dejagnu
78a2195
BuildRequires:  sharutils
78a2195
%endif
21c0024
Provides:       bundled(libiberty)
21c0024
a0088c2
e3393a4
%description
78a2195
Cross compiled binutils (utilities like 'strip', 'as', 'ld') which
e3393a4
understand Windows executables and DLLs.
e3393a4
78a2195
%package -n mingw-binutils-generic
78a2195
Summary:        Utilities which are needed for both the Win32 and Win64 toolchains
78a2195
78a2195
%description -n mingw-binutils-generic
78a2195
Utilities (like strip and objdump) which are needed for
78a2195
both the Win32 and Win64 toolchains
e3393a4
6914a78
%package -n mingw32-binutils
78a2195
Summary:        Cross-compiled version of binutils for the Win32 environment
78a2195
Requires:       mingw-binutils-generic = %{version}-%{release}
78a2195
78a2195
# NB: This must be left in.
78a2195
Requires:       mingw32-filesystem >= 95
6914a78
6914a78
%description -n mingw32-binutils
78a2195
Cross compiled binutils (utilities like 'strip', 'as', 'ld') which
78a2195
understand Windows executables and DLLs.
78a2195
78a2195
%package -n mingw64-binutils
78a2195
Summary:        Cross-compiled version of binutils for the Win64 environment
78a2195
Requires:       mingw-binutils-generic = %{version}-%{release}
78a2195
78a2195
# NB: This must be left in.
78a2195
Requires:       mingw64-filesystem >= 95
78a2195
78a2195
%description -n mingw64-binutils
78a2195
Cross compiled binutils (utilities like 'strip', 'as', 'ld') which
6914a78
understand Windows executables and DLLs.
6914a78
6914a78
e3393a4
%prep
f3cbf49
%setup -q -n binutils-%{version}
e3393a4
e3393a4
e3393a4
%build
78a2195
mkdir build_win32
78a2195
pushd build_win32
e3393a4
CFLAGS="$RPM_OPT_FLAGS" \
e3393a4
../configure \
e3393a4
  --build=%_build --host=%_host \
258f92f
  --target=%{mingw32_target} \
Erik van Pienbroek 63f0eb5
  --disable-nls \
258f92f
  --with-sysroot=%{mingw32_sysroot} \
Erik van Pienbroek 63f0eb5
  --prefix=%{_prefix} \
Erik van Pienbroek 63f0eb5
  --bindir=%{_bindir} \
Erik van Pienbroek 63f0eb5
  --includedir=%{_includedir} \
Erik van Pienbroek 63f0eb5
  --libdir=%{_libdir} \
Erik van Pienbroek 63f0eb5
  --mandir=%{_mandir} \
Erik van Pienbroek 63f0eb5
  --infodir=%{_infodir}
e3393a4
Erik van Pienbroek 8301d31
make all %{?_smp_mflags}
78a2195
popd
78a2195
78a2195
mkdir build_win64
78a2195
pushd build_win64
78a2195
CFLAGS="$RPM_OPT_FLAGS" \
78a2195
../configure \
78a2195
  --build=%_build --host=%_host \
78a2195
  --target=%{mingw64_target} \
78a2195
  --disable-nls \
78a2195
  --with-sysroot=%{mingw64_sysroot} \
78a2195
  --prefix=%{_prefix} \
78a2195
  --bindir=%{_bindir} \
78a2195
  --includedir=%{_includedir} \
78a2195
  --libdir=%{_libdir} \
78a2195
  --mandir=%{_mandir} \
78a2195
  --infodir=%{_infodir}
78a2195
78a2195
make all %{?_smp_mflags}
78a2195
popd
78a2195
78a2195
# Create multilib versions for the tools strip, objdump and objcopy
78a2195
mkdir build_multilib
78a2195
pushd build_multilib
78a2195
CFLAGS="$RPM_OPT_FLAGS" \
78a2195
../configure \
78a2195
  --build=%_build --host=%_host \
78a2195
  --target=%{mingw64_target} \
78a2195
  --enable-targets=%{mingw64_target},%{mingw32_target} \
78a2195
  --disable-nls \
78a2195
  --with-sysroot=%{mingw64_sysroot} \
78a2195
  --prefix=%{_prefix} \
78a2195
  --bindir=%{_bindir} \
78a2195
  --includedir=%{_includedir} \
78a2195
  --libdir=%{_libdir} \
78a2195
  --mandir=%{_mandir} \
78a2195
  --infodir=%{_infodir}
78a2195
78a2195
make %{?_smp_mflags}
78a2195
popd
78a2195
78a2195
78a2195
%check
78a2195
%if !%{run_testsuite}
78a2195
echo ====================TESTSUITE DISABLED=========================
78a2195
%else
78a2195
pushd build_win32
78a2195
  make -k check < /dev/null || :
78a2195
  echo ====================TESTING WIN32 =========================
78a2195
  cat {gas/testsuite/gas,ld/ld,binutils/binutils}.sum
78a2195
  echo ====================TESTING WIN32 END=====================
78a2195
  for file in {gas/testsuite/gas,ld/ld,binutils/binutils}.{sum,log}
78a2195
  do
78a2195
    ln $file binutils-%{mingw32_target}-$(basename $file) || :
78a2195
  done
78a2195
  tar cjf binutils-%{mingw32_target}.tar.bz2 binutils-%{mingw32_target}-*.{sum,log}
78a2195
  uuencode binutils-%{mingw32_target}.tar.bz2 binutils-%{mingw32_target}.tar.bz2
78a2195
  rm -f binutils-%{mingw32_target}.tar.bz2 binutils-%{mingw32_target}-*.{sum,log}
78a2195
popd
78a2195
78a2195
pushd build_win64
78a2195
  make -k check < /dev/null || :
78a2195
  echo ====================TESTING WIN64 =========================
78a2195
  cat {gas/testsuite/gas,ld/ld,binutils/binutils}.sum
78a2195
  echo ====================TESTING WIN64 END=====================
78a2195
  for file in {gas/testsuite/gas,ld/ld,binutils/binutils}.{sum,log}
78a2195
  do
78a2195
    ln $file binutils-%{mingw64_target}-$(basename $file) || :
78a2195
  done
78a2195
  tar cjf binutils-%{mingw64_target}.tar.bz2 binutils-%{mingw64_target}-*.{sum,log}
78a2195
  uuencode binutils-%{mingw64_target}.tar.bz2 binutils-%{mingw64_target}.tar.bz2
78a2195
  rm -f binutils-%{mingw64_target}.tar.bz2 binutils-%{mingw64_target}-*.{sum,log}
78a2195
popd
78a2195
%endif
e3393a4
e3393a4
e3393a4
%install
78a2195
%mingw_make_install DESTDIR=$RPM_BUILD_ROOT
78a2195
make -C build_multilib DESTDIR=$RPM_BUILD_ROOT/multilib install
e3393a4
e3393a4
# These files conflict with ordinary binutils.
e3393a4
rm -rf $RPM_BUILD_ROOT%{_infodir}
78a2195
rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty*
e3393a4
78a2195
# Keep the multilib versions of the strip, objdump and objcopy commands
78a2195
# We need these for the RPM integration as these tools must be able to
78a2195
# both process win32 and win64 binaries
78a2195
mv $RPM_BUILD_ROOT/multilib%{_bindir}/%{mingw64_strip} $RPM_BUILD_ROOT%{_bindir}/%{mingw_strip}
78a2195
mv $RPM_BUILD_ROOT/multilib%{_bindir}/%{mingw64_objdump} $RPM_BUILD_ROOT%{_bindir}/%{mingw_objdump}
78a2195
mv $RPM_BUILD_ROOT/multilib%{_bindir}/%{mingw64_objcopy} $RPM_BUILD_ROOT%{_bindir}/%{mingw_objcopy}
78a2195
rm -rf $RPM_BUILD_ROOT/multilib
e1cce8f
e3393a4
78a2195
%files -n mingw-binutils-generic
78a2195
%doc COPYING
e3393a4
%{_mandir}/man1/*
e1cce8f
%{_bindir}/%{mingw_strip}
e1cce8f
%{_bindir}/%{mingw_objdump}
e1cce8f
%{_bindir}/%{mingw_objcopy}
78a2195
78a2195
%files -n mingw32-binutils
78a2195
%{_bindir}/%{mingw32_target}-addr2line
78a2195
%{_bindir}/%{mingw32_target}-ar
78a2195
%{_bindir}/%{mingw32_target}-as
78a2195
%{_bindir}/%{mingw32_target}-c++filt
78a2195
%{_bindir}/%{mingw32_target}-dlltool
78a2195
%{_bindir}/%{mingw32_target}-dllwrap
78a2195
%{_bindir}/%{mingw32_target}-elfedit
78a2195
%{_bindir}/%{mingw32_target}-gprof
78a2195
%{_bindir}/%{mingw32_target}-ld
78a2195
%{_bindir}/%{mingw32_target}-ld.bfd
78a2195
%{_bindir}/%{mingw32_target}-nm
78a2195
%{_bindir}/%{mingw32_target}-objcopy
78a2195
%{_bindir}/%{mingw32_target}-objdump
78a2195
%{_bindir}/%{mingw32_target}-ranlib
78a2195
%{_bindir}/%{mingw32_target}-readelf
78a2195
%{_bindir}/%{mingw32_target}-size
78a2195
%{_bindir}/%{mingw32_target}-strings
78a2195
%{_bindir}/%{mingw32_target}-strip
78a2195
%{_bindir}/%{mingw32_target}-windmc
78a2195
%{_bindir}/%{mingw32_target}-windres
78a2195
%{_prefix}/%{mingw32_target}/bin/ar
78a2195
%{_prefix}/%{mingw32_target}/bin/as
78a2195
%{_prefix}/%{mingw32_target}/bin/dlltool
78a2195
%{_prefix}/%{mingw32_target}/bin/ld
78a2195
%{_prefix}/%{mingw32_target}/bin/ld.bfd
78a2195
%{_prefix}/%{mingw32_target}/bin/nm
78a2195
%{_prefix}/%{mingw32_target}/bin/objcopy
78a2195
%{_prefix}/%{mingw32_target}/bin/objdump
78a2195
%{_prefix}/%{mingw32_target}/bin/ranlib
78a2195
%{_prefix}/%{mingw32_target}/bin/strip
258f92f
%{_prefix}/%{mingw32_target}/lib/ldscripts
e3393a4
78a2195
%files -n mingw64-binutils
78a2195
%{_bindir}/%{mingw64_target}-addr2line
78a2195
%{_bindir}/%{mingw64_target}-ar
78a2195
%{_bindir}/%{mingw64_target}-as
78a2195
%{_bindir}/%{mingw64_target}-c++filt
78a2195
%{_bindir}/%{mingw64_target}-dlltool
78a2195
%{_bindir}/%{mingw64_target}-dllwrap
78a2195
%{_bindir}/%{mingw64_target}-elfedit
78a2195
%{_bindir}/%{mingw64_target}-gprof
78a2195
%{_bindir}/%{mingw64_target}-ld
78a2195
%{_bindir}/%{mingw64_target}-ld.bfd
78a2195
%{_bindir}/%{mingw64_target}-nm
78a2195
%{_bindir}/%{mingw64_target}-objcopy
78a2195
%{_bindir}/%{mingw64_target}-objdump
78a2195
%{_bindir}/%{mingw64_target}-ranlib
78a2195
%{_bindir}/%{mingw64_target}-readelf
78a2195
%{_bindir}/%{mingw64_target}-size
78a2195
%{_bindir}/%{mingw64_target}-strings
78a2195
%{_bindir}/%{mingw64_target}-strip
78a2195
%{_bindir}/%{mingw64_target}-windmc
78a2195
%{_bindir}/%{mingw64_target}-windres
78a2195
%{_prefix}/%{mingw64_target}/bin/ar
78a2195
%{_prefix}/%{mingw64_target}/bin/as
78a2195
%{_prefix}/%{mingw64_target}/bin/dlltool
78a2195
%{_prefix}/%{mingw64_target}/bin/ld
78a2195
%{_prefix}/%{mingw64_target}/bin/ld.bfd
78a2195
%{_prefix}/%{mingw64_target}/bin/nm
78a2195
%{_prefix}/%{mingw64_target}/bin/objcopy
78a2195
%{_prefix}/%{mingw64_target}/bin/objdump
78a2195
%{_prefix}/%{mingw64_target}/bin/ranlib
78a2195
%{_prefix}/%{mingw64_target}/bin/strip
78a2195
%{_prefix}/%{mingw64_target}/lib/ldscripts
78a2195
e3393a4
e3393a4
%changelog
d3ccc97
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.25-3
d3ccc97
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
d3ccc97
1febe89
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.25-2
1febe89
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
1febe89
7f3e599
* Tue Dec 23 2014 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.25-1
7f3e599
- Update to 2.25
7f3e599
175c856
* Tue Dec 23 2014 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.24-5
175c856
- Fix CVE-2014-8501 (RHBZ #1162578 #1162583)
175c856
- Fix CVE-2014-8502 (RHBZ #1162602)
175c856
- Fix CVE-2014-8503 (RHBZ #1162612)
175c856
- Fix CVE-2014-8504 (RHBZ #1162626)
175c856
- Fix CVE-2014-8737 (RHBZ #1162660)
175c856
- Fix CVE-2014-8738 (RHBZ #1162673)
175c856
f4a27ad
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.24-4
f4a27ad
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
f4a27ad
03d6836
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.24-3
03d6836
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
03d6836
a0088c2
* Fri May 30 2014 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.24-2
a0088c2
- Fix FTBFS against gcc 4.9
a0088c2
7f79a3d
* Sat Jan 11 2014 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.24-1
7f79a3d
- Update to 2.24
7f79a3d
7bff2c3
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.23.52.0.1-2
7bff2c3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
7bff2c3
8ce795d
* Wed Apr  3 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.23.52.0.1-1
8ce795d
- Update to 2.23.52.0.1
8ce795d
- Fixes FTBFS against latest texinfo
8ce795d
- Resolve build failure on PPC
8ce795d
b64cd53
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.23.51.0.5-4
b64cd53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
b64cd53
21c0024
* Tue Jan 22 2013 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.23.51.0.5-3
21c0024
- Backported patch to fix 'unexpected version string length' error in windres (RHBZ #902960)
21c0024
deef2d0
* Tue Nov 27 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.23.51.0.5-2
deef2d0
- Added BR: zlib-devel to enable support for compressed debug sections
deef2d0
f680200
* Wed Nov 21 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.23.51.0.5-1
f680200
- Update to 2.23.51.0.5 release
f680200
df2d6c8
* Mon Oct 15 2012 Jon Ciesla <limburgher@gmail.com> - 2.22.52.0.4-2
df2d6c8
- Provides: bundled(libiberty)
df2d6c8
181c10d
* Wed Jul 18 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.22.52.0.4-1
181c10d
- Update to 2.22.52.0.4 release
181c10d
08252a4
* Sat Jun  2 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.22.52.0.3-1
08252a4
- Update to 2.22.52.0.3 release
08252a4
8ce795d
* Sun Apr  8 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.22.52-4
e0aeb0a
- Cleaned up unneeded %%global tags
e0aeb0a
78a2195
* Tue Mar  6 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.22.52-3
78a2195
- Made the package compliant with the new MinGW packaging guidelines
78a2195
- Added win64 support
78a2195
- Added a mingw-binutils-generic package containing toolchain
78a2195
  utilities which can be used by both the win32 and win64 toolchains
78a2195
- Enable the testsuite
78a2195
- Package the license
78a2195
- Fix source URL
78a2195
6914a78
* Tue Mar  6 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.22.52-2
6914a78
- Renamed the source package to mingw-binutils (RHBZ #673786)
258f92f
- Use mingw macros without leading underscore
6914a78
Erik van Pienbroek 63f0eb5
* Sat Feb 25 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.22.52-1
Erik van Pienbroek 63f0eb5
- Update to 2.22.52 20120225 snapshot
e1cce8f
- Bump the BR/R: mingw32-filesystem to >= 95
e1cce8f
- Rebuild using the i686-w64-mingw32 triplet
Erik van Pienbroek 63f0eb5
- Dropped some obsolete configure arguments
e1cce8f
- Temporary provide mingw-strip, mingw-objdump and mingw-objcopy
e1cce8f
  in preparation for win32+win64 support
Erik van Pienbroek 63f0eb5
Erik van Pienbroek 8301d31
* Tue Jan 10 2012 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.22-1
Erik van Pienbroek 8301d31
- Update to 2.22
Erik van Pienbroek 8301d31
- Dropped unneeded RPM tags
Erik van Pienbroek 8301d31
- Use parallel make
Erik van Pienbroek 8301d31
Kalev Lember c433fa8
* Tue May 10 2011 Kalev Lember <kalev@smartlink.ee> - 2.21-2
Kalev Lember c433fa8
- Default to runtime pseudo reloc v2 now that mingw32-runtime 3.18 is in
Kalev Lember c433fa8
Kalev Lember 26d2be0
* Thu Mar 17 2011 Kalev Lember <kalev@smartlink.ee> - 2.21-1
Kalev Lember 26d2be0
- Update to 2.21
Kalev Lember e8523ce
- Added a patch to use runtime pseudo reloc v1 by default as the version of
Kalev Lember e8523ce
  mingw32-runtime we have does not support v2.
Kalev Lember eeaebcf
- Don't own the /usr/i686-pc-mingw32/bin/ directory
Kalev Lember 26d2be0
3b4f6eb
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.20.51.0.10-2
3b4f6eb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
3b4f6eb
24ae27b
* Tue Sep  7 2010 Richard W.M. Jones <rjones@redhat.com> - 2.20.51.0.10-1
24ae27b
- Synchronize with Fedora native version (2.20.51.0.10).
24ae27b
- Note however that we are not using any Fedora patches.
24ae27b
5f19d59
* Thu May 13 2010 Kalev Lember <kalev@smartlink.ee> - 2.20.1-1
5f19d59
- Update to 2.20.1
5f19d59
47da1f4
* Wed Sep 16 2009 Kalev Lember <kalev@smartlink.ee> - 2.19.51.0.14-1
47da1f4
- Update to 2.19.51.0.14
47da1f4
fbaf440
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.19.1-5
fbaf440
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
fbaf440
f3cbf49
* Tue Mar 10 2009 Richard W.M. Jones <rjones@redhat.com> - 2.19.1-4
f3cbf49
- Switch to using upstream (GNU) binutils 2.19.1.  It's exactly the
f3cbf49
  same as the MinGW version now.
f3cbf49
7316d9a
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.19.1-3
7316d9a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
7316d9a
a124d5b
* Fri Feb 20 2009 Richard W.M. Jones <rjones@redhat.com> - 2.19.1-2
a124d5b
- Rebuild for mingw32-gcc 4.4
a124d5b
cc4a835
* Tue Feb 10 2009 Richard W.M. Jones <rjones@redhat.com> - 2.19.1-1
cc4a835
- New upstream version 2.19.1.
cc4a835
b3f966b
* Mon Dec 15 2008 Richard W.M. Jones <rjones@redhat.com> - 2.19-1
b3f966b
- New upstream version 2.19.
b3f966b
ae6ac22
* Sat Nov 29 2008 Richard W.M. Jones <rjones@redhat.com> - 2.18.50_20080109_2-10
ae6ac22
- Must runtime-require mingw32-filesystem.
ae6ac22
ae6ac22
* Fri Nov 21 2008 Levente Farkas <lfarkas@lfarkas.org> - 2.18.50_20080109_2-9
ae6ac22
- BR mingw32-filesystem >= 38
ae6ac22
e3393a4
* Wed Sep 24 2008 Richard W.M. Jones <rjones@redhat.com> - 2.18.50_20080109_2-8
e3393a4
- Rename mingw -> mingw32.
e3393a4
- BR mingw32-filesystem >= 26.
e3393a4
e3393a4
* Thu Sep  4 2008 Richard W.M. Jones <rjones@redhat.com> - 2.18.50_20080109_2-7
e3393a4
- Use mingw-filesystem.
e3393a4
e3393a4
* Mon Jul  7 2008 Richard W.M. Jones <rjones@redhat.com> - 2.18.50_20080109_2-5
e3393a4
- Initial RPM release, largely based on earlier work from several sources.