]> git.pld-linux.org Git - packages/binutils.git/blame - binutils.spec
disable gasp on %{arm} (linking fails)
[packages/binutils.git] / binutils.spec
CommitLineData
baf235c6 1# TODO: PR/26302 <https://sourceware.org/bugzilla/show_bug.cgi?id=26302> (breaks kernel-tools build)
c5304b32 2#
501f7670
JB
3# Conditional 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)
a3e16156 6 # http://sourceware.org/ml/binutils/2008-03/msg00162.html
46bb8853 7%bcond_with pax # without PaX flags (for upstream bugreports)
a18955a2 8%bcond_without gold # don't build gold (no C++ dependencies)
93de8f98 9%bcond_without default_bfd # default ld.bfd instead of gold
10eed582 10%bcond_without gasp # gasp
62302ee6 11%bcond_with tests # check target
a18955a2 12
c5c8d5ad 13%ifnarch %{ix86} %{x8664} x32 aarch64
a18955a2
ER
14%undefine with_gold
15%endif
b27362de
JP
16%ifarch %{arm}
17%undefine with_gasp
18%endif
a18955a2 19
58a689fe 20Summary: GNU Binary Utility Development Utilities
ceb5138c
ER
21Summary(de.UTF-8): GNU Binary Utility Development Utilities
22Summary(es.UTF-8): Utilitarios para desarrollo de binarios de la GNU
23Summary(fr.UTF-8): Utilitaires de développement binaire de GNU
24Summary(pl.UTF-8): Narzędzia GNU dla programistów
25Summary(pt_BR.UTF-8): Utilitários para desenvolvimento de binários da GNU
26Summary(ru.UTF-8): Набор инструментов GNU для построения исполняемых программ
27Summary(tr.UTF-8): GNU geliştirme araçları
28Summary(uk.UTF-8): Набір інструментів GNU для побудови виконуваних програм
58a689fe 29Name: binutils
1870ba38 30Version: 2.35.1
6520cf64 31Release: 1
d4e8849a 32Epoch: 4
0f5b7b0a 33License: GPL v3+
58a689fe 34Group: Development/Tools
497cb22d 35Source0: https://ftp.gnu.org/gnu/binutils/%{name}-%{version}.tar.lz
1870ba38 36# Source0-md5: 701103b50966364eadff838f5a5df928
ab9f8866 37Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
e866ad8f 38# Source1-md5: a717d9707ec77d82acb6ec9078c472d6
2859501d 39Patch0: %{name}-gasp.patch
f0309959 40Patch1: %{name}-info.patch
fb2b373b
JB
41Patch2: %{name}-libtool-relink.patch
42Patch3: %{name}-pt_pax_flags.patch
b6853af5 43
3ecba8d9
AM
44Patch6: %{name}-absolute-gnu_debuglink-path.patch
45Patch7: %{name}-libtool-m.patch
46Patch8: %{name}-build-id.patch
47Patch9: %{name}-tooldir.patch
cb066d97 48Patch10: %{name}-sanity-check.patch
5236cf4f 49Patch11: binutils-CVE-2019-1010204.patch
4770b19c 50URL: http://sources.redhat.com/binutils/
6520cf64 51BuildRequires: autoconf >= 2.69
08f839ed 52BuildRequires: automake >= 1:1.11
92b879dd 53BuildRequires: bison
4770b19c 54BuildRequires: flex
0d071cd5 55BuildRequires: gettext-tools
a18955a2 56%{?with_gold:BuildRequires: libstdc++-devel >= 6:4.0-1}
31c98541 57%{?with_tests:BuildRequires: libstdc++-static >= 6:4.0}
fdba1a35 58BuildRequires: lzip
3aee031d 59BuildRequires: perl-tools-pod
c1a8e558 60%ifarch sparc sparc32
61BuildRequires: sparc32
62%endif
3bc4b8d1 63BuildRequires: tar >= 1:1.22
e6b8978d 64BuildRequires: texinfo >= 4.2
d9b61f00 65BuildRequires: zlib-devel
5905b48e 66%{?with_tests:BuildRequires: zlib-static}
74cc5371 67Conflicts: gcc-c++ < 5:3.3
bc650d31 68Conflicts: modutils < 2.4.17
98051ac9 69Conflicts: rpmbuild(macros) < 1.660
08d99624 70Obsoletes: binutils-gold
59f56279 71BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
1928db7d 72
73%description
948596dc 74Binutils is a collection of binary utilities, including:
75- ar - create, modify and extract from archives,
76- nm - lists symbols from object files,
77- objcopy - copy and translate object files,
78- objdump - display information from object files,
79- ranlib - generate an index for the contents of an archive,
80- size - list the section sizes of an object or archive file,
81- strings - list printable strings from files,
82- strip - discard symbols,
34f46dd1 83- addr2line - convert addresses to file and line.
1928db7d 84
0c3d68f2
JR
85%description -l es.UTF-8
86Binutils es una colección de utilitarios necesarios para compilar
87programas. Incluye assembler y linker, así como varios otros programas
eaa0ca5c 88para trabajar con formatos que se puedan ejecutar.
89
0c3d68f2
JR
90%description -l pl.UTF-8
91Pakiet binutils zawiera zestaw narzędzi umożliwiających kompilację
92programów. Znajdują się tutaj między innymi assembler, konsolidator
93(linker), a także inne narzędzia do manipulowania binarnymi plikami
94programów i bibliotek.
1928db7d 95
0c3d68f2
JR
96%description -l pt_BR.UTF-8
97binutils é uma coletânea de utilitários necessários para compilar
98programas. Inclui assembler e linker, assim como vários outros
99programas para trabalhar com formatos executáveis.
54b53cb0 100
0c3d68f2
JR
101%description -l ru.UTF-8
102binutils - это набор инструментов, необходимых для компилляции
103программ. Включает ассемблер, компоновщик и набор других программ для
104работы с исполняемыми файлами разнообразных форматов.
c5304b32 105
0c3d68f2
JR
106%description -l uk.UTF-8
107binutils - це набір інструментів, необхідних для компіляції програм.
108Містить асемблер, компоновщик та інші програми, необхідні для роботи з
109виконуваними файлами різних форматів.
c5304b32 110
49b19461
JB
111%package libs
112Summary: GNU binutils shared libraries
ceb5138c 113Summary(pl.UTF-8): Biblioteki współdzielone GNU binutils
49b19461 114Group: Libraries
40e06b51 115Conflicts: binutils < 3:2.17.50.0.8-3
49b19461
JB
116
117%description libs
118GNU binutils shared libraries (libbfd, libopcodes).
119
0c3d68f2
JR
120%description libs -l pl.UTF-8
121Biblioteki współdzielone GNU binutils (libbfd, libopcodes).
49b19461
JB
122
123%package devel
124Summary: Development files for GNU binutils libraries
ceb5138c 125Summary(pl.UTF-8): Pliki programistyczne bibliotek GNU binutils
49b19461
JB
126Group: Development/Libraries
127Requires: %{name}-libs = %{epoch}:%{version}-%{release}
128
129%description devel
5516fb05
ER
130Development files for GNU binutils libraries (libbfd, libopcodes) and
131static libiberty library.
49b19461 132
0c3d68f2 133%description devel -l pl.UTF-8
49b19461
JB
134Pliki programistyczne bibliotek GNU binutils (libbfd, libopcodes) oraz
135statyczna biblioteka libiberty.
136
16317b98 137%package static
49b19461 138Summary: GNU binutils static libraries
ceb5138c 139Summary(pl.UTF-8): Biblioteki statyczne do GNU binutils
a26dabf1 140Group: Development/Libraries
49b19461 141Requires: %{name}-devel = %{epoch}:%{version}-%{release}
461931c7 142#Requires: zlib-static
a806649c 143
144%description static
49b19461 145Static GNU binutils libraries (libbfd, libopcodes).
a806649c 146
0c3d68f2 147%description static -l pl.UTF-8
49b19461 148Biblioteki statyczne GNU binutils (libbfd, libopcodes).
a806649c 149
2859501d
JB
150%package gasp
151Summary: GASP - old preprocessor for assembly programs
ceb5138c 152Summary(pl.UTF-8): GASP - stary preprocesor dla programów w asemblerze
2859501d 153Group: Development/Tools
a8538388 154Requires: %{name} = %{epoch}:%{version}-%{release}
2859501d
JB
155
156%description gasp
157GASP - old preprocessor for assembly programs. It's officially
158obsoleted, but it's still needed to build some packages.
159
0c3d68f2
JR
160%description gasp -l pl.UTF-8
161GASP - stary preprocesor dla programów w asemblerze. Jest oficjalnie
162uznany za przestarzały, ale jest nadal potrzebny do zbudowania
163niektórych pakietów.
2859501d 164
1928db7d 165%prep
501f7670 166%setup -q
39af79f4 167%{?with_gasp:%patch0 -p1}
f81d2489 168%patch1 -p1
f0309959 169%patch2 -p1
ae2b8d9d 170%{?with_pax:%patch3 -p1}
b6853af5 171
8c2c8b6f 172%patch6 -p1
3cd495cf 173%patch7 -p1
3bc4b8d1 174%patch8 -p1
8dd9627c 175%patch9 -p1
cb066d97 176%patch10 -p1
9f749c9b 177%patch11 -p1
1928db7d 178
6520cf64 179# file contains hacks for ac 2.69 only
5cfae0d2 180%{__rm} config/override.m4
bfa6591a 181
1928db7d 182%build
437f76a6 183%{__aclocal}
184%{__autoconf}
185
a8538388 186# non-standard regeneration (needed because of gasp patch)
fe27c565 187# AM_BINUTILS_WARNINGS in bfd/warning.m4, ZW_GNU_GETTEXT_SISTER_DIR in config/gettext-sister.m4
71ec0766
AM
188for dir in gas bfd; do
189 cd $dir || exit 1
4274db7b
AM
190 %{__aclocal} -I .. -I ../config -I ../bfd
191 %{__automake} Makefile
192 %{__automake} doc/Makefile
193 %{__autoconf}
71ec0766
AM
194 cd ..
195done
266c72dc 196
3cc4a1c4
AM
197# More targets
198TARGETS=
199%ifarch ia64
200TARGETS=i686-linux
201%endif
501f7670 202# uhm?
3cc4a1c4
AM
203%ifarch %{ix86}
204TARGETS=x86_64-linux
205%endif
206%ifarch sparc
207TARGETS=sparc64-linux
208%endif
1fb376d7 209%ifarch %{x8664}
3c26908e
JK
210TARGETS="x86_64-pep"
211%endif
39a25667
JR
212%ifarch x32
213TARGETS="x86_64-linux,x86_64-pep"
214%endif
501f7670 215%{?addtargets:TARGETS="%{addtargets}"}
3cc4a1c4 216
bc650d31 217cp -f /usr/share/automake/config.* .
e1177480 218CFLAGS="%{rpmcflags}"; export CFLAGS
1530b74b 219CXXFLAGS="%{rpmcxxflags}"; export CXXFLAGS
bc650d31 220CC="%{__cc}"; export CC
1530b74b 221CXX="%{__cxx}"; export CXX
c5304b32 222%ifarch sparc
8a52c890 223sparc32 \
224%endif
1e19fd88 225./configure %{_target_platform} \
1e19fd88 226 --prefix=%{_prefix} \
a74f9904 227 --libdir=%{_libdir} \
1e19fd88 228 --infodir=%{_infodir} \
c1bfddd6 229 --mandir=%{_mandir} \
fdba1a35
JB
230 --disable-debug \
231 --disable-werror \
c446d5a3 232%ifarch sparc
ab151dc7 233 --enable-64-bit-bfd \
501f7670
JB
234%else
235 %{?with_allarchs:--enable-64-bit-bfd} \
c446d5a3 236%endif
fdba1a35
JB
237 --enable-build-warnings=,-Wno-missing-prototypes \
238 --enable-install-libiberty \
239 --enable-lto \
240 --enable-plugins \
241 --enable-shared \
39a25667 242 %{?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} \
fdba1a35
JB
243 %{!?with_allarchs:`[ -n "${TARGETS}" ] && echo "--enable-targets=${TARGETS}"`} \
244 --with-tooldir=%{_prefix} \
245 --with-zlib \
a18955a2 246%if %{with gold}
93de8f98 247 --enable-gold%{!?with_default_bfd:=default} --enable-ld%{?with_default_bfd:=default} \
41248ac5 248%endif
58a689fe 249
1665df93 250%{__make} -j1
1928db7d 251
1665df93 252%{?with_tests:%{__make} -j1 check}
e6026cea 253
1928db7d 254%install
255rm -rf $RPM_BUILD_ROOT
f0caedc5 256install -d $RPM_BUILD_ROOT%{_libdir}/bfd-plugins
58a689fe 257
437f76a6 258%{__make} install \
259 DESTDIR=$RPM_BUILD_ROOT
1928db7d 260
3f010e6c 261# remove these man pages unless we cross-build for win*/netware platforms.
262# however, this should be done in Makefiles.
1770ca50 263%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{dlltool,windmc,windres}.1
3f010e6c 264
bc650d31 265bzip2 -dc %{SOURCE1} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
3f010e6c 266
fdba1a35
JB
267# overwrite libiberty.a with PIC version
268cp -pf libiberty/pic/libiberty.a $RPM_BUILD_ROOT%{_libdir}
1928db7d 269
3aee031d
JB
270# remove evil -L pointing inside builder's home
271perl -pi -e 's@-L[^ ]*/pic @@g' $RPM_BUILD_ROOT%{_libdir}/libbfd.la
272
16885b7f 273[ -x $RPM_BUILD_ROOT%{_bindir}/ld.bfd ] || ln $RPM_BUILD_ROOT%{_bindir}/ld{,.bfd}
274
ab025e6a
ER
275rm -f $RPM_BUILD_ROOT%{_infodir}/dir
276
49b19461
JB
277%find_lang bfd
278%find_lang binutils
279%find_lang gas
280%find_lang gprof
a18955a2 281touch ld.lang gold.lang
49b19461 282%find_lang ld
a18955a2 283%if %{with gold}
9dedc7ea 284%find_lang gold
1addeff3 285%endif
49b19461 286%find_lang opcodes
632dfa0c 287cat bfd.lang opcodes.lang > %{name}-libs.lang
08d99624 288cat gas.lang gprof.lang ld.lang gold.lang >> %{name}.lang
bc650d31 289
1928db7d 290%clean
291rm -rf $RPM_BUILD_ROOT
292
bfa6591a 293%post -p /sbin/postshell
c3790715 294-/usr/sbin/fix-info-dir -c %{_infodir}
1928db7d 295
bfa6591a 296%postun -p /sbin/postshell
c3790715 297-/usr/sbin/fix-info-dir -c %{_infodir}
49b19461
JB
298
299%post libs -p /sbin/ldconfig
300%postun libs -p /sbin/ldconfig
301
bfa6591a 302%post devel -p /sbin/postshell
5ff961d5 303-/usr/sbin/fix-info-dir -c %{_infodir}
49b19461 304
bfa6591a 305%postun devel -p /sbin/postshell
5ff961d5 306-/usr/sbin/fix-info-dir -c %{_infodir}
1928db7d 307
9b8eb19f
ER
308%post gasp -p /sbin/postshell
309-/usr/sbin/fix-info-dir -c %{_infodir}
310
311%postun gasp -p /sbin/postshell
312-/usr/sbin/fix-info-dir -c %{_infodir}
313
bc650d31 314%files -f %{name}.lang
58a689fe 315%defattr(644,root,root,755)
dc044c3b 316%doc README
a18955a2 317%{?with_gold:%doc gold/{ChangeLog,README,TODO}}
41248ac5
JB
318%attr(755,root,root) %{_bindir}/addr2line
319%attr(755,root,root) %{_bindir}/ar
320%attr(755,root,root) %{_bindir}/as
321%attr(755,root,root) %{_bindir}/c++filt
322%attr(755,root,root) %{_bindir}/elfedit
323%attr(755,root,root) %{_bindir}/gprof
324%attr(755,root,root) %{_bindir}/ld
325%attr(755,root,root) %{_bindir}/ld.bfd
a18955a2 326%if %{with gold}
08d99624 327%attr(755,root,root) %{_bindir}/ld.gold
3bc4b8d1 328%attr(755,root,root) %{_bindir}/dwp
1addeff3 329%endif
41248ac5
JB
330%attr(755,root,root) %{_bindir}/nm
331%attr(755,root,root) %{_bindir}/objcopy
332%attr(755,root,root) %{_bindir}/objdump
333%attr(755,root,root) %{_bindir}/ranlib
334%attr(755,root,root) %{_bindir}/readelf
335%attr(755,root,root) %{_bindir}/size
336%attr(755,root,root) %{_bindir}/strings
337%attr(755,root,root) %{_bindir}/strip
f0caedc5 338%{_prefix}/lib/ldscripts
49b19461
JB
339%{_infodir}/as.info*
340%{_infodir}/binutils.info*
49b19461
JB
341%{_infodir}/gprof.info*
342%{_infodir}/ld.info*
f0caedc5
JB
343%{_mandir}/man1/addr2line.1*
344%{_mandir}/man1/ar.1*
345%{_mandir}/man1/as.1*
346%{_mandir}/man1/c++filt.1*
347%{_mandir}/man1/elfedit.1*
348%{_mandir}/man1/gprof.1*
349%{_mandir}/man1/ld.1*
350%{_mandir}/man1/nm.1*
351%{_mandir}/man1/objcopy.1*
352%{_mandir}/man1/objdump.1*
353%{_mandir}/man1/ranlib.1*
354%{_mandir}/man1/readelf.1*
355%{_mandir}/man1/size.1*
356%{_mandir}/man1/strings.1*
357%{_mandir}/man1/strip.1*
3f010e6c 358%lang(cs) %{_mandir}/cs/man1/*
359%lang(de) %{_mandir}/de/man1/*
360%lang(es) %{_mandir}/es/man1/*
361%lang(fi) %{_mandir}/fi/man1/*
362%lang(fr) %{_mandir}/fr/man1/*
363%lang(hu) %{_mandir}/hu/man1/*
364%lang(ja) %{_mandir}/ja/man1/*
365%lang(pl) %{_mandir}/pl/man1/*
1928db7d 366
49b19461
JB
367%files libs -f %{name}-libs.lang
368%defattr(644,root,root,755)
5239e4f9 369%attr(755,root,root) %{_libdir}/libbfd-%{version}.so
ab38b0a4
AM
370%attr(755,root,root) %{_libdir}/libctf.so.*.*
371%attr(755,root,root) %ghost %{_libdir}/libctf.so.0
372%attr(755,root,root) %{_libdir}/libctf-nobfd.so.*.*
373%attr(755,root,root) %ghost %{_libdir}/libctf-nobfd.so.0
5239e4f9 374%attr(755,root,root) %{_libdir}/libopcodes-%{version}.so
f0caedc5 375%dir %{_libdir}/bfd-plugins
49b19461
JB
376
377%files devel
378%defattr(644,root,root,755)
379%attr(755,root,root) %{_libdir}/libbfd.so
ab38b0a4
AM
380%attr(755,root,root) %{_libdir}/libctf.so
381%attr(755,root,root) %{_libdir}/libctf-nobfd.so
49b19461
JB
382%attr(755,root,root) %{_libdir}/libopcodes.so
383%{_libdir}/libbfd.la
ab38b0a4
AM
384%{_libdir}/libctf.la
385%{_libdir}/libctf-nobfd.la
49b19461
JB
386%{_libdir}/libopcodes.la
387%{_libdir}/libiberty.a
41248ac5
JB
388%{_includedir}/ansidecl.h
389%{_includedir}/bfd.h
46bb8853 390%{_includedir}/bfd_stdint.h
41248ac5 391%{_includedir}/bfdlink.h
ab38b0a4
AM
392%{_includedir}/ctf-api.h
393%{_includedir}/ctf.h
1770ca50 394%{_includedir}/diagnostics.h
41248ac5 395%{_includedir}/dis-asm.h
fb9adfdf 396%{_includedir}/plugin-api.h
41248ac5 397%{_includedir}/symcat.h
fdba1a35 398%{_includedir}/libiberty
49b19461
JB
399%{_infodir}/bfd.info*
400
a806649c 401%files static
8d8a6b9c 402%defattr(644,root,root,755)
49b19461 403%{_libdir}/libbfd.a
ab38b0a4
AM
404%{_libdir}/libctf.a
405%{_libdir}/libctf-nobfd.a
49b19461 406%{_libdir}/libopcodes.a
2859501d 407
39af79f4 408%if %{with gasp}
2859501d
JB
409%files gasp
410%defattr(644,root,root,755)
411%attr(755,root,root) %{_bindir}/gasp
412%{_infodir}/gasp.info*
39af79f4 413%endif
This page took 0.194999 seconds and 4 git commands to generate.