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 \
109 make DESTDIR=$RPM_BUILD_ROOT install
111 # Copy instead of hardlinks
112 for binary in ar as ld{,.bfd,.gold} nm obj{dump,copy} ranlib strip
114 rm %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
116 cp %{buildroot}%{_bindir}/$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
119 cp %{buildroot}%{_bindir}/%{target_arch}-$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
123 install -m 644 libiberty/pic/libiberty.a %{buildroot}%{_prefix}/%{_lib}
124 install -m 644 ../include/libiberty.h %{buildroot}%{_prefix}/include
126 # Remove unwanted files to shut up rpm
128 rm -rf %{buildroot}%{_bindir}/gcore
129 rm -rf %{buildroot}%{_bindir}/gdb*
130 rm -rf %{buildroot}%{_datadir}/gdb
131 rm -rf %{buildroot}%{_libdir}/lib{bfd,opcodes,inproctrace}.{so,la}
133 rm -rf %{buildroot}%{_prefix}/%{target_arch}/lib/ldscripts
134 rm -rf %{buildroot}%{_prefix}/%{host_arch}
135 rm -rf %{buildroot}%{_includedir}
136 rm -rf %{buildroot}%{_prefix}/lib*
137 rm -rf %{buildroot}%{_datadir}
141 %manifest binutils.manifest
142 %defattr(-,root,root)
144 %{_prefix}/%{target_arch}/bin/*
146 %exclude %{_bindir}/ld.gold
147 %exclude %{_prefix}/%{target_arch}/bin/ld.gold
149 %{_prefix}/%{host_arch}/lib/ldscripts
152 %manifest binutils.manifest
153 %defattr(-,root,root)
155 %{_includedir}/gdb/*.h
159 %manifest binutils.manifest
160 %defattr(-,root,root)
162 %{_prefix}/%{target_arch}/bin/ld.gold