-Name: cross-i386-binutils
-ExcludeArch: %ix86
+Name: cross-i386-binutils
+ExclusiveArch: %{ix86} x86_64
%define cross 1
%define TARGET i586
BuildRequires: bison
BuildRequires: glibc-devel-static
# for some gold tests
BuildRequires: bc
-BuildRequires: makeinfo
+BuildRequires: makeinfo ncurses-devel
BuildRequires: zlib-devel-static
Requires(pre): update-alternatives
-Version: 2.24.90
+Version: 2.25
Release: 0
#
# RUN_TESTS
Summary: The gold linker
License: GPL-3.0+
Group: Development/Building
-Requires: binutils = %{version}-%{release}
-%if 0%{!?cross:1}
+Requires: %{name} = %{version}-%{release}
%define gold_archs %ix86 %arm aarch64 x86_64 ppc ppc64 %sparc
-%endif
%description gold
gold is an ELF linker. It is intended to have complete support for ELF
sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h
%build
+RPM_OPT_FLAGS="$RPM_OPT_FLAGS -DBFD_PLUGIN_LTO_NAME=liblto_plugin_%{_arch}.so"
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error"
RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS |sed -e 's/atom/i686/g'`
%if 0%{!?cross:1}
%endif
%endif
../configure CFLAGS="${RPM_OPT_FLAGS}" \
+ --enable-plugins \
+%ifarch %gold_archs
+ --enable-gold \
+%endif
--prefix=%{_prefix} \
--with-bugurl=http://bugs.opensuse.org/ \
--with-pkgversion="GNU Binutils; %{DIST}" \
make DESTDIR=$RPM_BUILD_ROOT install-gold
ln -sf ld.gold $RPM_BUILD_ROOT%{_bindir}/gold
%endif
+
make DESTDIR=$RPM_BUILD_ROOT install-info install
make -C gas/doc DESTDIR=$RPM_BUILD_ROOT install-info-am install-am
make DESTDIR=$RPM_BUILD_ROOT install-bfd install-opcodes
+# We have gdb in separate package
+rm -f %buildroot/%_bindir/gdb*
+rm -f %buildroot/%_bindir/gcore*
+
if [ ! -f "%buildroot/%_bindir/ld.bfd" ]; then
mv "%buildroot/%_bindir"/{ld,ld.bfd};
else
rm -rf $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin
mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin
ln -sf ../../bin/{ar,as,ld,nm,ranlib,strip} $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin
+%ifarch %gold_archs
+ln -sf ../../bin/ld.gold $RPM_BUILD_ROOT%{_prefix}/%{HOST}/bin
+%endif
mv $RPM_BUILD_ROOT%{_prefix}/%{HOST}/lib/ldscripts $RPM_BUILD_ROOT%{_libdir}
ln -sf ../../%{_lib}/ldscripts $RPM_BUILD_ROOT%{_prefix}/%{HOST}/lib/ldscripts
chmod a+x $RPM_BUILD_ROOT%{_libdir}/libbfd-*
chmod a+x $RPM_BUILD_ROOT%{_libdir}/libopcodes-*
# No shared linking outside binutils
-rm $RPM_BUILD_ROOT%{_libdir}/lib{bfd,opcodes}.so
-rm $RPM_BUILD_ROOT%{_libdir}/lib{bfd,opcodes}.la
+rm -f $RPM_BUILD_ROOT%{_libdir}/lib{bfd,opcodes,inproctrace}.so
+rm -f $RPM_BUILD_ROOT%{_libdir}/lib{bfd,opcodes}.la
# Remove unwanted files to shut up rpm
-rm $RPM_BUILD_ROOT%{_mandir}/man1/dlltool.1 $RPM_BUILD_ROOT%{_mandir}/man1/windres.1 $RPM_BUILD_ROOT%{_mandir}/man1/windmc.1
+rm -f $RPM_BUILD_ROOT%{_mandir}/man1/dlltool.1 $RPM_BUILD_ROOT%{_mandir}/man1/windres.1 $RPM_BUILD_ROOT%{_mandir}/man1/windmc.1
cd ..
#%find_lang binutils
#%find_lang bfd binutils.lang
rm -rf $RPM_BUILD_ROOT%{_prefix}/lib*
rm -rf $RPM_BUILD_ROOT%{_prefix}/include
rm -f $RPM_BUILD_ROOT%{_prefix}/bin/*-c++filt
+
+# We have gdb in separate package
+rm -f $RPM_BUILD_ROOT%{_bindir}/gdb*
+rm -f $RPM_BUILD_ROOT%{_bindir}/gcore*
+rm -rf $RPM_BUILD_ROOT%{_datadir}/gdb
+
> ../binutils.lang
%endif
cd $RPM_BUILD_DIR/binutils-%version
%{_libdir}/ldscripts
%{_bindir}/*
%ifarch %gold_archs
-%exclude %{_bindir}/gold
-%exclude %{_bindir}/ld.gold
+%exclude %{_bindir}/*gold
%endif
%doc %{_infodir}/*.gz
%{_libdir}/lib*-%{version}*.so
%ifarch %gold_archs
%files gold
%defattr(-,root,root)
-%{_bindir}/gold
-%{_bindir}/ld.gold
+%{_bindir}/*gold
+%if 0%{?cross:1}
+%if "%{TARGET}" == "arm"
+%{_prefix}/%{TARGET}-tizen-linux-gnueabi/bin/*gold
+%else
+%{_prefix}/%{TARGET}-tizen-linux/bin/*gold
+%endif
+%else
+%{_prefix}/%{HOST}/bin/*gold
+%endif
%endif
%if 0%{!?cross:1}
%files devel
%defattr(-,root,root)
%{_prefix}/include/*.h
+%{_prefix}/include/gdb/*.h
%{_libdir}/lib*.*a
+%{_datadir}/gdb/*
%endif
%changelog