1 # TODO: PR/26302 <https://sourceware.org/bugzilla/show_bug.cgi?id=26302> (breaks kernel-tools build)
4 %bcond_with allarchs # enable all targets
5 # define addtargets x,y,z # build with additional targets x,y,z (e.g. x86_64-linux)
6 # http://sourceware.org/ml/binutils/2008-03/msg00162.html
7 %bcond_with pax # without PaX flags (for upstream bugreports)
8 %bcond_without gold # don't build gold (no C++ dependencies)
9 %bcond_without default_bfd # default ld.bfd instead of gold
10 %bcond_without debuginfod # debuginfo lokups with debuginfod
11 %bcond_without gprofng # gprofng
12 %bcond_without jansson # Package Metadata embedding support
13 %bcond_without msgpack # msgpack support
14 %bcond_with tests # check target
16 %ifnarch %{ix86} %{x8664} x32 aarch64 %{arm}
19 %ifnarch %{ix86} %{x8664} aarch64
20 %undefine with_gprofng 1
23 Summary: GNU Binary Utility Development Utilities
24 Summary(de.UTF-8): GNU Binary Utility Development Utilities
25 Summary(es.UTF-8): Utilitarios para desarrollo de binarios de la GNU
26 Summary(fr.UTF-8): Utilitaires de développement binaire de GNU
27 Summary(pl.UTF-8): Narzędzia GNU dla programistów
28 Summary(pt_BR.UTF-8): Utilitários para desenvolvimento de binários da GNU
29 Summary(ru.UTF-8): Набор инструментов GNU для построения исполняемых программ
30 Summary(tr.UTF-8): GNU geliştirme araçları
31 Summary(uk.UTF-8): Набір інструментів GNU для побудови виконуваних програм
37 Group: Development/Tools
38 Source0: https://ftp.gnu.org/gnu/binutils/%{name}-%{version}.tar.lz
39 # Source0-md5: be3411283c27eb0984104a2fda12e102
40 Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
41 # Source1-md5: a717d9707ec77d82acb6ec9078c472d6
42 Patch1: %{name}-info.patch
43 Patch2: %{name}-libtool-relink.patch
44 Patch3: %{name}-pt_pax_flags.patch
46 Patch6: %{name}-absolute-gnu_debuglink-path.patch
47 Patch7: %{name}-libtool-m.patch
48 Patch9: %{name}-tooldir.patch
49 Patch10: %{name}-sanity-check.patch
50 URL: http://www.sourceware.org/binutils/
51 BuildRequires: autoconf >= 2.69
52 BuildRequires: automake >= 1:1.11
54 %{?with_debuginfod:BuildRequires: elfutils-debuginfod-devel >= 0.179}
56 BuildRequires: gettext-tools
57 %{?with_jansson:BuildRequires: jansson-devel}
58 %{?with_gold:BuildRequires: libstdc++-devel >= 6:4.0-1}
59 %{?with_tests:BuildRequires: libstdc++-static >= 6:4.0}
61 %{?with_msgpack:BuildRequires: msgpack-devel}
62 BuildRequires: perl-tools-pod
63 BuildRequires: pkgconfig
64 BuildRequires: rpmbuild(macros) >= 1.527
66 BuildRequires: sparc32
68 BuildRequires: tar >= 1:1.22
69 BuildRequires: texinfo >= 6.3
70 BuildRequires: zlib-devel
71 %{?with_tests:BuildRequires: zlib-static}
72 BuildRequires: zstd-devel
73 %{?with_debuginfod:Requires: elfutils-debuginfod-libs >= 0.179}
74 Conflicts: gcc-c++ < 5:3.3
75 Conflicts: modutils < 2.4.17
76 Conflicts: rpmbuild(macros) < 1.660
77 Obsoletes: binutils-gold < 3:2.21.51.0.7-2
78 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
81 Binutils is a collection of binary utilities, including:
82 - ar - create, modify and extract from archives,
83 - nm - lists symbols from object files,
84 - objcopy - copy and translate object files,
85 - objdump - display information from object files,
86 - ranlib - generate an index for the contents of an archive,
87 - size - list the section sizes of an object or archive file,
88 - strings - list printable strings from files,
89 - strip - discard symbols,
90 - addr2line - convert addresses to file and line.
92 %description -l es.UTF-8
93 Binutils es una colección de utilitarios necesarios para compilar
94 programas. Incluye assembler y linker, así como varios otros programas
95 para trabajar con formatos que se puedan ejecutar.
97 %description -l pl.UTF-8
98 Pakiet binutils zawiera zestaw narzędzi umożliwiających kompilację
99 programów. Znajdują się tutaj między innymi assembler, konsolidator
100 (linker), a także inne narzędzia do manipulowania binarnymi plikami
101 programów i bibliotek.
103 %description -l pt_BR.UTF-8
104 binutils é uma coletânea de utilitários necessários para compilar
105 programas. Inclui assembler e linker, assim como vários outros
106 programas para trabalhar com formatos executáveis.
108 %description -l ru.UTF-8
109 binutils - это набор инструментов, необходимых для компилляции
110 программ. Включает ассемблер, компоновщик и набор других программ для
111 работы с исполняемыми файлами разнообразных форматов.
113 %description -l uk.UTF-8
114 binutils - це набір інструментів, необхідних для компіляції програм.
115 Містить асемблер, компоновщик та інші програми, необхідні для роботи з
116 виконуваними файлами різних форматів.
119 Summary: GNU binutils shared libraries
120 Summary(pl.UTF-8): Biblioteki współdzielone GNU binutils
122 Conflicts: binutils < 3:2.17.50.0.8-3
125 GNU binutils shared libraries (libbfd, libopcodes).
127 %description libs -l pl.UTF-8
128 Biblioteki współdzielone GNU binutils (libbfd, libopcodes).
131 Summary: Development files for GNU binutils libraries
132 Summary(pl.UTF-8): Pliki programistyczne bibliotek GNU binutils
133 Group: Development/Libraries
134 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
137 Development files for GNU binutils libraries (libbfd, libopcodes) and
138 static libiberty library.
140 %description devel -l pl.UTF-8
141 Pliki programistyczne bibliotek GNU binutils (libbfd, libopcodes) oraz
142 statyczna biblioteka libiberty.
145 Summary: GNU binutils static libraries
146 Summary(pl.UTF-8): Biblioteki statyczne do GNU binutils
147 Group: Development/Libraries
148 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
149 #Requires: zlib-static
152 Static GNU binutils libraries (libbfd, libopcodes).
154 %description static -l pl.UTF-8
155 Biblioteki statyczne GNU binutils (libbfd, libopcodes).
158 Summary: GNU Next Generation profiler
159 Summary(pl.UTF-8): Narzędzie profilujące GNU Next Generation
160 Group: Development/Tools
161 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
162 Requires: perl-base >= 1:5.10.0
165 Gprofng is the GNU Next Generation profiler for analyzing the
166 performance of Linux applications. Gprofng allows you to:
167 - Profile C / C++ / Java / Scala applications without needing to
169 - Profile multi-threaded applications
170 - Analyze and compare multiple experiments
171 - Use time-based sampling and / or hardware event counters
173 %description gprofng -l pl.UTF-8
174 Gprofng jest narzędziem profilującym GNU Next Generation do analizy
175 wydajności aplikacji w systemie Linux. Gprofng pozwala na:
176 - Profilowanie aplikacji C / C++ / Java / Scala bez potrzeby ponownej
178 - Profilowanie aplikacji wielowątkowych
179 - Analizę i porównanie wielu eksperymentów
180 - Użycie próbkowania w dziedzinie czasu i/lub sprzętowych liczników
187 %{?with_pax:%patch3 -p1}
194 %{__sed} -i -e '1s,.*env perl,#!%{__perl},' gprofng/gp-display-html/gp-display-html.in
196 # file contains hacks for ac 2.69 only
197 %{__rm} config/override.m4
203 # non-standard regeneration
204 # AM_BINUTILS_WARNINGS in bfd/warning.m4, ZW_GNU_GETTEXT_SISTER_DIR in config/gettext-sister.m4
205 for dir in gas bfd; do
207 %{__aclocal} -I .. -I ../config -I ../bfd
208 %{__automake} Makefile
209 test -f doc/Makefile.am && %{__automake} doc/Makefile
214 %{__aclocal} -I.. -I../config -I../bfd
230 TARGETS=sparc64-linux
236 TARGETS="x86_64-linux,x86_64-pep"
238 %{?addtargets:TARGETS="%{addtargets}"}
240 cp -f /usr/share/automake/config.* .
241 CFLAGS="%{rpmcflags}"; export CFLAGS
242 CXXFLAGS="%{rpmcxxflags}"; export CXXFLAGS
243 CC="%{__cc}"; export CC
244 CXX="%{__cxx}"; export CXX
248 ./configure %{_target_platform} \
249 --prefix=%{_prefix} \
250 --libdir=%{_libdir} \
251 --infodir=%{_infodir} \
252 --mandir=%{_mandir} \
253 --sysconfdir=%{_sysconfdir} \
255 --disable-silent-rules \
258 --enable-64-bit-bfd \
260 %{?with_allarchs:--enable-64-bit-bfd} \
262 --enable-build-warnings=,-Wno-missing-prototypes \
263 --enable-install-libiberty \
267 %{?with_allarchs:--enable-targets=alpha-linux,arm-linux,cris-linux,hppa-linux,i386-linux,ia64-linux,x86_64-linux,x86_64-linux-gnux32,m68k-linux,mips-linux,mips64-linux,mips64el-linux,mipsel-linux,ppc-linux,s390-linux,s390x-linux,sh-linux,sparc-linux,sparc64-linux,i386-linuxaout,x86_64-pep} \
268 %{!?with_allarchs:`[ -n "${TARGETS}" ] && echo "--enable-targets=${TARGETS}"`} \
269 --with-tooldir=%{_prefix} \
272 --enable-gold%{!?with_default_bfd:=default} --enable-ld%{?with_default_bfd:=default} \
274 %{__with_without msgpack} \
275 %{__enable_disable jansson} \
276 %{__with_without debuginfod}
280 %{?with_tests:%{__make} -j1 check}
283 rm -rf $RPM_BUILD_ROOT
284 install -d $RPM_BUILD_ROOT%{_libdir}/bfd-plugins
286 %{__make} -j1 install \
287 DESTDIR=$RPM_BUILD_ROOT
289 # remove these man pages unless we cross-build for win*/netware platforms.
290 # however, this should be done in Makefiles.
291 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{dlltool,windmc,windres}.1
293 bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
295 # overwrite libiberty.a with PIC version
296 cp -pf libiberty/pic/libiberty.a $RPM_BUILD_ROOT%{_libdir}
298 # remove evil -L pointing inside builder's home
299 perl -pi -e 's@-L[^ ]*/pic @@g' $RPM_BUILD_ROOT%{_libdir}/libbfd.la
301 [ -x $RPM_BUILD_ROOT%{_bindir}/ld.bfd ] || ln $RPM_BUILD_ROOT%{_bindir}/ld{,.bfd}
303 rm -f $RPM_BUILD_ROOT%{_infodir}/dir
307 cp -p gold/{README,ChangeLog,TODO} gold-doc
314 touch ld.lang gold.lang
320 cat bfd.lang opcodes.lang > %{name}-libs.lang
321 cat gas.lang gprof.lang ld.lang gold.lang >> %{name}.lang
324 rm -rf $RPM_BUILD_ROOT
326 %post -p /sbin/postshell
327 -/usr/sbin/fix-info-dir -c %{_infodir}
329 %postun -p /sbin/postshell
330 -/usr/sbin/fix-info-dir -c %{_infodir}
332 %post libs -p /sbin/ldconfig
333 %postun libs -p /sbin/ldconfig
335 %post devel -p /sbin/postshell
336 -/usr/sbin/fix-info-dir -c %{_infodir}
338 %postun devel -p /sbin/postshell
339 -/usr/sbin/fix-info-dir -c %{_infodir}
341 %post gprofng -p /sbin/postshell
342 -/usr/sbin/fix-info-dir -c %{_infodir}
344 %postun gprofng -p /sbin/postshell
345 -/usr/sbin/fix-info-dir -c %{_infodir}
347 %files -f %{name}.lang
348 %defattr(644,root,root,755)
350 %{?with_gold:%doc gold-doc}
351 %attr(755,root,root) %{_bindir}/addr2line
352 %attr(755,root,root) %{_bindir}/ar
353 %attr(755,root,root) %{_bindir}/as
354 %attr(755,root,root) %{_bindir}/c++filt
355 %attr(755,root,root) %{_bindir}/elfedit
356 %attr(755,root,root) %{_bindir}/gprof
357 %attr(755,root,root) %{_bindir}/ld
358 %attr(755,root,root) %{_bindir}/ld.bfd
360 %attr(755,root,root) %{_bindir}/ld.gold
361 %attr(755,root,root) %{_bindir}/dwp
363 %attr(755,root,root) %{_bindir}/nm
364 %attr(755,root,root) %{_bindir}/objcopy
365 %attr(755,root,root) %{_bindir}/objdump
366 %attr(755,root,root) %{_bindir}/ranlib
367 %attr(755,root,root) %{_bindir}/readelf
368 %attr(755,root,root) %{_bindir}/size
369 %attr(755,root,root) %{_bindir}/strings
370 %attr(755,root,root) %{_bindir}/strip
371 %{_prefix}/lib/ldscripts
373 %{_infodir}/binutils.info*
374 %{_infodir}/ctf-spec.info*
375 %{_infodir}/gprof.info*
377 %{_infodir}/sframe-spec.info*
378 %{_mandir}/man1/addr2line.1*
379 %{_mandir}/man1/ar.1*
380 %{_mandir}/man1/as.1*
381 %{_mandir}/man1/c++filt.1*
382 %{_mandir}/man1/elfedit.1*
383 %{_mandir}/man1/gprof.1*
384 %{_mandir}/man1/ld.1*
385 %{_mandir}/man1/nm.1*
386 %{_mandir}/man1/objcopy.1*
387 %{_mandir}/man1/objdump.1*
388 %{_mandir}/man1/ranlib.1*
389 %{_mandir}/man1/readelf.1*
390 %{_mandir}/man1/size.1*
391 %{_mandir}/man1/strings.1*
392 %{_mandir}/man1/strip.1*
393 %lang(cs) %{_mandir}/cs/man1/*
394 %lang(de) %{_mandir}/de/man1/*
395 %lang(es) %{_mandir}/es/man1/*
396 %lang(fi) %{_mandir}/fi/man1/*
397 %lang(fr) %{_mandir}/fr/man1/*
398 %lang(hu) %{_mandir}/hu/man1/*
399 %lang(ja) %{_mandir}/ja/man1/*
400 %lang(pl) %{_mandir}/pl/man1/*
402 %files libs -f %{name}-libs.lang
403 %defattr(644,root,root,755)
404 %attr(755,root,root) %{_libdir}/libbfd-%{version}.so
405 %attr(755,root,root) %{_libdir}/libctf.so.*.*
406 %attr(755,root,root) %ghost %{_libdir}/libctf.so.0
407 %attr(755,root,root) %{_libdir}/libctf-nobfd.so.*.*
408 %attr(755,root,root) %ghost %{_libdir}/libctf-nobfd.so.0
409 %attr(755,root,root) %{_libdir}/libopcodes-%{version}.so
410 %attr(755,root,root) %{_libdir}/libsframe.so.*.*
411 %attr(755,root,root) %ghost %{_libdir}/libsframe.so.0
412 %dir %{_libdir}/bfd-plugins
413 %attr(755,root,root) %{_libdir}/bfd-plugins/libdep.so
416 %defattr(644,root,root,755)
417 %attr(755,root,root) %{_libdir}/libbfd.so
418 %attr(755,root,root) %{_libdir}/libctf.so
419 %attr(755,root,root) %{_libdir}/libctf-nobfd.so
420 %attr(755,root,root) %{_libdir}/libopcodes.so
421 %attr(755,root,root) %{_libdir}/libsframe.so
424 %{_libdir}/libctf-nobfd.la
425 %{_libdir}/libopcodes.la
426 %{_libdir}/libiberty.a
427 %{_libdir}/libsframe.la
428 %{_includedir}/ansidecl.h
430 %{_includedir}/bfdlink.h
431 %{_includedir}/ctf-api.h
433 %{_includedir}/diagnostics.h
434 %{_includedir}/dis-asm.h
435 %{_includedir}/plugin-api.h
436 %{_includedir}/sframe-api.h
437 %{_includedir}/sframe.h
438 %{_includedir}/symcat.h
439 %{_includedir}/libiberty
440 %{_infodir}/bfd.info*
443 %defattr(644,root,root,755)
446 %{_libdir}/libctf-nobfd.a
447 %{_libdir}/libopcodes.a
448 %{_libdir}/libsframe.a
452 %defattr(644,root,root,755)
453 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/gprofng.rc
454 %attr(755,root,root) %{_bindir}/gp-archive
455 %attr(755,root,root) %{_bindir}/gp-collect-app
456 %attr(755,root,root) %{_bindir}/gp-display-html
457 %attr(755,root,root) %{_bindir}/gp-display-src
458 %attr(755,root,root) %{_bindir}/gp-display-text
459 %attr(755,root,root) %{_bindir}/gprofng
460 %dir %{_libdir}/gprofng
461 %attr(755,root,root) %{_libdir}/gprofng/libgp-collector.so
462 %attr(755,root,root) %{_libdir}/gprofng/libgp-collectorAPI.so
463 %attr(755,root,root) %{_libdir}/gprofng/libgp-heap.so
464 %attr(755,root,root) %{_libdir}/gprofng/libgp-iotrace.so
465 %attr(755,root,root) %{_libdir}/gprofng/libgp-sync.so
466 %attr(755,root,root) %{_libdir}/gprofng/libgprofng.so.*.*.*
467 %attr(755,root,root) %{_libdir}/gprofng/libgprofng.so.0
468 %attr(755,root,root) %{_libdir}/gprofng/libgprofng.so
469 %{_infodir}/gprofng.info*
470 %{_mandir}/man1/gp-archive.*
471 %{_mandir}/man1/gp-collect-app.*
472 %{_mandir}/man1/gp-display-html.*
473 %{_mandir}/man1/gp-display-src.*
474 %{_mandir}/man1/gp-display-text.*
475 %{_mandir}/man1/gprofng.1*
476 %{_includedir}/collectorAPI.h
477 %{_includedir}/libcollector.h
478 %{_includedir}/libfcollector.h