15 %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
17 %define target_cpu %{?cross}%{!?cross:%{ARCH}}
18 %define target_abi %{?cross:%{?armv7l:eabi}}%{!?cross:%{?ABI}}
20 %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi}
22 Name: binutils%{?cross:-%{cross}}
23 BuildRequires: makeinfo
26 BuildRequires: ncurses-devel
27 BuildRequires: zlib-devel
28 BuildRequires: gcc-c++
31 Url: http://www.gnu.org/software/binutils/
33 License: GFDL-1.3 and GPL-3.0+
34 Group: Development/Building
35 %{?cross:ExcludeArch: %{cross}}
36 Source: binutils-%{version}.tar.bz2
37 Source1001: binutils.manifest
40 C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib,
41 size, strings, and strip. These utilities are needed whenever you want
42 to compile a program or kernel.
46 Summary: The gold linker
48 Group: Development/Building
51 gold is an ELF linker. It is intended to have complete support for ELF
52 and to run as fast as possible on modern systems. For normal use it is
53 a drop-in replacement for the older GNU linker.
57 Summary: GNU binutils (BFD development files)
59 Group: Development/Building
63 This package includes header files and static libraries necessary to
64 build programs which use the GNU BFD library, which is part of
69 %setup -q -n binutils-%{version}
74 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error %{?cross:-DIGNORE_BROKEN_PLUGINS}"
75 export CFLAGS="${RPM_OPT_FLAGS}"
76 export CXXFLAGS="${RPM_OPT_FLAGS}"
82 --prefix=%{_prefix} --libdir=%{_libdir} \
83 --infodir=%{_infodir} --mandir=%{_mandir} \
84 --with-bugurl=http://bugs.tizen.org/ \
87 --with-separate-debug-dir=%{_prefix}/lib/debug \
89 --build=%{host_arch} --target=%{target_arch} \
92 --enable-targets=%{target_arch} \
96 --enable-targets=aarch64-tizen-linux,armv7l-tizen-linux,armv8l-tizen-linux,i686-tizen-linux,x86_64-tizen-linux \
106 make DESTDIR=$RPM_BUILD_ROOT install
108 # Copy instead of hardlinks
109 for binary in ar as ld{,.bfd,.gold} nm obj{dump,copy} ranlib strip
111 rm %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
113 cp %{buildroot}%{_bindir}/$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
116 cp %{buildroot}%{_bindir}/%{target_arch}-$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
120 install -m 644 libiberty/pic/libiberty.a %{buildroot}%{_prefix}/%{_lib}
121 install -m 644 ../include/libiberty.h %{buildroot}%{_prefix}/include
123 # Remove unwanted files to shut up rpm
125 rm -rf %{buildroot}%{_bindir}/gcore
126 rm -rf %{buildroot}%{_bindir}/gdb*
127 rm -rf %{buildroot}%{_datadir}/gdb
128 rm -rf %{buildroot}%{_libdir}/lib{bfd,opcodes,inproctrace}.{so,la}
130 rm -rf %{buildroot}%{_prefix}/%{target_arch}/lib/ldscripts
131 rm -rf %{buildroot}%{_prefix}/%{host_arch}
132 rm -rf %{buildroot}%{_includedir}
133 rm -rf %{buildroot}%{_prefix}/lib*
134 rm -rf %{buildroot}%{_datadir}
138 %manifest binutils.manifest
139 %defattr(-,root,root)
141 %{_prefix}/%{target_arch}/bin/*
143 %exclude %{_bindir}/ld.gold
144 %exclude %{_prefix}/%{target_arch}/bin/ld.gold
146 %{_prefix}/%{host_arch}/lib/ldscripts
149 %manifest binutils.manifest
150 %defattr(-,root,root)
152 %{_includedir}/gdb/*.h
156 %manifest binutils.manifest
157 %defattr(-,root,root)
159 %{_prefix}/%{target_arch}/bin/ld.gold