18 %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
20 %define target_cpu %{?cross}%{!?cross:%{ARCH}}
21 %define target_abi %{?cross:%{?armv7l:eabi}}%{!?cross:%{?ABI}}
23 %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi}
25 Name: binutils%{?cross:-%{cross}}
26 BuildRequires: makeinfo
29 BuildRequires: ncurses-devel
30 BuildRequires: zlib-devel
31 BuildRequires: gcc-c++
34 Url: http://www.gnu.org/software/binutils/
36 License: GFDL-1.3 and GPL-3.0+
37 Group: Development/Building
38 %{?cross:ExcludeArch: %{cross}}
39 Source: binutils-%{version}.tar.bz2
40 Source1001: binutils.manifest
43 C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib,
44 size, strings, and strip. These utilities are needed whenever you want
45 to compile a program or kernel.
49 Summary: The gold linker
51 Group: Development/Building
54 gold is an ELF linker. It is intended to have complete support for ELF
55 and to run as fast as possible on modern systems. For normal use it is
56 a drop-in replacement for the older GNU linker.
60 Summary: GNU binutils (BFD development files)
62 Group: Development/Building
66 This package includes header files and static libraries necessary to
67 build programs which use the GNU BFD library, which is part of
72 %setup -q -n binutils-%{version}
77 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error %{?cross:-DIGNORE_BROKEN_PLUGINS}"
78 export CFLAGS="${RPM_OPT_FLAGS}"
79 export CXXFLAGS="${RPM_OPT_FLAGS}"
85 --prefix=%{_prefix} --libdir=%{_libdir} \
86 --infodir=%{_infodir} --mandir=%{_mandir} \
87 --with-bugurl=http://bugs.tizen.org/ \
90 --with-separate-debug-dir=%{_prefix}/lib/debug \
92 --build=%{host_arch} --target=%{target_arch} \
95 --enable-targets=%{target_arch} \
99 --enable-targets=aarch64-tizen-linux,armv7l-tizen-linux,armv8l-tizen-linux,i686-tizen-linux,x86_64-tizen-linux \
110 make DESTDIR=$RPM_BUILD_ROOT install
112 # Copy instead of hardlinks
113 for binary in ar as ld{,.bfd,.gold} nm obj{dump,copy} ranlib strip
115 rm %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
117 cp %{buildroot}%{_bindir}/$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
120 cp %{buildroot}%{_bindir}/%{target_arch}-$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
124 install -m 644 libiberty/pic/libiberty.a %{buildroot}%{_prefix}/%{_lib}
125 install -m 644 ../include/libiberty.h %{buildroot}%{_prefix}/include
127 # Remove unwanted files to shut up rpm
129 rm -rf %{buildroot}%{_bindir}/gcore
130 rm -rf %{buildroot}%{_bindir}/gdb*
131 rm -rf %{buildroot}%{_datadir}/gdb
132 rm -rf %{buildroot}%{_libdir}/lib{bfd,opcodes,inproctrace}.{so,la}
134 rm -rf %{buildroot}%{_prefix}/%{target_arch}/lib/ldscripts
135 rm -rf %{buildroot}%{_prefix}/%{host_arch}
136 rm -rf %{buildroot}%{_includedir}
137 rm -rf %{buildroot}%{_prefix}/lib*
138 rm -rf %{buildroot}%{_datadir}
142 %manifest binutils.manifest
143 %defattr(-,root,root)
145 %{_prefix}/%{target_arch}/bin/*
147 %exclude %{_bindir}/ld.gold
148 %exclude %{_prefix}/%{target_arch}/bin/ld.gold
150 %{_prefix}/%{host_arch}/lib/ldscripts
153 %manifest binutils.manifest
154 %defattr(-,root,root)
156 %{_includedir}/gdb/*.h
160 %manifest binutils.manifest
161 %defattr(-,root,root)
163 %{_prefix}/%{target_arch}/bin/ld.gold