1 | #define svn_url e:/trees/binutils/trunk
|
---|
2 | %define svn_url http://svn.netlabs.org/repos/ports/binutils/trunk
|
---|
3 | %define svn_rev 1587
|
---|
4 |
|
---|
5 | # rpmbuild parameters:
|
---|
6 | # --define "binutils_target arm-linux-gnu" to create arm-linux-gnu-binutils.
|
---|
7 | # --with debug: Build without optimizations and without splitting the debuginfo.
|
---|
8 | # --without testsuite: Do not run the testsuite. Default is to run it.
|
---|
9 | # --with testsuite: Run the testsuite. Default --with debug is not to run it.
|
---|
10 |
|
---|
11 | # we don't run the testsuit, as there are dependencies we don't have atm
|
---|
12 | %define _without_testsuite 1
|
---|
13 |
|
---|
14 | %if 0%{!?binutils_target:1}
|
---|
15 | # we always use _build, as target_platform isn't recognised by configure
|
---|
16 | # define binutils_target %{_target_platform}
|
---|
17 | %define binutils_target %{_build}
|
---|
18 | %define isnative 1
|
---|
19 | %define enable_shared 1
|
---|
20 | %else
|
---|
21 | %define cross %{binutils_target}-
|
---|
22 | %define isnative 0
|
---|
23 | %define enable_shared 0
|
---|
24 | %endif
|
---|
25 | # BZ 1124342: Provide a way to enable deterministic archives.
|
---|
26 | # BZ 1195883: But do not do this by default.
|
---|
27 | %define enable_deterministic_archives 0
|
---|
28 |
|
---|
29 |
|
---|
30 | Summary: A GNU collection of binary utilities
|
---|
31 | Name: %{?cross}binutils%{?_with_debug:-debug}
|
---|
32 | Version: 2.25
|
---|
33 | Release: 1%{?dist}
|
---|
34 | License: GPLv3+
|
---|
35 | Group: Development/Tools
|
---|
36 | URL: http://sources.redhat.com/binutils
|
---|
37 |
|
---|
38 | Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
|
---|
39 | Vendor: bww bitwise works GmbH
|
---|
40 |
|
---|
41 | Provides: bundled(libiberty)
|
---|
42 |
|
---|
43 | # BZ 1173780: Building GOLD for PPC is not working at the moment.
|
---|
44 | # define gold_arches %ix86 x86_64 %arm aarch64 ppc* %{power64}
|
---|
45 | %define gold_arches %ix86 x86_64 %arm aarch64
|
---|
46 |
|
---|
47 | # we don't build on elf, so no gold for us
|
---|
48 | # ifarch %gold_arches
|
---|
49 | # define build_gold both
|
---|
50 | # else
|
---|
51 | %define build_gold no
|
---|
52 | # endif
|
---|
53 |
|
---|
54 | %if 0%{?_with_debug:1}
|
---|
55 | # Define this if you want to skip the strip step and preserve debug info.
|
---|
56 | # Useful for testing.
|
---|
57 | %define __debug_install_post : > %{_builddir}/%{?buildsubdir}/debugfiles.list
|
---|
58 | %define debug_package %{nil}
|
---|
59 | %define run_testsuite 0%{?_with_testsuite:1}
|
---|
60 | %else
|
---|
61 | %define run_testsuite 0%{!?_without_testsuite:1}
|
---|
62 | %endif
|
---|
63 |
|
---|
64 | BuildRequires: texinfo >= 4.0, gettext, flex, bison, zlib-devel
|
---|
65 | # BZ 920545: We need pod2man in order to build the manual pages.
|
---|
66 | # BuildRequires: /@unixroot/usr/bin/pod2man
|
---|
67 | # Required for: ld-bootstrap/bootstrap.exp bootstrap with --static
|
---|
68 | # It should not be required for: ld-elf/elf.exp static {preinit,init,fini} array
|
---|
69 | %if %{run_testsuite}
|
---|
70 | # relro_test.sh uses dc which is part of the bc rpm, hence its inclusion here.
|
---|
71 | BuildRequires: dejagnu, zlib-static, glibc-static, sharutils, bc
|
---|
72 | %if "%{build_gold}" == "both"
|
---|
73 | # The GOLD testsuite needs a static libc++
|
---|
74 | BuildRequires: libstdc++-static
|
---|
75 | %endif
|
---|
76 | %endif
|
---|
77 | Conflicts: gcc-c++ < 4.0.0
|
---|
78 | #Requires(post): /sbin/install-info
|
---|
79 | #Requires(preun): /sbin/install-info
|
---|
80 | %ifarch ia64
|
---|
81 | Obsoletes: gnupro <= 1117-1
|
---|
82 | %endif
|
---|
83 |
|
---|
84 |
|
---|
85 | # The higher of these two numbers determines the default ld.
|
---|
86 | %{!?ld_bfd_priority: %define ld_bfd_priority 50}
|
---|
87 | %{!?ld_gold_priority:%define ld_gold_priority 30}
|
---|
88 |
|
---|
89 | %if "%{build_gold}" == "both"
|
---|
90 | Requires(post): coreutils
|
---|
91 | Requires(post): %{_sbindir}/alternatives
|
---|
92 | Requires(preun): %{_sbindir}/alternatives
|
---|
93 | %endif
|
---|
94 |
|
---|
95 | # On ARM EABI systems, we do want -gnueabi to be part of the
|
---|
96 | # target triple.
|
---|
97 | %ifnarch %{arm}
|
---|
98 | %define _gnu %{nil}
|
---|
99 | %endif
|
---|
100 |
|
---|
101 | %description
|
---|
102 | Binutils is a collection of binary utilities, including ar (for
|
---|
103 | creating, modifying and extracting from archives), as (a family of GNU
|
---|
104 | assemblers), gprof (for displaying call graph profile data), ld (the
|
---|
105 | GNU linker), nm (for listing symbols from object files), objcopy (for
|
---|
106 | copying and translating object files), objdump (for displaying
|
---|
107 | information from object files), ranlib (for generating an index for
|
---|
108 | the contents of an archive), readelf (for displaying detailed
|
---|
109 | information about binary files), size (for listing the section sizes
|
---|
110 | of an object or archive file), strings (for listing printable strings
|
---|
111 | from files), strip (for discarding symbols), and addr2line (for
|
---|
112 | converting addresses to file and line).
|
---|
113 |
|
---|
114 | %package devel
|
---|
115 | Summary: BFD and opcodes dynamic libraries and header files
|
---|
116 | Group: System Environment/Libraries
|
---|
117 | Conflicts: binutils < 2.17.50.0.3-4
|
---|
118 | #Requires(post): /sbin/install-info
|
---|
119 | #Requires(preun): /sbin/install-info
|
---|
120 | Requires: zlib-devel
|
---|
121 | Requires: binutils = %{version}-%{release}
|
---|
122 | # BZ 1215242: We need touch...
|
---|
123 | Requires: coreutils
|
---|
124 |
|
---|
125 | %description devel
|
---|
126 | This package contains BFD and opcodes static and dynamic libraries.
|
---|
127 |
|
---|
128 | The dynamic libraries are in this package, rather than a seperate
|
---|
129 | base package because they are actually linker scripts that force
|
---|
130 | the use of the static libraries. This is because the API of the
|
---|
131 | BFD library is too unstable to be used dynamically.
|
---|
132 |
|
---|
133 | The static libraries are here because they are now needed by the
|
---|
134 | dynamic libraries.
|
---|
135 |
|
---|
136 | Developers starting new projects are strongly encouraged to consider
|
---|
137 | using libelf instead of BFD.
|
---|
138 |
|
---|
139 | %debug_package
|
---|
140 |
|
---|
141 | %prep
|
---|
142 | %if %{?svn_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{!?svn_rev):0}
|
---|
143 | %setup -q
|
---|
144 | %else
|
---|
145 | %setup -n "%{name}-%{version}" -Tc
|
---|
146 | svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
|
---|
147 | rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip"
|
---|
148 | (cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}")
|
---|
149 | %endif
|
---|
150 |
|
---|
151 | autogen.sh
|
---|
152 |
|
---|
153 | %build
|
---|
154 | echo target is %{binutils_target}
|
---|
155 | %ifarch %{power64}
|
---|
156 | export CFLAGS="$RPM_OPT_FLAGS -Wno-error"
|
---|
157 | %else
|
---|
158 | export CFLAGS="$RPM_OPT_FLAGS"
|
---|
159 | %endif
|
---|
160 | CARGS=
|
---|
161 |
|
---|
162 | case %{binutils_target} in i?86*|sparc*|ppc*|s390*|sh*|arm*|aarch64*)
|
---|
163 | CARGS="$CARGS --enable-64-bit-bfd"
|
---|
164 | ;;
|
---|
165 | esac
|
---|
166 |
|
---|
167 | case %{binutils_target} in ia64*)
|
---|
168 | CARGS="$CARGS --enable-targets=i386-linux"
|
---|
169 | ;;
|
---|
170 | esac
|
---|
171 |
|
---|
172 | case %{binutils_target} in ppc*|ppc64*)
|
---|
173 | CARGS="$CARGS --enable-targets=spu"
|
---|
174 | ;;
|
---|
175 | esac
|
---|
176 |
|
---|
177 | case %{binutils_target} in ppc64-*)
|
---|
178 | CARGS="$CARGS --enable-targets=powerpc64le-linux"
|
---|
179 | ;;
|
---|
180 | esac
|
---|
181 |
|
---|
182 | case %{binutils_target} in ppc64le*)
|
---|
183 | CARGS="$CARGS --enable-targets=powerpc-linux"
|
---|
184 | ;;
|
---|
185 | esac
|
---|
186 |
|
---|
187 | %if 0%{?_with_debug:1}
|
---|
188 | CFLAGS="$CFLAGS -O0 -ggdb2 -Wno-error -D_FORTIFY_SOURCE=0"
|
---|
189 | %define enable_shared 0
|
---|
190 | %endif
|
---|
191 |
|
---|
192 | export LDFLAGS=" -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
|
---|
193 |
|
---|
194 | # We could optimize the cross builds size by --enable-shared but the produced
|
---|
195 | # binaries may be less convenient in the embedded environment.
|
---|
196 | # the below configure switchs we don't use
|
---|
197 | # --build=%{_target_platform} --host=%{_target_platform} \
|
---|
198 | %configure \
|
---|
199 | --target=%{binutils_target} \
|
---|
200 | %ifarch %gold_arches
|
---|
201 | %if "%{build_gold}" == "both"
|
---|
202 | --enable-gold=default --enable-ld \
|
---|
203 | %else
|
---|
204 | --enable-ld \
|
---|
205 | %endif
|
---|
206 | %endif
|
---|
207 | %if !%{isnative}
|
---|
208 | --enable-targets=%{_host} \
|
---|
209 | --with-sysroot=%{_prefix}/%{binutils_target}/sys-root \
|
---|
210 | --program-prefix=%{cross} \
|
---|
211 | %endif
|
---|
212 | %if %{enable_shared}
|
---|
213 | --enable-shared --disable-static \
|
---|
214 | %else
|
---|
215 | --disable-shared \
|
---|
216 | %endif
|
---|
217 | %if %{enable_deterministic_archives}
|
---|
218 | --enable-deterministic-archives \
|
---|
219 | %else
|
---|
220 | --enable-deterministic-archives=no \
|
---|
221 | %endif
|
---|
222 | $CARGS \
|
---|
223 | --enable-plugins=no \
|
---|
224 | --with-bugurl=http://trac.netlabs.org/ports/
|
---|
225 | make %{_smp_mflags} tooldir=%{_prefix} all
|
---|
226 | make %{_smp_mflags} tooldir=%{_prefix} info
|
---|
227 |
|
---|
228 | # Do not use %%check as it is run after %%install where libbfd.so is rebuild
|
---|
229 | # with -fvisibility=hidden no longer being usable in its shared form.
|
---|
230 | %if !%{run_testsuite}
|
---|
231 | echo ====================TESTSUITE DISABLED=========================
|
---|
232 | %else
|
---|
233 | make -k check < /dev/null || :
|
---|
234 | echo ====================TESTING=========================
|
---|
235 | cat {gas/testsuite/gas,ld/ld,binutils/binutils}.sum
|
---|
236 | echo ====================TESTING END=====================
|
---|
237 | for file in {gas/testsuite/gas,ld/ld,binutils/binutils}.{sum,log}
|
---|
238 | do
|
---|
239 | ln $file binutils-%{_target_platform}-$(basename $file) || :
|
---|
240 | done
|
---|
241 | tar cjf binutils-%{_target_platform}.tar.bz2 binutils-%{_target_platform}-*.{sum,log}
|
---|
242 | uuencode binutils-%{_target_platform}.tar.bz2 binutils-%{_target_platform}.tar.bz2
|
---|
243 | rm -f binutils-%{_target_platform}.tar.bz2 binutils-%{_target_platform}-*.{sum,log}
|
---|
244 | %endif
|
---|
245 |
|
---|
246 | %install
|
---|
247 | rm -rf %{buildroot}
|
---|
248 | make install DESTDIR=%{buildroot}
|
---|
249 | %if %{isnative}
|
---|
250 | make prefix=%{buildroot}%{_prefix} infodir=%{buildroot}%{_infodir} install-info
|
---|
251 |
|
---|
252 | #install -m 644 bfd/libbfd.a %{buildroot}%{_libdir}
|
---|
253 | #install -m 644 libiberty/libiberty.a %{buildroot}%{_libdir}
|
---|
254 | install -m 644 include/libiberty.h %{buildroot}%{_prefix}/include
|
---|
255 | #install -m 644 opcodes/libopcodes.a %{buildroot}%{_libdir}
|
---|
256 | # Remove Windows/Novell only man pages
|
---|
257 | rm -f %{buildroot}%{_mandir}/man1/dlltool*
|
---|
258 | rm -f %{buildroot}%{_mandir}/man1/nlmconv*
|
---|
259 | rm -f %{buildroot}%{_mandir}/man1/windmc*
|
---|
260 |
|
---|
261 | %if %{enable_shared}
|
---|
262 | chmod +x %{buildroot}%{_libdir}/*.dll
|
---|
263 | %endif
|
---|
264 |
|
---|
265 | # Remove libtool files, which reference the .dll libs
|
---|
266 | rm -f %{buildroot}%{_libdir}/*.la
|
---|
267 |
|
---|
268 | %else # !%{isnative}
|
---|
269 | # For cross-binutils we drop the documentation.
|
---|
270 | rm -rf %{buildroot}%{_infodir}
|
---|
271 | # We keep these as one can have native + cross binutils of different versions.
|
---|
272 | #rm -rf %{buildroot}%{_prefix}/share/locale
|
---|
273 | #rm -rf %{buildroot}%{_mandir}
|
---|
274 | rm -rf %{buildroot}%{_libdir}/libiberty.a
|
---|
275 | %endif # !%{isnative}
|
---|
276 |
|
---|
277 | # This one comes from gcc
|
---|
278 | rm -f %{buildroot}%{_infodir}/dir
|
---|
279 | #rm -rf %{buildroot}%{_prefix}/%{binutils_target}
|
---|
280 |
|
---|
281 | %find_lang %{?cross}binutils
|
---|
282 | %find_lang %{?cross}opcodes
|
---|
283 | %find_lang %{?cross}bfd
|
---|
284 | %find_lang %{?cross}gas
|
---|
285 | %find_lang %{?cross}gprof
|
---|
286 | cat %{?cross}opcodes.lang >> %{?cross}binutils.lang
|
---|
287 | cat %{?cross}bfd.lang >> %{?cross}binutils.lang
|
---|
288 | cat %{?cross}gas.lang >> %{?cross}binutils.lang
|
---|
289 | cat %{?cross}gprof.lang >> %{?cross}binutils.lang
|
---|
290 |
|
---|
291 | if [ -x ld/ld-new ]; then
|
---|
292 | %find_lang %{?cross}ld
|
---|
293 | cat %{?cross}ld.lang >> %{?cross}binutils.lang
|
---|
294 | fi
|
---|
295 | if [ -x gold/ld-new ]; then
|
---|
296 | %find_lang %{?cross}gold
|
---|
297 | cat %{?cross}gold.lang >> %{?cross}binutils.lang
|
---|
298 | fi
|
---|
299 |
|
---|
300 | %clean
|
---|
301 | rm -rf %{buildroot}
|
---|
302 |
|
---|
303 | %post
|
---|
304 | %if "%{build_gold}" == "both"
|
---|
305 | %__rm -f %{_bindir}/%{?cross}ld
|
---|
306 | %{_sbindir}/alternatives --install %{_bindir}/%{?cross}ld %{?cross}ld \
|
---|
307 | %{_bindir}/%{?cross}ld.bfd %{ld_bfd_priority}
|
---|
308 | %{_sbindir}/alternatives --install %{_bindir}/%{?cross}ld %{?cross}ld \
|
---|
309 | %{_bindir}/%{?cross}ld.gold %{ld_gold_priority}
|
---|
310 | %{_sbindir}/alternatives --auto %{?cross}ld
|
---|
311 | %endif
|
---|
312 | %if %{isnative}
|
---|
313 | #/sbin/ldconfig
|
---|
314 | # For --excludedocs:
|
---|
315 | if [ -e %{_infodir}/binutils.info.gz ]
|
---|
316 | then
|
---|
317 | %{_sbindir}/install-info --info-dir=%{_infodir} %{_infodir}/as.info.gz
|
---|
318 | %{_sbindir}/install-info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz
|
---|
319 | %{_sbindir}/install-info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz
|
---|
320 | %{_sbindir}/install-info --info-dir=%{_infodir} %{_infodir}/ld.info.gz
|
---|
321 | fi
|
---|
322 | %endif # %{isnative}
|
---|
323 | exit 0
|
---|
324 |
|
---|
325 | %preun
|
---|
326 | %if "%{build_gold}" == "both"
|
---|
327 | if [ $1 = 0 ]; then
|
---|
328 | %{_sbindir}/alternatives --remove %{?cross}ld %{_bindir}/%{?cross}ld.bfd
|
---|
329 | %{_sbindir}/alternatives --remove %{?cross}ld %{_bindir}/%{?cross}ld.gold
|
---|
330 | fi
|
---|
331 | %endif
|
---|
332 | %if %{isnative}
|
---|
333 | if [ $1 = 0 ]; then
|
---|
334 | if [ -e %{_infodir}/binutils.info.gz ]
|
---|
335 | then
|
---|
336 | %{_sbindir}/install-info --delete --info-dir=%{_infodir} %{_infodir}/as.info.gz
|
---|
337 | %{_sbindir}/install-info --delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz
|
---|
338 | %{_sbindir}/install-info --delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz
|
---|
339 | %{_sbindir}/install-info --delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz
|
---|
340 | fi
|
---|
341 | fi
|
---|
342 | %endif
|
---|
343 | exit 0
|
---|
344 |
|
---|
345 | %if %{isnative}
|
---|
346 | #%postun -p /sbin/ldconfig
|
---|
347 | %endif # %{isnative}
|
---|
348 |
|
---|
349 | %files -f %{?cross}binutils.lang
|
---|
350 | %defattr(-,root,root,-)
|
---|
351 | %doc README
|
---|
352 | %{_bindir}/%{?cross}[!l]*.exe
|
---|
353 | %{_prefix}/%{binutils_target}/bin/%{?cross}[!l]*.exe
|
---|
354 | %if "%{build_gold}" == "both"
|
---|
355 | %{_bindir}/%{?cross}ld*.exe
|
---|
356 | %ghost %{_bindir}/%{?cross}ld
|
---|
357 | %else
|
---|
358 | #%{_bindir}/%{?cross}ld*.exe
|
---|
359 | %endif
|
---|
360 | %{_mandir}/man1/*
|
---|
361 | %if %{enable_shared}
|
---|
362 | %{_libdir}/*.dll
|
---|
363 | %endif
|
---|
364 |
|
---|
365 | %if %{isnative}
|
---|
366 | %{_infodir}/[^b]*info*
|
---|
367 | %{_infodir}/binutils*info*
|
---|
368 |
|
---|
369 | %files devel
|
---|
370 | %defattr(-,root,root,-)
|
---|
371 | %{_prefix}/include/*
|
---|
372 | %{_libdir}/*_dll.a
|
---|
373 | %{_infodir}/bfd*info*
|
---|
374 |
|
---|
375 | %endif # %{isnative}
|
---|
376 |
|
---|
377 | %changelog
|
---|
378 | * Tue May 31 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> 2.25-1
|
---|
379 | - update to version 2.25
|
---|
380 |
|
---|
381 | * Wed Oct 5 2011 yd <yd@os2power.com> 2.21-1
|
---|
382 | - Initial version
|
---|