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: expat-devel
38 BuildRequires: ncurses-devel
39 BuildRequires: zlib-devel
40 BuildRequires: gcc-c++
41 %if 0%{?binutils_run_tests}
42 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 Summary: A GNU source-level debugger for C, C++, Java and other languages
87 Group: Development/Building
91 GDB, the GNU debugger, allows you to debug programs written in C, C++,
92 Java, and other languages, by executing them in a controlled fashion
93 and printing their data.
95 %package -n gdb-server
96 Summary: A standalone server for GDB (the GNU source-level debugger)
98 %description -n gdb-server
99 GDB, the GNU debugger, allows you to debug programs written in C, C++,
100 Java, and other languages, by executing them in a controlled fashion
101 and printing their data.
103 This package provides a program that allows you to run GDB on a different machine than the one
104 which is running the program being debugged.
107 %setup -q -n binutils-%{version}
112 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error %{?cross:-DIGNORE_BROKEN_PLUGINS}"
113 export CFLAGS="${RPM_OPT_FLAGS}"
114 export CXXFLAGS="${RPM_OPT_FLAGS}"
120 --prefix=%{_prefix} --libdir=%{_libdir} \
121 --infodir=%{_infodir} --mandir=%{_mandir} \
122 --with-bugurl=https://bugs.tizen.org/ \
125 --with-separate-debug-dir=%{_prefix}/lib/debug \
127 --build=%{host_arch} --target=%{target_arch} \
128 --host=%{host_arch} \
129 %{?annobin_verification: --enable-annobin-verification=warn } \
130 %{?annobin_verification_strict: --enable-annobin-verification=strict } \
132 --enable-targets=%{target_arch} \
133 --enable-64-bit-bfd \
136 --enable-targets=aarch64-tizen-linux,armv7l-tizen-linux,armv7hl-tizen-linux,armv8l-tizen-linux,i686-tizen-linux,x86_64-tizen-linux \
142 --with-gdb-datadir=%{_datadir}/gdb \
143 --enable-gdb-build-warnings=,-Wno-unused \
144 --with-separate-debug-dir=/usr/lib/debug \
151 %{?binutils_run_tests:
152 make %{?_smp_mflags} -C build-dir check -k
157 make DESTDIR=$RPM_BUILD_ROOT install
159 # Copy instead of hardlinks
160 for binary in ar as ld{,.bfd,.gold} nm obj{dump,copy} ranlib strip
162 rm %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
164 cp %{buildroot}%{_bindir}/$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
167 cp %{buildroot}%{_bindir}/%{target_arch}-$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
171 install -m 644 libiberty/pic/libiberty.a %{buildroot}%{_prefix}/%{_lib}
172 install -m 644 ../include/libiberty.h %{buildroot}%{_prefix}/include
174 # Remove unwanted files to shut up rpm
176 rm -rf %{buildroot}%{_libdir}/lib{bfd,opcodes,inproctrace}.{so,la}
178 rm -rf %{buildroot}%{_prefix}/%{target_arch}/lib/ldscripts
179 rm -rf %{buildroot}%{_prefix}/%{host_arch}
180 rm -rf %{buildroot}%{_includedir}
181 rm -rf %{buildroot}%{_prefix}/lib*
182 rm -rf %{buildroot}%{_datadir}
186 %manifest binutils.manifest
187 %defattr(-,root,root)
189 %{_prefix}/%{target_arch}/bin/*
191 %exclude %{_bindir}/gdb*
192 %exclude %{_bindir}/ld.gold
193 %exclude %{_prefix}/%{target_arch}/bin/ld.gold
195 %{_prefix}/%{host_arch}/lib/ldscripts
198 %manifest binutils.manifest
199 %defattr(-,root,root)
201 %{_includedir}/gdb/*.h
205 %manifest binutils.manifest
206 %defattr(-,root,root)
208 %{_prefix}/%{target_arch}/bin/ld.gold
214 %{_bindir}/gdb-add-index