19 %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
21 %define target_cpu %{?cross}%{!?cross:%{ARCH}}
22 %define target_abi %{?cross:%{?armv7l:eabi}%{?armv7hl:eabihf}}%{!?cross:%{?ABI}}
24 %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi}
27 %define binutils_run_tests 1
30 Name: binutils%{?cross:-%{cross}}
31 BuildRequires: makeinfo
34 BuildRequires: ncurses-devel
35 BuildRequires: zlib-devel
36 BuildRequires: gcc-c++
37 %if 0%{?binutils_run_tests}
38 BuildRequires: dejagnu
40 BuildRequires: glibc-devel-static
44 Url: http://www.gnu.org/software/binutils/
46 License: GFDL-1.3 and GPL-3.0+
47 Group: Development/Building
48 %{?cross:ExcludeArch: %{cross}}
49 Source: binutils-%{version}.tar.bz2
50 Source1001: binutils.manifest
53 C compiler utilities: ar, as, gprof, ld, nm, objcopy, objdump, ranlib,
54 size, strings, and strip. These utilities are needed whenever you want
55 to compile a program or kernel.
59 Summary: The gold linker
61 Group: Development/Building
64 gold is an ELF linker. It is intended to have complete support for ELF
65 and to run as fast as possible on modern systems. For normal use it is
66 a drop-in replacement for the older GNU linker.
70 Summary: GNU binutils (BFD development files)
72 Group: Development/Building
76 This package includes header files and static libraries necessary to
77 build programs which use the GNU BFD library, which is part of
82 %setup -q -n binutils-%{version}
87 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error %{?cross:-DIGNORE_BROKEN_PLUGINS}"
88 export CFLAGS="${RPM_OPT_FLAGS}"
89 export CXXFLAGS="${RPM_OPT_FLAGS}"
95 --prefix=%{_prefix} --libdir=%{_libdir} \
96 --infodir=%{_infodir} --mandir=%{_mandir} \
97 --with-bugurl=http://bugs.tizen.org/ \
100 --with-separate-debug-dir=%{_prefix}/lib/debug \
102 --build=%{host_arch} --target=%{target_arch} \
103 --host=%{host_arch} \
104 %{?annobin_verification: --enable-annobin-verification=warn } \
105 %{?annobin_verification_strict: --enable-annobin-verification=strict } \
107 --enable-targets=%{target_arch} \
108 --enable-64-bit-bfd \
111 --enable-targets=aarch64-tizen-linux,armv7l-tizen-linux,armv7hl-tizen-linux,armv8l-tizen-linux,i686-tizen-linux,x86_64-tizen-linux \
121 %{?binutils_run_tests:
122 make %{?_smp_mflags} -C build-dir check -k
127 make DESTDIR=$RPM_BUILD_ROOT install
129 # Copy instead of hardlinks
130 for binary in ar as ld{,.bfd,.gold} nm obj{dump,copy} ranlib strip
132 rm %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
134 cp %{buildroot}%{_bindir}/$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
137 cp %{buildroot}%{_bindir}/%{target_arch}-$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
141 install -m 644 libiberty/pic/libiberty.a %{buildroot}%{_prefix}/%{_lib}
142 install -m 644 ../include/libiberty.h %{buildroot}%{_prefix}/include
144 # Remove unwanted files to shut up rpm
146 rm -rf %{buildroot}%{_bindir}/gcore
147 rm -rf %{buildroot}%{_bindir}/gdb*
148 rm -rf %{buildroot}%{_datadir}/gdb
149 rm -rf %{buildroot}%{_libdir}/lib{bfd,opcodes,inproctrace}.{so,la}
151 rm -rf %{buildroot}%{_prefix}/%{target_arch}/lib/ldscripts
152 rm -rf %{buildroot}%{_prefix}/%{host_arch}
153 rm -rf %{buildroot}%{_includedir}
154 rm -rf %{buildroot}%{_prefix}/lib*
155 rm -rf %{buildroot}%{_datadir}
159 %manifest binutils.manifest
160 %defattr(-,root,root)
162 %{_prefix}/%{target_arch}/bin/*
164 %exclude %{_bindir}/ld.gold
165 %exclude %{_prefix}/%{target_arch}/bin/ld.gold
167 %{_prefix}/%{host_arch}/lib/ldscripts
170 %manifest binutils.manifest
171 %defattr(-,root,root)
173 %{_includedir}/gdb/*.h
177 %manifest binutils.manifest
178 %defattr(-,root,root)
180 %{_prefix}/%{target_arch}/bin/ld.gold