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: expat-devel
35 BuildRequires: ncurses-devel
36 BuildRequires: zlib-devel
37 BuildRequires: gcc-c++
38 %if 0%{?binutils_run_tests}
39 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 Summary: A GNU source-level debugger for C, C++, Java and other languages
84 Group: Development/Building
88 GDB, the GNU debugger, allows you to debug programs written in C, C++,
89 Java, and other languages, by executing them in a controlled fashion
90 and printing their data.
92 %package -n gdb-server
93 Summary: A standalone server for GDB (the GNU source-level debugger)
95 %description -n gdb-server
96 GDB, the GNU debugger, allows you to debug programs written in C, C++,
97 Java, and other languages, by executing them in a controlled fashion
98 and printing their data.
100 This package provides a program that allows you to run GDB on a different machine than the one
101 which is running the program being debugged.
104 %setup -q -n binutils-%{version}
109 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error %{?cross:-DIGNORE_BROKEN_PLUGINS}"
110 export CFLAGS="${RPM_OPT_FLAGS}"
111 export CXXFLAGS="${RPM_OPT_FLAGS}"
117 --prefix=%{_prefix} --libdir=%{_libdir} \
118 --infodir=%{_infodir} --mandir=%{_mandir} \
119 --with-bugurl=https://bugs.tizen.org/ \
122 --with-separate-debug-dir=%{_prefix}/lib/debug \
124 --build=%{host_arch} --target=%{target_arch} \
125 --host=%{host_arch} \
126 %{?annobin_verification: --enable-annobin-verification=warn } \
127 %{?annobin_verification_strict: --enable-annobin-verification=strict } \
129 --enable-targets=%{target_arch} \
130 --enable-64-bit-bfd \
133 --enable-targets=aarch64-tizen-linux,armv7l-tizen-linux,armv7hl-tizen-linux,armv8l-tizen-linux,i686-tizen-linux,x86_64-tizen-linux \
139 --with-gdb-datadir=%{_datadir}/gdb \
140 --enable-gdb-build-warnings=,-Wno-unused \
141 --with-separate-debug-dir=/usr/lib/debug \
148 %{?binutils_run_tests:
149 make %{?_smp_mflags} -C build-dir check -k
154 make DESTDIR=$RPM_BUILD_ROOT install
156 # Copy instead of hardlinks
157 for binary in ar as ld{,.bfd,.gold} nm obj{dump,copy} ranlib strip
159 rm %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
161 cp %{buildroot}%{_bindir}/$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
164 cp %{buildroot}%{_bindir}/%{target_arch}-$binary %{buildroot}%{_prefix}/%{target_arch}/bin/$binary
168 install -m 644 libiberty/pic/libiberty.a %{buildroot}%{_prefix}/%{_lib}
169 install -m 644 ../include/libiberty.h %{buildroot}%{_prefix}/include
171 # Remove unwanted files to shut up rpm
173 rm -rf %{buildroot}%{_libdir}/lib{bfd,opcodes,inproctrace}.{so,la}
175 rm -rf %{buildroot}%{_prefix}/%{target_arch}/lib/ldscripts
176 rm -rf %{buildroot}%{_prefix}/%{host_arch}
177 rm -rf %{buildroot}%{_includedir}
178 rm -rf %{buildroot}%{_prefix}/lib*
179 rm -rf %{buildroot}%{_datadir}
183 %manifest binutils.manifest
184 %defattr(-,root,root)
186 %{_prefix}/%{target_arch}/bin/*
188 %exclude %{_bindir}/gdb*
189 %exclude %{_bindir}/ld.gold
190 %exclude %{_prefix}/%{target_arch}/bin/ld.gold
192 %{_prefix}/%{host_arch}/lib/ldscripts
195 %manifest binutils.manifest
196 %defattr(-,root,root)
198 %{_includedir}/gdb/*.h
202 %manifest binutils.manifest
203 %defattr(-,root,root)
205 %{_prefix}/%{target_arch}/bin/ld.gold
211 %{_bindir}/gdb-add-index