-
Notifications
You must be signed in to change notification settings - Fork 564
/
Copy pathbinutils.spec
462 lines (366 loc) · 13 KB
/
binutils.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
# Where the binaries aimed at gcc will live (ie. /usr/<target>/bin/).
%global auxbin_prefix %{_exec_prefix}
%global srcdir %{name}-%{version}
%ifarch x86_64
%global build_cross 1
%else
%global build_cross 0
%endif
%global build_aarch64 %{build_cross}
%global do_files() \
%if %2 \
%files -n binutils-%1 \
%{_prefix}/%1 \
%{_bindir}/%1-* \
%endif
Summary: Contains a linker, an assembler, and other tools
Name: binutils
Version: 2.37
Release: 10%{?dist}
License: GPLv2+
Vendor: Microsoft Corporation
Distribution: Mariner
Group: System Environment/Base
URL: https://www.gnu.org/software/binutils
Source0: https://ftp.gnu.org/gnu/binutils/%{name}-%{version}.tar.xz
# Patch was derived from source: https://src.fedoraproject.org/rpms/binutils/blob/f34/f/binutils-export-demangle.h.patch
Patch0: export-demangle-header.patch
# Patch1 Source https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=6b86da53d5ee2022b9065f445d23356190380746
Patch1: linker-script-readonly-keyword-support.patch
Patch2: thin_archive_descriptor.patch
Patch3: CVE-2021-45078.patch
Patch4: CVE-2022-38533.patch
Patch5: CVE-2022-4285.patch
# The gold linker doesn't understand the 'module_info.ld' script passed to all linkers and the tests fail to correctly link.
Patch6: disable_gold_test.patch
Patch7: CVE-2022-47007.patch
Patch8: CVE-2022-47008.patch
Patch9: CVE-2022-47010.patch
Patch10: CVE-2022-47011.patch
Patch11: CVE-2022-48063.patch
Patch12: CVE-2023-1972.patch
Patch13: CVE-2022-35205.patch
Provides: bundled(libiberty)
# Moving macro before the "SourceX" tags breaks PR checks parsing the specs.
%global do_package() \
%if %2 \
%package -n binutils-%1 \
Summary: Cross-build binary utilities for %1 \
Requires: cross-%{name}-common = %{version}-%{release} \
%description -n binutils-%1 \
Cross-build binary image generation, manipulation and query tools for the %1 architecture. \
%endif
%description
The Binutils package contains a linker, an assembler,
and other tools for handling object files.
%package devel
Summary: Header and development files for binutils
Requires: %{name} = %{version}
%description devel
It contains the libraries and header files to create applications
for handling compiled objects.
%if %{build_cross}
%package -n cross-%{name}-common
Summary: Cross-compilation binutils documentation
BuildArch: noarch
%description -n cross-%{name}-common
Documentation for the cross-compilation binutils package.
%endif
%do_package aarch64-linux-gnu %{build_aarch64}
%prep
%setup -q -c
function prep_target () {
local target=$1
local condition=$2
if [ $condition != 0 ]
then
echo $1 >> cross.list
fi
}
pushd %{srcdir}
%autopatch -p1
popd
touch cross.list
prep_target aarch64-linux-gnu %{build_aarch64}
%build
function config_cross_target () {
local target=$1
cp -r %{srcdir} $target
pushd $target
%configure \
--exec-prefix=%{auxbin_prefix} \
--program-prefix=$target- \
--target=$target \
--disable-multilib \
--disable-nls \
--disable-install_libbfd \
--with-sysroot=%{_prefix}/$target/sys-root
popd
}
# Native components build steps.
# Copying extracted sources for each run of "configure" and "make".
# Building in separate subdirectories but with a single source causes
# other packages to fail with a "configure: error: C compiler cannot create executables" error.
# Proper fix needed and moved to a separate bug at the time of writing this comment.
cp -r %{srcdir} build
pushd build
%configure \
--disable-silent-rules \
--disable-werror \
--enable-gold \
--enable-ld=default \
--enable-plugins \
--enable-shared \
--with-system-zlib
popd
%make_build -C build tooldir=%{_prefix}
# Cross-compilation components build steps.
while read -r target
do
echo "=== BUILD cross-compilation target $target ==="
config_cross_target $target
%make_build -C $target tooldir=%{_prefix}
done < cross.list
%if %{build_cross}
# For documentation purposes only.
cp -r %{srcdir} cross-binutils
pushd cross-binutils
# $PACKAGE is used for the gettext catalog name when building 'cross-binutils-common'.
sed -i -e 's/^ PACKAGE=/ PACKAGE=cross-/' */configure
%configure \
--exec-prefix=%{auxbin_prefix} \
--program-prefix=cross- \
--disable-dependency-tracking \
--disable-silent-rules \
--disable-shared
popd
%make_build -C cross-binutils tooldir=%{_prefix}
%endif
%install
# Native components installation steps.
pushd build
%make_install tooldir=%{_prefix}
%find_lang %{name} --all-name
install -m 644 libiberty/pic/libiberty.a %{buildroot}%{_libdir}
install -m 644 include/libiberty.h %{buildroot}%{_includedir}
popd
# Cross-compilation components installation steps.
while read -r target
do
echo "=== INSTALL cross-compilation target $target ==="
mkdir -p %{buildroot}%{_prefix}/$target/sys-root
%make_install -C $target tooldir=%{auxbin_prefix}/$target
# Remove cross man files and ldscripts.
rm -rf %{buildroot}%{_mandir}/man1/$target-*
rm -rf %{buildroot}%{auxbin_prefix}/*/lib
done < cross.list
rm -rf %{buildroot}%{_infodir}
find %{buildroot} -type f -name "*.la" -delete -print
%if %{build_cross}
echo "=== INSTALL po targets ==="
for binary_name in binutils opcodes bfd gas ld gprof
do
%make_install -C cross-binutils/$binary_name/po
done
# Find the language files which only exist in the common package.
(
for binary_name in binutils opcodes bfd gas ld gprof
do
%find_lang cross-$binary_name
cat cross-${binary_name}.lang
done
) >files.cross
%endif
%check
%make_build -C build tooldir=%{_prefix} check
%ldconfig_scriptlets
%files -f build/%{name}.lang
%defattr(-,root,root)
%license %{srcdir}/COPYING
%{_bindir}/dwp
%{_bindir}/gprof
%{_bindir}/ld.bfd
%{_bindir}/ld.gold
%{_bindir}/c++filt
%{_bindir}/objdump
%{_bindir}/as
%{_bindir}/ar
%{_bindir}/objcopy
%{_bindir}/strings
%{_bindir}/addr2line
%{_bindir}/nm
%{_bindir}/size
%{_bindir}/ld
%{_bindir}/elfedit
%{_bindir}/ranlib
%{_bindir}/readelf
%{_bindir}/strip
%{_libdir}/ldscripts/*
%{_libdir}/libbfd-%{version}.so
%{_libdir}/libopcodes-%{version}.so
%{_mandir}/man1/readelf.1.gz
%{_mandir}/man1/windmc.1.gz
%{_mandir}/man1/ranlib.1.gz
%{_mandir}/man1/gprof.1.gz
%{_mandir}/man1/strip.1.gz
%{_mandir}/man1/c++filt.1.gz
%{_mandir}/man1/as.1.gz
%{_mandir}/man1/objcopy.1.gz
%{_mandir}/man1/elfedit.1.gz
%{_mandir}/man1/strings.1.gz
%{_mandir}/man1/nm.1.gz
%{_mandir}/man1/ar.1.gz
%{_mandir}/man1/ld.1.gz
%{_mandir}/man1/dlltool.1.gz
%{_mandir}/man1/addr2line.1.gz
%{_mandir}/man1/windres.1.gz
%{_mandir}/man1/size.1.gz
%{_mandir}/man1/objdump.1.gz
%files devel
%{_includedir}/ansidecl.h
%{_includedir}/bfd.h
%{_includedir}/bfdlink.h
%{_includedir}/ctf-api.h
%{_includedir}/ctf.h
%{_includedir}/demangle.h
%{_includedir}/diagnostics.h
%{_includedir}/dis-asm.h
%{_includedir}/libiberty.h
%{_includedir}/plugin-api.h
%{_includedir}/symcat.h
%{_libdir}/bfd-plugins/libdep.so
%{_libdir}/libbfd.a
%{_libdir}/libbfd.so
%{_libdir}/libctf-nobfd.a
%{_libdir}/libctf-nobfd.so
%{_libdir}/libctf-nobfd.so.0
%{_libdir}/libctf-nobfd.so.0.*
%{_libdir}/libctf.a
%{_libdir}/libctf.so
%{_libdir}/libctf.so.0
%{_libdir}/libctf.so.0.*
%{_libdir}/libiberty.a
%{_libdir}/libopcodes.a
%{_libdir}/libopcodes.so
%if %{build_cross}
%files -n cross-%{name}-common -f files.cross
%license %{srcdir}/COPYING
%endif
%do_files aarch64-linux-gnu %{build_aarch64}
%changelog
* Thu Nov 14 2024 Thien Trung Vuong <[email protected]> - 2.37-10
- Added patch to fix CVE-2023-1972, CVE-2022-48063, CVE-2022-35205
* Mon Nov 04 2024 Nicolas Guibourge <[email protected]> - 2.37-9
- Address CVE-2022-47007, CVE-2022-47008, CVE-2022-47010, CVE-2022-47011.
* Fri Nov 17 2023 Pawel Winogrodzki <[email protected]> - 2.37-8
- Add the cross-compilation subpackage for aarch64.
- Used Fedora 38 spec (license: MIT) for guidance.
* Wed Sep 20 2023 Jon Slobodzian <[email protected]> - 2.37-7
- Recompile with stack-protection fixed gcc version (CVE-2023-4039)
* Tue Aug 29 2023 Andy Zaugg <[email protected]> - 2.37-6
- Use the pic'ed libiberty.a version
* Wed Feb 08 2023 Rachel Menge <[email protected]> - 2.37-5
- Backport upstream patch to fix CVE-2022-4285
* Thu Sep 01 2022 Henry Beberman <[email protected]> - 2.37-4
- Backport upstream patch to fix CVE-2022-38533
* Wed Apr 20 2022 Andrew Phelps <[email protected]> - 2.37-3
- Add patch to fix CVE-2021-45078
* Fri Dec 03 2021 Andrew Phelps <[email protected]> - 2.37-2
- Add thin_archive_descriptor.patch to fix nodejs build issue
* Thu Nov 04 2021 Andrew Phelps <[email protected]> - 2.37-1
- Update version to 2.37
- Update export-demangle-header.patch
* Fri Oct 15 2021 Ismail Kose <[email protected]> - 2.36.1-4
- Adding READONLY keyword support in linker script
- Verified license
* Tue Sep 14 2021 Pawel Winogrodzki <[email protected]> - 2.36.1-3
- Adding 'libiberty' lib and header.
* Tue Aug 24 2021 Thomas Crain <[email protected]> - 2.36.1-2
- Add patch from Fedora 34 (license: MIT) to export demangle.h from libiberty sources
- Lint spec
* Tue May 11 2021 Andrew Phelps <[email protected]> - 2.36.1-1
- Update to version 2.36.1
* Mon Jan 11 2021 Emre Girgin <[email protected]> - 2.32-5
- Update URL and Source0 to use https.
- Fix CVE-2020-35493.
- Fix CVE-2020-35494.
- Fix CVE-2020-35495.
- Fix CVE-2020-35496.
- Fix CVE-2020-35507.
* Thu Oct 22 2020 Nicolas Ontiveros <[email protected]> - 2.32-4
- Use autosetup
- Fix CVE-2019-12972.
- Fix CVE-2019-14250.
- Fix CVE-2019-14444.
- Fix CVE-2019-9071.
- No patch CVE-2019-9072.
- Fix CVE-2019-9073.
- Fix CVE-2019-9074.
- No patch CVE-2019-9076.
- Fix CVE-2019-17450.
- Fix CVE-2019-17451.
* Sat May 09 2020 Nick Samson <[email protected]> - 2.32-3
- Added %%license line automatically
* Wed May 06 2020 Nicolas Ontiveros <[email protected]> - 2.32-2
- Fix CVE-2019-9077.
- Fix CVE-2019-9075.
- Fix CVE-2019-9070.
- Remove sha1 macro.
* Thu Feb 06 2020 Andrew Phelps <[email protected]> - 2.32-1
- Update to version 2.32
* Tue Sep 03 2019 Mateusz Malisz <[email protected]> - 2.31.1-5
- Initial CBL-Mariner import from Photon (license: Apache2).
* Thu Mar 14 2019 Priyesh Padmavilasom <[email protected]> - 2.31.1-4
- Fix CVE-2019-9075 and CVE-2019-9077
* Tue Jan 22 2019 Anish Swaminathan <[email protected]> - 2.31.1-3
- fix CVE-2018-1000876
* Tue Jan 08 2019 Alexey Makhalov <[email protected]> - 2.31.1-2
- Fix CVE-2018-17358, CVE-2018-17359 and CVE-2018-17360
* Fri Sep 21 2018 Keerthana K <[email protected]> - 2.31.1-1
- Update to version 2.31.1
* Wed Aug 1 2018 Keerthana K <[email protected]> - 2.31-1
- Update to version 2.31.
* Thu Jun 7 2018 Keerthana K <[email protected]> - 2.30-4
- Fix CVE-2018-10373
* Mon Mar 19 2018 Alexey Makhalov <[email protected]> - 2.30-3
- Add libiberty to the -devel package
* Wed Feb 28 2018 Xiaolin Li <[email protected]> - 2.30-2
- Fix CVE-2018-6543.
* Mon Jan 29 2018 Xiaolin Li <[email protected]> - 2.30-1
- Update to version 2.30
* Mon Dec 18 2017 Anish Swaminathan <[email protected]> - 2.29.1-5
- Fix CVEs CVE-2017-17121, CVE-2017-17122, CVE-2017-17123,
- CVE-2017-17124, CVE-2017-17125
* Mon Dec 4 2017 Anish Swaminathan <[email protected]> - 2.29.1-4
- Fix CVEs CVE-2017-16826, CVE-2017-16827, CVE-2017-16828, CVE-2017-16829,
- CVE-2017-16830, CVE-2017-16831, CVE-2017-16832
* Tue Nov 14 2017 Alexey Makhalov <[email protected]> - 2.29.1-3
- Aarch64 support
- Parallel build
* Thu Oct 12 2017 Anish Swaminathan <[email protected]> - 2.29.1-2
- Add patch to fix CVE-2017-15020
* Mon Oct 2 2017 Anish Swaminathan <[email protected]> - 2.29.1-1
- Version update to 2.29.1, fix CVEs CVE-2017-12799, CVE-2017-14729,CVE-2017-14745
* Fri Aug 11 2017 Anish Swaminathan <[email protected]> - 2.29-3
- Apply patches for CVE-2017-12448,CVE-2017-12449,CVE-2017-12450,CVE-2017-12451,
- CVE-2017-12452,CVE-2017-12453,CVE-2017-12454,CVE-2017-12455,CVE-2017-12456,
- CVE-2017-12457,CVE-2017-12458,CVE-2017-12459
* Tue Aug 8 2017 Rongrong Qiu <[email protected]> - 2.29-2
- fix for make check for bug 1900247
* Wed Aug 2 2017 Alexey Makhalov <[email protected]> - 2.29-1
- Version update
* Tue May 16 2017 Priyesh Padmavilasom <[email protected]> - 2.28-2
- Patch for CVE-2017-8421
* Thu Apr 06 2017 Anish Swaminathan <[email protected]> - 2.28-1
- Upgraded to version 2.28
- Apply patch for CVE-2017-6969
* Tue May 24 2016 Priyesh Padmavilasom <[email protected]> - 2.25.1-2
- GA - Bump release of all rpms
* Tue Jan 12 2016 Xiaolin Li <[email protected]> - 2.25.1-1
- Updated to version 2.25.1
* Tue Nov 10 2015 Xiaolin Li <[email protected]> - 2.25-2
- Handled locale files with macro find_lang
* Mon Apr 6 2015 Priyesh Padmavilasom <[email protected]> - 2.25-1
- Updated to 2.25
* Wed Nov 5 2014 Divya Thaluru <[email protected]> - 2.24-1
- Initial build. First version