22 %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
24 %define target_cpu %{?cross}%{!?cross:%{ARCH}}
25 %define target_abi %{?cross:%{?armv7l:eabi}%{?armv7hl:eabihf}}%{!?cross:%{?ABI}}
27 %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi}
30 %define binutils_run_tests 1
33 Name: binutils%{?cross:-%{cross}}
34 BuildRequires: makeinfo
37 BuildRequires: ncurses-devel
38 BuildRequires: zlib-devel
39 BuildRequires: gcc-c++
40 %if 0%{?binutils_run_tests}
41 BuildRequires: dejagnu
43 BuildRequires: glibc-devel-static
47 Url: http://www.gnu.org/software/binutils/
49 License: GFDL-1.3 and GPL-3.0+
50 Group: Development/Building
51 %{?cross:ExcludeArch: %{cross}}
52 Source: binutils-%{version}.tar.bz2
53 Source1001: binutils.manifest
56 C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib,
57 size, strings, and strip. These utilities are needed whenever you want
58 to compile a program or kernel.
62 Summary: The gold linker
64 Group: Development/Building
67 gold is an ELF linker. It is intended to have complete support for ELF
68 and to run as fast as possible on modern systems. For normal use it is
69 a drop-in replacement for the older GNU linker.
73 Summary: GNU binutils (BFD development files)
75 Group: Development/Building
79 This package includes header files and static libraries necessary to
80 build programs which use the GNU BFD library, which is part of
85 %setup -q -n binutils-%{version}
90 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error %{?cross:-DIGNORE_BROKEN_PLUGINS}"
91 export CFLAGS="${RPM_OPT_FLAGS}"
92 export CXXFLAGS="${RPM_OPT_FLAGS}"
98 --prefix=%{_prefix} --libdir=%{_libdir} \
99 --infodir=%{_infodir} --mandir=%{_mandir} \
100 --with-bugurl=http://bugs.tizen.org/ \
103 --with-separate-debug-dir=%{_prefix}/lib/debug \
105 --build=%{host_arch} --target=%{target_arch} \
106 --host=%{host_arch} \
108 --enable-targets=%{target_arch} \
109 --enable-64-bit-bfd \
112 --enable-targets=aarch64-tizen-linux,armv7l-tizen-linux,armv7hl-tizen-linux,armv8l-tizen-linux,i686-tizen-linux,x86_64-tizen-linux \
122 %{?binutils_run_tests:
123 make %{?_smp_mflags} -C build-dir check -k
128 make DESTDIR=$RPM_BUILD_ROOT install
130 # Copy instead of hardlinks
131 for binary in ar as ld{,.bfd,.gold} nm obj{dump,copy} ranlib strip
133 rm %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
135 cp %{buildroot}%{_bindir}/$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
138 cp %{buildroot}%{_bindir}/%{target_arch}-$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
142 install -m 644 libiberty/pic/libiberty.a %{buildroot}%{_prefix}/%{_lib}
143 install -m 644 ../include/libiberty.h %{buildroot}%{_prefix}/include
145 # Remove unwanted files to shut up rpm
147 rm -rf %{buildroot}%{_bindir}/gcore
148 rm -rf %{buildroot}%{_bindir}/gdb*
149 rm -rf %{buildroot}%{_datadir}/gdb
150 rm -rf %{buildroot}%{_libdir}/lib{bfd,opcodes,inproctrace}.{so,la}
152 rm -rf %{buildroot}%{_prefix}/%{target_arch}/lib/ldscripts
153 rm -rf %{buildroot}%{_prefix}/%{host_arch}
154 rm -rf %{buildroot}%{_includedir}
155 rm -rf %{buildroot}%{_prefix}/lib*
156 rm -rf %{buildroot}%{_datadir}
160 %manifest binutils.manifest
161 %defattr(-,root,root)
163 %{_prefix}/%{target_arch}/bin/*
165 %exclude %{_bindir}/ld.gold
166 %exclude %{_prefix}/%{target_arch}/bin/ld.gold
168 %{_prefix}/%{host_arch}/lib/ldscripts
171 %manifest binutils.manifest
172 %defattr(-,root,root)
174 %{_includedir}/gdb/*.h
178 %manifest binutils.manifest
179 %defattr(-,root,root)
181 %{_prefix}/%{target_arch}/bin/ld.gold