packaging: Add -Wformat options to disable warnings and tests FAIL.
[platform/upstream/linaro-gcc.git] / packaging / linaro-gcc.spec
1 #
2 # spec file for package gcc6
3 #
4 # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 # Copyright (c) 2015 Tizen
6 #
7 # All modifications and additions to the file contributed by third parties
8 # remain the property of their copyright owners, unless otherwise agreed
9 # upon. The license for this file, and modifications and additions to the
10 # file, is the same license as for the pristine package itself (unless the
11 # license for the pristine package is not an Open Source License, in which
12 # case the license is the MIT License). An "Open Source License" is a
13 # license that conforms to the Open Source Definition (Version 1.9)
14 # published by the Open Source Initiative.
15
16 # Please submit bugfixes or comments via http://bugs.tizen.org/
17 #
18 # we use %%{?macro: ... } as it is more compact
19 %if 0%{?run_tests}
20 %define gcc_run_tests 1
21 %endif
22
23 %define quadmath_arch %ix86 x86_64 ia64
24 %define tsan_arch x86_64 aarch64
25 %define esan_arch x86_64 armv7l
26 %define asan_arch x86_64 %ix86 ppc ppc64 %sparc %arm aarch64
27 %define itm_arch x86_64 %ix86 %arm ppc ppc64 ppc64le s390 s390x %sparc aarch64
28 %define atomic_arch x86_64 %ix86 %arm aarch64 ppc ppc64 ppc64le s390 s390x %sparc m68k
29 %define lsan_arch x86_64 %ix86 %arm aarch64
30 %define ubsan_arch x86_64 %ix86 ppc ppc64 %arm aarch64
31 %define cilkrts_arch x86_64 %ix86
32
33 %ifarch armv7l
34 %define ARCH armv7l
35 %define ABI eabi
36 %endif
37 %ifarch armv7hl
38 %define ARCH armv7hl
39 %define ABI eabihf
40 %endif
41 %ifarch %ix86
42 %define ARCH i586
43 %endif
44 %ifarch x86_64
45 %define ARCH x86_64
46 %endif
47 %ifarch aarch64
48 %define ARCH aarch64
49 %endif
50 %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
51
52 %define target_cpu %{?cross}%{!?cross:%{ARCH}}
53 %define target_abi %{?cross:%{?armv7l:eabi}%{?armv7hl:eabihf}}%{!?cross:%{?ABI}}
54
55 %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi}
56 %define libdir %{!?cross:%{_libdir}}%{?cross:%{_prefix}/lib%{?aarch64:64}}
57 %define libsubdir %{libdir}/gcc/%{target_arch}/%{version}
58
59 Name:         gcc%{?cross:-%{cross}}
60 # With generated files in src we could drop the following
61 BuildRequires: bison
62 BuildRequires: flex
63 BuildRequires: gettext-devel
64 BuildRequires: makeinfo
65 ## until here, but at least renaming and patching info files breaks this
66 BuildRequires: gcc-c++
67 BuildRequires: zlib-devel
68 %ifarch x86_64
69 BuildRequires: glibc-devel-32bit
70 %endif
71 BuildRequires: perl
72 %{?cross:BuildRequires: binutils-%{cross}}
73 # here we use %%if because OBS spec parser cannot expand
74 # %%{?macro:...} correctly
75 %if 0%{?gcc_run_tests}
76 BuildRequires: dejagnu
77 BuildRequires: expect
78 BuildRequires: gdb
79 %endif
80 URL:           http://gcc.gnu.org/
81 Version:       6.2.1
82 Release:       0
83 Source:        gcc-%{version}.tar.bz2
84 Source10: gmp-6.1.1.tar.bz2
85 Source11: mpfr-3.1.5.tar.bz2
86 Source12: mpc-1.0.3.tar.gz
87 Source13: isl-0.17.1.tar.bz2
88 Source20: gcc.manifest
89 Group:         Development/Building
90 Summary:       The GNU C Compiler and Support Files
91 License:       GPL-3.0+
92 %{?cross:ExcludeArch: %{cross}}
93 %description
94 Core package for the GNU Compiler Collection, including the C language
95 frontend.
96
97 %package c++
98 Summary:       The GNU C++ Compiler
99 License:       GPL-3.0+
100 Group:         Development/Languages
101 %description c++
102 This package contains the GNU compiler for C++.
103
104 %package -n libstdc++
105 Summary:       The standard C++ shared library
106 License:       GPL-3.0-with-GCC-exception
107 Group:         Development/Building
108 %description -n libstdc++
109 The standard C++ library, needed for dynamically linked C++ programs.
110 %post -n libstdc++ -p /sbin/ldconfig
111 %postun -n libstdc++ -p /sbin/ldconfig
112
113 %package -n libstdc++-devel
114 Summary:       Include Files and Libraries mandatory for Development
115 License:       GPL-3.0-with-GCC-exception
116 Group:         Development/Building
117 %description -n libstdc++-devel
118 This package contains all the headers and libraries of the standard C++
119 library. It is needed for compiling C++ code.
120
121 %package -n libgcc
122 Summary:       C compiler runtime library
123 License:       GPL-3.0-with-GCC-exception
124 Group:         Development/Building
125 %description -n libgcc
126 Libgcc is needed for dynamically linked C programs.
127 %post -n libgcc -p /sbin/ldconfig
128 %postun -n libgcc -p /sbin/ldconfig
129
130 %package -n libgomp
131 Summary:       The GNU compiler collection OpenMP runtime library
132 License:       GPL-3.0-with-GCC-exception
133 Group:         Development/Building
134 %description -n libgomp
135 This is the OpenMP runtime library needed by OpenMP enabled programs
136 that were built with the -fopenmp compiler option and by programs that
137 were auto-parallelized via the -ftree-parallelize-loops compiler
138 option.
139 %post -n libgomp -p /sbin/ldconfig
140 %postun -n libgomp -p /sbin/ldconfig
141
142 %package objc
143 Summary:       GNU Objective C Compiler
144 License:       GPL-3.0+
145 Group:         Development/Languages
146 %description objc
147 This package contains the GNU Objective C compiler. Objective C is an
148 object oriented language, created by Next Inc. and used in their
149 Nextstep OS. The source code is available in the gcc package.
150
151 %package -n libobjc
152 Summary:       Library for the GNU Objective C Compiler
153 License:       GPL-3.0-with-GCC-exception
154 Group:         Development/Building
155 %description -n libobjc
156 The library for the GNU Objective C compiler.
157 %post -n libobjc -p /sbin/ldconfig
158 %postun -n libobjc -p /sbin/ldconfig
159
160 %package -n libcc1
161 Summary:       GNU C Compiler plugin for GDB
162 License:       GPL-3.0-with-GCC-exception
163 Group:         Development/Building
164 %description -n libcc1
165 The GCC plugin for GDB
166 %post -n libcc1 -p /sbin/ldconfig
167 %postun -n libcc1 -p /sbin/ldconfig
168
169 %package obj-c++
170 Summary:       GNU Objective C++ Compiler
171 License:       GPL-3.0+
172 Group:         Development/Languages
173 %description obj-c++
174 This package contains the GNU Objective C++ compiler. Objective C++ is an
175 object oriented language, created by Next Inc. and used in their
176 Nextstep OS. The source code is available in the gcc package.
177
178 %package -n cpp
179 Summary:       The GCC Preprocessor
180 License:       GPL-3.0+
181 Group:         Development/Languages
182 %description -n cpp
183 This Package contains just the preprocessor that is used by the X11
184 packages.
185
186 %package ada
187 Summary:       GNU Ada95 Compiler Based on GCC (GNAT)
188 License:       GPL-3.0+
189 Group:         Development/Languages
190 %description ada
191 This package contains an Ada95 compiler and associated development
192 tools based on the GNU GCC technology. Ada95 is the object oriented
193 successor of the Ada83 language. To build this package from source you
194 must have installed a binary version to bootstrap the compiler.
195
196 %package -n libada
197 Summary:      GNU Ada Runtime Libraries
198 License:      GPL-3.0-with-GCC-exception
199 Group:        Development/Languages
200 %description -n libada
201 This package contains the shared libraries required to run programs
202 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
203 shared libraries. It also contains the shared libraries for the
204 Implementation of the Ada Semantic Interface Specification (ASIS), the
205 implementation of Distributed Systems Programming (GLADE) and the Posix
206 1003.5 Binding (Florist).
207 %post -n libada -p /sbin/ldconfig
208 %postun -n libada -p /sbin/ldconfig
209
210 %package fortran
211 Summary:       The GNU Fortran Compiler and Support Files
212 License:       GPL-3.0+
213 Group:         Development/Languages
214 %description fortran
215 This is the Fortran compiler of the GNU Compiler Collection (GCC).
216
217 %package -n libgfortran
218 Summary:       The GNU Fortran Compiler Runtime Library
219 License:       GPL-3.0-with-GCC-exception
220 Group:         Development/Languages
221 %description -n libgfortran
222 The runtime library needed to run programs compiled with the Fortran compiler
223 of the GNU Compiler Collection (GCC).
224 %post -n libgfortran -p /sbin/ldconfig
225 %postun -n libgfortran -p /sbin/ldconfig
226
227 %package -n libquadmath
228 Summary:       The GNU Fortran Compiler Quadmath Runtime Library
229 License:       LGPL-2.1
230 Group:         Development/Languages
231 %description -n libquadmath
232 The runtime library needed to run programs compiled with the Fortran compiler
233 of the GNU Compiler Collection (GCC) and quadruple precision floating point
234 operations.
235 %post -n libquadmath -p /sbin/ldconfig
236 %postun -n libquadmath -p /sbin/ldconfig
237
238 %package -n libitm
239 Summary:       The GNU Compiler Transactional Memory Runtime Library
240 License:       GPL-3.0-with-GCC-exception
241 Group:         Development/Languages
242 %description -n libitm
243 The runtime library needed to run programs compiled with the
244 -fgnu-tm option of the GNU Compiler Collection (GCC).
245 %post -n libitm -p /sbin/ldconfig
246 %postun -n libitm -p /sbin/ldconfig
247
248 %package -n libasan
249 Summary:       The GNU Compiler Address Sanitizer Runtime Library
250 License:       MIT
251 Group:         Development/Languages
252 %description -n libasan
253 The runtime library needed to run programs compiled with the
254 -fsanitize=address option of the GNU Compiler Collection (GCC).
255 %post -n libasan -p /sbin/ldconfig
256 %postun -n libasan -p /sbin/ldconfig
257
258 %package -n libtsan
259 Summary:       The GNU Compiler Thread Sanitizer Runtime Library
260 License:       MIT
261 Group:         Development/Languages
262 %description -n libtsan
263 The runtime library needed to run programs compiled with the
264 -fsanitize=thread option of the GNU Compiler Collection (GCC).
265 %post -n libtsan -p /sbin/ldconfig
266 %postun -n libtsan -p /sbin/ldconfig
267
268 %package -n libesan
269 Summary:       The GNU Compiler Efficciency Sanitier Runtime Library
270 License:       MIT
271 Group:         Development/Languages
272 %description -n libesan
273 The runtime library needed to run programs compiled with the
274 -fsanitize=efficiency-working-set option of the GNU Compiler Collection (GCC).
275 %post -n libesan -p /sbin/ldconfig
276 %postun -n libesan -p /sbin/ldconfig
277
278 %package -n libatomic
279 Summary:       The GNU Compiler Atomic Operations Runtime Library
280 License:       GPL-3.0-with-GCC-exception
281 Group:         Development/Languages
282 %description -n libatomic
283 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
284 %post -n libatomic -p /sbin/ldconfig
285 %postun -n libatomic -p /sbin/ldconfig
286
287 %package -n libcilkrts
288 Summary:       The GNU Compiler Cilk+ Runtime Library
289 License:       MIT
290 Group:         Development/Languages
291 %description -n libcilkrts
292 The runtime library needed to run programs compiled with the
293 -fcilkplus option of the GNU Compiler Collection (GCC).
294 %post -n libcilkrts -p /sbin/ldconfig
295 %postun -n libcilkrts -p /sbin/ldconfig
296
297 %package -n liblsan
298 Summary:       The GNU Compiler Leak Sanitizer Runtime Library
299 License:       MIT
300 Group:         Development/Languages
301 %description -n liblsan
302 The runtime library needed to run programs compiled with the
303 -fsanitize=leak option of the GNU Compiler Collection (GCC).
304 %post -n liblsan -p /sbin/ldconfig
305 %postun -n liblsan -p /sbin/ldconfig
306
307 %package -n libubsan
308 Summary:       The GNU Compiler Undefined Sanitizer Runtime Library
309 License:       MIT
310 Group:         Development/Languages
311 %description -n libubsan
312 The runtime library needed to run programs compiled with the
313 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
314 %post -n libubsan -p /sbin/ldconfig
315 %postun -n libubsan -p /sbin/ldconfig
316
317 %package -n libvtv
318 Summary:       The GNU Compiler Vtable Verifier Runtime Library
319 License:       MIT
320 Group:         Development/Languages
321 %description -n libvtv
322 The runtime library needed to run programs compiled with the
323 -fvtable-verify option of the GNU Compiler Collection (GCC).
324 %post -n libvtv -p /sbin/ldconfig
325 %postun -n libvtv -p /sbin/ldconfig
326
327 %package -n libgcj
328 Summary:       Java Runtime Library for gcc
329 License:       GPL-2.0-with-classpath-exception
330 Group:         Development/Building
331 %description -n libgcj
332 This library is needed if you want to use the GNU Java compiler, gcj.
333 Source code for this package is in gcc.
334 %post -n libgcj -p /sbin/ldconfig
335 %postun -n libgcj -p /sbin/ldconfig
336
337 %package java
338 Summary:       The GNU Java Compiler
339 License:       GPL-3.0+
340 Group:         Development/Languages
341 %description java
342 The Java compiler from the GCC-tools-suite.
343
344 %package -n libgcj_bc
345 Summary:       Fake library for BC-ABI compatibility.
346 License:       GPL-2.0-with-classpath-exception
347 Group:         Development/Languages
348 %description -n libgcj_bc
349 A fake library that is used at link time only. It ensures that
350 binaries built with the BC-ABI link against a constant SONAME.
351 This way, BC-ABI binaries continue to work if the SONAME underlying
352 libgcj.so changes.
353
354 %package -n libgcj-jar
355 Summary:       Java runtime library (jar files).
356 License:       GPL-2.0-with-classpath-exception
357 Group:         Development/Languages
358 %description -n libgcj-jar
359 These are the jar files that go along with the gcj front end to gcc.
360
361 %package -n libgcj-devel
362 Summary:       Include Files and Libraries mandatory for Development.
363 License:       GPL-2.0-with-classpath-exception
364 Group:         Development/Languages
365 %description -n libgcj-devel
366 This package contains all necessary include files and libraries needed
367 to develop applications that require these.
368
369 %package -n gcc-gij
370 Summary:       Java Bytecode Interpreter for gcc
371 License:       GPL-2.0-with-classpath-exception
372 Group:         Development/Languages
373 %description -n gcc-gij
374 This package contains the java bytecode interpreter gij and related tools.
375
376 %package -n libffi
377 Summary:       Foreign Function Interface library
378 License:       BSD-3-Clause
379 Group:         Development/Building
380 %description -n libffi
381 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
382 %post -n libffi -p /sbin/ldconfig
383 %postun -n libffi -p /sbin/ldconfig
384
385 %package -n libffi-devel
386 Summary:       Foreign Function Interface library development files
387 License:       BSD 3-Clause
388 Group:         Development/Building
389 %description -n libffi-devel
390 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
391
392 %package go
393 Summary:       GNU Go Compiler
394 License:       GPL-3.0+
395 Group:         Development/Languages
396 %description go
397 This package contains a Go compiler and associated development
398 files based on the GNU GCC technology.
399
400 %package -n libgo
401 Summary:       GNU Go compiler runtime library
402 License:       BSD-3-Clause
403 Group:         Development/Languages
404 %description -n libgo
405 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
406 %post -n libgo -p /sbin/ldconfig
407 %postun -n libgo -p /sbin/ldconfig
408
409 %package testresults
410 Summary:       Testsuite results
411 License:       SUSE-Public-Domain
412 Group:         Development/Languages
413 %description testresults
414 Results from running the gcc and target library testsuites.
415
416 %package -n gcc-32bit
417 Summary:       The GNU C Compiler 32bit support
418 Group:         Development/Building
419 %description -n gcc-32bit
420 This package contains 32bit support for the GNU Compiler Collection.
421
422 %package -n libstdc++-devel-32bit
423 Summary:       Include Files and Libraries mandatory for Development
424 License:       GPL-3.0-with-GCC-exception
425 Group:         Development/Building
426 %description -n libstdc++-devel-32bit
427 This package contains all the headers and libraries of the standard C++
428 library. It is needed for compiling C++ code.
429
430 %package -n libgcc-32bit
431 Summary:       C compiler runtime library
432 License:       GPL-3.0-with-GCC-exception
433 Group:         Development/Building
434 %description -n libgcc-32bit
435 Libgcc is needed for dynamically linked C programs.
436 %post -n libgcc-32bit -p /sbin/ldconfig
437 %postun -n libgcc-32bit -p /sbin/ldconfig
438
439 %package -n libgomp-32bit
440 Summary:       The GNU compiler collection OpenMP runtime library
441 License:       GPL-3.0-with-GCC-exception
442 Group:         Development/Building
443 %description -n libgomp-32bit
444 This is the OpenMP runtime library needed by OpenMP enabled programs
445 that were built with the -fopenmp compiler option and by programs that
446 were auto-parallelized via the -ftree-parallelize-loops compiler
447 option.
448 %post -n libgomp-32bit -p /sbin/ldconfig
449 %postun -n libgomp-32bit -p /sbin/ldconfig
450
451 %package -n libstdc++-32bit
452 Summary:       The standard C++ shared library
453 License:       GPL-3.0-with-GCC-exception
454 Group:         Development/Building
455 %description -n libstdc++-32bit
456 The standard C++ library, needed for dynamically linked C++ programs.
457 %post -n libstdc++-32bit -p /sbin/ldconfig
458 %postun -n libstdc++-32bit -p /sbin/ldconfig
459
460 %package objc-32bit
461 Summary:       GNU Objective C Compiler
462 License:       GPL-3.0+
463 Group:         Development/Languages
464 %description objc-32bit
465 This package contains the GNU Objective C compiler. Objective C is an
466 object oriented language, created by Next Inc. and used in their
467 Nextstep OS. The source code is available in the gcc package.
468
469 %package -n libobjc-32bit
470 Summary:       Library for the GNU Objective C Compiler
471 License:       GPL-3.0-with-GCC-exception
472 Group:         Development/Building
473 %description -n libobjc-32bit
474 The library for the GNU Objective C compiler.
475 %post -n libobjc-32bit -p /sbin/ldconfig
476 %postun -n libobjc-32bit -p /sbin/ldconfig
477
478 %package ada-32bit
479 Summary:       GNU Ada95 Compiler Based on GCC (GNAT)
480 License:       GPL-3.0+
481 Group:         Development/Languages
482 %description ada-32bit
483 This package contains an Ada95 compiler and associated development
484 tools based on the GNU GCC technology. Ada95 is the object oriented
485 successor of the Ada83 language. To build this package from source you
486 must have installed a binary version to bootstrap the compiler.
487
488 %package -n libada-32bit
489 Summary:       GNU Ada Runtime Libraries
490 License:       GPL-3.0-with-GCC-exception
491 Group:         Development/Languages
492 %description -n libada-32bit
493 This package contains the shared libraries required to run programs
494 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
495 shared libraries. It also contains the shared libraries for the
496 Implementation of the Ada Semantic Interface Specification (ASIS), the
497 implementation of Distributed Systems Programming (GLADE) and the Posix
498 1003.5 Binding (Florist).
499 %post -n libada-32bit -p /sbin/ldconfig
500 %postun -n libada-32bit -p /sbin/ldconfig
501
502 %package fortran-32bit
503 Summary:       The GNU Fortran Compiler and Support Files
504 License:       GPL-3.0+
505 Group:         Development/Languages
506 %description fortran-32bit
507 This is the Fortran compiler of the GNU Compiler Collection (GCC).
508
509 %package -n libgfortran-32bit
510 Summary:       The GNU Fortran Compiler Runtime Library
511 License:       GPL-3.0-with-GCC-exception
512 Group:         Development/Languages
513 %description -n libgfortran-32bit
514 The runtime library needed to run programs compiled with the Fortran compiler
515 of the GNU Compiler Collection (GCC).
516 %post -n libgfortran-32bit -p /sbin/ldconfig
517 %postun -n libgfortran-32bit -p /sbin/ldconfig
518
519 %package -n libquadmath-32bit
520 Summary:       The GNU Fortran Compiler Quadmath Runtime Library
521 License:       LGPL-2.1
522 Group:         Development/Languages
523 %description -n libquadmath-32bit
524 The runtime library needed to run programs compiled with the Fortran compiler
525 of the GNU Compiler Collection (GCC) and quadruple precision floating point
526 operations.
527 %post -n libquadmath-32bit -p /sbin/ldconfig
528 %postun -n libquadmath-32bit -p /sbin/ldconfig
529
530 %package -n libitm-32bit
531 Summary:       The GNU Compiler Transactional Memory Runtime Library
532 License:       GPL-3.0-with-GCC-exception
533 Group:         Development/Languages
534 %description -n libitm-32bit
535 The runtime library needed to run programs compiled with the
536 -fgnu-tm option of the GNU Compiler Collection (GCC).
537 %post -n libitm-32bit -p /sbin/ldconfig
538 %postun -n libitm-32bit -p /sbin/ldconfig
539
540 %package -n libasan-32bit
541 Summary:       The GNU Compiler Address Sanitizer Runtime Library
542 License:       MIT
543 Group:         Development/Languages
544 %description -n libasan-32bit
545 The runtime library needed to run programs compiled with the
546 -fsanitize=address option of the GNU Compiler Collection (GCC).
547 %post -n libasan-32bit -p /sbin/ldconfig
548 %postun -n libasan-32bit -p /sbin/ldconfig
549
550 %package -n liblsan-32bit
551 Summary:       The GNU Compiler Address Sanitizer Runtime Library
552 License:       MIT
553 Group:         Development/Languages
554 %description -n liblsan-32bit
555 The runtime library needed to run programs compiled with the
556 -fsanitize=leak option of the GNU Compiler Collection (GCC).
557 %post -n liblsan-32bit -p /sbin/ldconfig
558 %postun -n liblsan-32bit -p /sbin/ldconfig
559
560 %package -n libtsan-32bit
561 Summary:       The GNU Compiler Thread Sanitizer Runtime Library
562 License:       MIT
563 Group:         Development/Languages
564 %description -n libtsan-32bit
565 The runtime library needed to run programs compiled with the
566 -fsanitize=thread option of the GNU Compiler Collection (GCC).
567 %post -n libtsan-32bit -p /sbin/ldconfig
568 %postun -n libtsan-32bit -p /sbin/ldconfig
569
570 %package -n libatomic-32bit
571 Summary:       The GNU Compiler Atomic Operations Runtime Library
572 License:       GPL-3.0-with-GCC-exception
573 Group:         Development/Languages
574 %description -n libatomic-32bit
575 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
576 %post -n libatomic-32bit -p /sbin/ldconfig
577 %postun -n libatomic-32bit -p /sbin/ldconfig
578
579 %package -n libcilkrts-32bit
580 Summary:       The GNU Compiler Cilk+ Runtime Library
581 License:       MIT
582 Group:         Development/Languages
583 %description -n libcilkrts-32bit
584 The runtime library needed to run programs compiled with the
585 -fcilkplus option of the GNU Compiler Collection (GCC).
586 %post -n libcilkrts-32bit -p /sbin/ldconfig
587 %postun -n libcilkrts-32bit -p /sbin/ldconfig
588
589 %package -n libubsan-32bit
590 Summary:       The GNU Compiler Undefined Sanitizer Runtime Library
591 License:       MIT
592 Group:         Development/Languages
593 %description -n libubsan-32bit
594 The runtime library needed to run programs compiled with the
595 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
596 %post -n libubsan-32bit -p /sbin/ldconfig
597 %postun -n libubsan-32bit -p /sbin/ldconfig
598
599 %package -n libvtv-32bit
600 Summary:       The GNU Compiler Vtable Verifier Runtime Library
601 License:       MIT
602 Group:         Development/Languages
603 %description -n libvtv-32bit
604 The runtime library needed to run programs compiled with the
605 -fvtable-verify option of the GNU Compiler Collection (GCC).
606 %post -n libvtv-32bit -p /sbin/ldconfig
607 %postun -n libvtv-32bit -p /sbin/ldconfig
608
609 %package -n libffi-32bit
610 Summary:       Foreign Function Interface library
611 License:       BSD-3-Clause
612 Group:         Development/Building
613 %description -n libffi-32bit
614 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
615 %post -n libffi-32bit -p /sbin/ldconfig
616 %postun -n libffi-32bit -p /sbin/ldconfig
617
618 %package -n libffi-devel-32bit
619 Summary:       Foreign Function Interface library development files
620 License:       BSD 3-Clause
621 Group:         Development/Building
622 %description -n libffi-devel-32bit
623 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
624
625 %package go-32bit
626 Summary:       GNU Go Compiler
627 License:       GPL-3.0+
628 Group:         Development/Languages
629 %description go-32bit
630 This package contains a Go compiler and associated development
631 files based on the GNU GCC technology.
632
633 %package -n libgo-32bit
634 Summary:       GNU Go compiler runtime library
635 License:       BSD-3-Clause
636 Group:         Development/Languages
637 %description -n libgo-32bit
638 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
639 %post -n libgo-32bit -p /sbin/ldconfig
640 %postun -n libgo-32bit -p /sbin/ldconfig
641
642 %package plugin-devel
643 Summary:       GNU GCC Plugin development files
644 License:       GPL-3.0+
645 Group:         Development/Languages
646 %description plugin-devel
647 This package contains GCC Plugin development files needed for compiler
648 plugins build.
649
650 %package -n sanitizer-sources
651 Summary:    Sanitizer family tools sources
652 License:       MIT
653 Group:      Development/Tools
654 BuildArch:  noarch
655
656 %description -n sanitizer-sources
657 Sanitizer family tools sources for external tools.
658
659 %prep
660
661 %setup -q -n gcc-%{version}
662 cp %{SOURCE20} .
663
664 tar xf %{SOURCE10}
665 ln -sf gmp-6.1.1 gmp
666 tar xf %{SOURCE11}
667 ln -sf mpfr-3.1.5 mpfr
668 tar xf %{SOURCE12}
669 ln -sf mpc-1.0.3 mpc
670 tar xf %{SOURCE13}
671 ln -sf isl-0.17.1 isl
672
673 echo "" > gcc/DEV-PHASE
674
675 %global gcc_release `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/LINARO-VERSION`
676
677 %build
678 %{?asan:
679 %gcc_unforce_options
680 %ifarch armv7l
681 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -marm -Wa,-mimplicit-it=arm -fno-omit-frame-pointer"
682 %endif
683 }
684 %{?esan:%gcc_unforce_options}
685 rm -rf obj
686 mkdir obj
687 cd obj
688
689 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-fno-rtti//g' -e 's/-fno-exceptions//g' -e 's/-Wmissing-format-attribute//g' -e 's/-fstack-protector//g' -e 's/-ffortify=.//g' -e 's/-Wall//g' -e 's/-m32//g' -e 's/-m64//g' -e 's/-fexceptions//' -e 's/\([[:space:]]\+.*-D_FORTIFY_SOURCE=\)[[:alnum:]]\+/\10/g'
690 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D__USE_FORTIFY_LEVEL=0"`
691 %{?cross:
692 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
693 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(sse\|fpmath\)[^ ]*//g'`
694 }
695 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/  */ /g'`
696
697 # -Wall is stripped off now, so -Wformat will not turn on implicitly for
698 # "-Wformat-.." option group, causing additional build warnings and testsuite
699 # FAIL ("test for excess errors" type).
700 # Insert "-Wformat" if we find "-Wformat-..."
701 if [ ! -z "$(echo $RPM_OPT_FLAGS | grep -o "\B\-Wformat\-")" ]; then
702     if [ -z "$(echo $RPM_OPT_FLAGS | grep -Po "\B\-Wformat(\s|\Z)")" ]; then
703         RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e "s/-Wformat-/-Wformat -Wformat-/")
704     fi
705 fi
706
707 %{?asan: RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS -DASAN_INIT_FIRST) }
708
709 %ifarch armv7l armv7hl aarch64
710 %undefine gcc_profiledbootstrap
711 %endif
712
713 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
714 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
715 ../configure \
716         --prefix=%{_prefix} \
717         --infodir=%{_infodir} \
718         --mandir=%{_mandir} \
719         --libdir=%{libdir} \
720         --libexecdir=%{libdir} \
721         --enable-languages=c,c++,fortran \
722         --enable-checking=release \
723         --disable-libssp \
724         %{!?gcc_profiledbootstrap:--disable-bootstrap} \
725         --disable-libvtv \
726         --enable-plugin \
727         --disable-libcc1 \
728         --disable-libgcj \
729         --with-slibdir=%{libdir} \
730         --with-system-zlib \
731         --with-sysroot=/ \
732         --enable-__cxa_atexit \
733         --enable-libstdcxx-allocator=new \
734         --enable-version-specific-runtime-libs \
735         --enable-linker-build-id \
736         --without-system-libunwind \
737         --enable-threads=posix \
738         --disable-multilib \
739         --enable-lto \
740 %{!?cross: \
741         --enable-libcc1 \
742         --enable-libgfortran \
743         %{?asanbootstrap:--enable-bootstrap --with-build-config=bootstrap-asan} \
744 %ifarch armv7l
745         --with-arch=armv7-a \
746         --with-tune=cortex-a8 \
747         --disable-sjlj-exceptions \
748 %endif
749 %ifarch armv7hl
750         --with-arch=armv7-a \
751         --with-tune=cortex-a8 \
752         --disable-sjlj-exceptions \
753         --with-float=hard \
754 %endif
755 %ifarch aarch64
756         --with-arch=armv8-a \
757         --disable-sjlj-exceptions \
758 %endif
759 %ifarch %ix86
760         --with-arch-32=i586 \
761         --with-tune=generic \
762         --disable-libmpx \
763 %endif
764 %ifarch x86_64
765         --with-arch-32=i586 \
766         --with-tune=generic \
767         --enable-multilib \
768         --disable-libmpx \
769 %endif
770 } \
771 %{?cross: \
772 %{?armv7l: \
773         --with-arch=armv7-a \
774         --with-tune=cortex-a8 \
775         --disable-sjlj-exceptions \
776 } \
777 %{?armv7hl: \
778         --with-arch=armv7-a \
779         --with-tune=cortex-a8 \
780         --disable-sjlj-exceptions \
781         --with-float=hard \
782 } \
783 %{?aarch64: \
784         --with-arch=armv8-a \
785         --disable-sjlj-exceptions \
786 } \
787         --disable-libgcc \
788         --disable-libgfortran \
789         --disable-libquadmath \
790         --disable-libgomp \
791         --disable-libatomic \
792         --disable-libstdc++-v3 \
793         --disable-libsanitizer \
794         --disable-libitm \
795 } \
796         --with-bugurl="http://bugs.tizen.org/" \
797         --with-pkgversion="Tizen/Linaro GCC %{version} %{gcc_release}" \
798         --target=%{target_arch} \
799         --host=%{host_arch} \
800         --build=%{host_arch}
801
802 make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} %{!?cross:%{?gcc_profiledbootstrap:profiledbootstrap}}
803 %{?gcc_run_tests:
804   echo "Run testsuite"
805   # asan needs a whole shadow address space
806   ulimit -v unlimited || true
807   make -k check %{?_smp_mflags} || true
808   mkdir ../testresults
809   ../contrib/test_summary | tee ../testresults/test_summary.txt
810 }
811
812 %install
813 cd obj
814
815 make install DESTDIR=$RPM_BUILD_ROOT
816
817 %{?gcc_run_tests:
818   cp `find . -name "*.sum"` ../testresults/
819   cp `find . -name "*.log"  \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
820   chmod 644 ../testresults/*
821 }
822
823 %{remove_docs}
824 rm -rf %{buildroot}/%{_datadir}/locale
825
826 #remove everything we don't need
827 rm -rf %{buildroot}/%{libsubdir}/install-tools
828 find %{buildroot}/ -name "*.la" -delete
829
830 %{!?cross:
831 ln -s gcc %{buildroot}%{_bindir}/cc
832 mv %{buildroot}%{libsubdir}/libstdc++.so*-gdb.py %{buildroot}%{_datadir}/gcc-%{version}/python/libstdcxx/
833
834 # expose plugins for ar (required for lto builds)
835 mkdir -p %{buildroot}%{_prefix}/lib/bfd-plugins
836 ln -sf %{libsubdir}/liblto_plugin.so %{buildroot}%{_prefix}/lib/bfd-plugins/liblto_plugin.so
837
838 # legacy preprocessor
839 mkdir -p %{buildroot}/lib
840 ln -s %{_bindir}/cpp %{buildroot}/lib/cpp
841
842 # 32-bit libgcc in multilib configuration
843 %ifarch x86_64
844 mv %{buildroot}%{_prefix}/lib/libgcc_s.so* %{buildroot}%{libsubdir}/32/
845 %endif
846
847 # move libraries to libdir
848 for lib in asan atomic cilkrts gfortran gomp cc1 itm lsan quadmath stdc++ supc++ tsan ubsan esan
849 do
850   [ -e %{buildroot}%{libsubdir}/lib$lib.a ] && mv %{buildroot}%{libsubdir}/lib$lib.a %{buildroot}%{libdir}/
851   [ -e %{buildroot}%{libsubdir}/lib$lib.so ] && mv %{buildroot}%{libsubdir}/lib$lib.so* %{buildroot}%{libdir}/
852 done
853 }
854
855 %{?cross:
856 rm -rf %{buildroot}/%{libsubdir}/include-fixed
857 rm -rf %{buildroot}/%{libsubdir}/include
858 }
859
860 %{!?cross:
861 cd ../
862 tar -czf libsanitizer.tar.bz libsanitizer
863 mkdir -p %{buildroot}/src
864 mv -v libsanitizer.tar.bz %{buildroot}/src
865 }
866
867 %files
868 %manifest gcc.manifest
869 %defattr(-,root,root)
870 %{?cross:
871 %{_bindir}/*
872 %{libsubdir}/*
873 }
874 %{!?cross:
875 %{_bindir}/gcc
876 %{_bindir}/cc
877 %{_bindir}/gcov
878 %{_bindir}/gcov-tool
879 %{_bindir}/gcc-ar
880 %{_bindir}/gcc-nm
881 %{_bindir}/gcc-ranlib
882 %{_bindir}/%{target_arch}-gcc
883 %{_bindir}/%{target_arch}-gcc-%{version}
884 %{_bindir}/%{target_arch}-gcc-ar
885 %{_bindir}/%{target_arch}-gcc-nm
886 %{_bindir}/%{target_arch}-gcc-ranlib
887 %{libsubdir}/collect2
888 %{libsubdir}/lto1
889 %{libsubdir}/lto-wrapper
890 %{libsubdir}/liblto_plugin.so*
891 %{_prefix}/lib/bfd-plugins/liblto_plugin.so
892 %{libsubdir}/include-fixed/*
893 %{libsubdir}/include/*.h
894 %{libsubdir}/*.a
895 %{libsubdir}/*.so
896 %{libsubdir}/*.o
897 %{libsubdir}/*.spec
898 %{libdir}/*.so
899 %{libdir}/*.a
900 %ifarch %cilkrts_arch
901 %{libsubdir}/include/cilk/*
902 %endif
903 %{libsubdir}/include/sanitizer/*
904 %ifarch %asan_arch
905 %exclude %{libdir}/libasan.so
906 %endif
907 %ifarch %lsan_arch
908 %exclude %{libdir}/liblsan.so
909 %endif
910 %ifarch %tsan_arch
911 %exclude %{libdir}/libtsan.so
912 %endif
913 %ifarch %esan_arch
914 %exclude %{libdir}/libesan.so
915 %endif
916
917 %files c++
918 %defattr(-,root,root)
919 %{libsubdir}/cc1plus
920 %{_bindir}/g++
921 %{_bindir}/c++
922 %{_bindir}/%{target_arch}-g++
923 %{_bindir}/%{target_arch}-c++
924
925 %files -n libstdc++
926 %manifest gcc.manifest
927 %license COPYING3 COPYING.RUNTIME
928 %defattr(-,root,root)
929 %{libdir}/libstdc++.so.*
930
931 %files -n libstdc++-devel
932 %defattr(-,root,root)
933 %{libdir}/libstdc++.so
934 %{libdir}/libstdc++.a
935 %{libdir}/libsupc++.a
936 %{libsubdir}/include/c++/*
937 %{_datadir}/gcc-%{version}/python/libstdcxx/*
938
939 %files -n libgcc
940 %manifest gcc.manifest
941 %license COPYING3 COPYING.RUNTIME
942 %defattr(-,root,root)
943 %{libdir}/libgcc_s.so.*
944
945 %files -n libgomp
946 %manifest gcc.manifest
947 %license COPYING3 COPYING.RUNTIME
948 %defattr(-,root,root)
949 %{libdir}/libgomp.so.*
950
951 %files -n libcc1
952 %manifest gcc.manifest
953 %defattr(-,root,root)
954 %{libdir}/libcc1.so.*
955
956 %ifarch %asan_arch
957 %files -n libasan
958 %manifest gcc.manifest
959 %license libsanitizer/LICENSE.TXT
960 %defattr(-,root,root)
961 %{libdir}/libasan.so*
962 %endif
963
964 %ifarch %lsan_arch
965 %files -n liblsan
966 %manifest gcc.manifest
967 %license libsanitizer/LICENSE.TXT
968 %defattr(-,root,root)
969 %{libdir}/liblsan.so*
970 %endif
971
972 %ifarch %tsan_arch
973 %files -n libtsan
974 %manifest gcc.manifest
975 %license libsanitizer/LICENSE.TXT
976 %defattr(-,root,root)
977 %{libdir}/libtsan.so*
978 %endif
979
980 %ifarch %esan_arch
981 %files -n libesan
982 %manifest gcc.manifest
983 %license libsanitizer/LICENSE.TXT
984 %defattr(-,root,root)
985 %{libdir}/libesan.so*
986 %endif
987
988 %ifarch %atomic_arch
989 %files -n libatomic
990 %manifest gcc.manifest
991 %license COPYING3 COPYING.RUNTIME
992 %defattr(-,root,root)
993 %{libdir}/libatomic.so.*
994 %endif
995
996 %ifarch %itm_arch
997 %files -n libitm
998 %manifest gcc.manifest
999 %license COPYING3 COPYING.RUNTIME
1000 %defattr(-,root,root)
1001 %{libdir}/libitm.so.*
1002 %endif
1003
1004 %ifarch %cilkrts_arch
1005 %files -n libcilkrts
1006 %manifest gcc.manifest
1007 %defattr(-,root,root)
1008 %{libdir}/libcilkrts.so.*
1009 %endif
1010
1011 %ifarch %ubsan_arch
1012 %files -n libubsan
1013 %manifest gcc.manifest
1014 %license libsanitizer/LICENSE.TXT
1015 %defattr(-,root,root)
1016 %{libdir}/libubsan.so.*
1017 %endif
1018
1019 %files fortran
1020 %defattr(-,root,root)
1021 %dir %{libsubdir}/finclude
1022 %{_bindir}/gfortran
1023 %{_bindir}/%{target_arch}-gfortran
1024 %{libsubdir}/f951
1025 %{libsubdir}/finclude/*
1026 %{libdir}/libgfortran.a
1027 %{libdir}/libgfortran.so
1028 %{libsubdir}/libgfortran.spec
1029 %{libsubdir}/libcaf_single.a
1030 %ifarch %quadmath_arch
1031 %{libdir}/libquadmath.a
1032 %{libdir}/libquadmath.so
1033 %endif
1034
1035 %files -n libgfortran
1036 %defattr(-,root,root)
1037 %{libdir}/libgfortran.so.*
1038
1039 %ifarch %quadmath_arch
1040 %files -n libquadmath
1041 %manifest gcc.manifest
1042 %license COPYING.LIB
1043 %defattr(-,root,root)
1044 %{libdir}/libquadmath.so.*
1045 %endif
1046
1047 %files -n cpp
1048 %defattr(-,root,root)
1049 %{_bindir}/cpp
1050 %{libsubdir}/cc1
1051 /lib/cpp
1052
1053 %files plugin-devel
1054 %defattr(-,root,root)
1055 %{libsubdir}/plugin/*
1056
1057 %{?gcc_run_tests:
1058 %files testresults
1059 %defattr(-,root,root)
1060 %doc testresults/test_summary.txt
1061 %doc testresults/*.sum
1062 %doc testresults/*.log
1063 }
1064 %ifarch x86_64
1065 %files -n gcc-32bit
1066 %defattr(-,root,root)
1067 %{libsubdir}/32/crt*
1068 %{libsubdir}/32/*.a
1069 %{libsubdir}/32/*.so
1070 %{libsubdir}/32/*.o
1071 %{libsubdir}/32/*.spec
1072
1073 %ifarch %asan_arch
1074 %files -n libasan-32bit
1075 %manifest gcc.manifest
1076 %license libsanitizer/LICENSE.TXT
1077 %defattr(-,root,root)
1078 %{libsubdir}/32/libasan.so.*
1079 %endif
1080
1081 %ifarch %lsan_arch
1082 %files -n liblsan-32bit
1083 %manifest gcc.manifest
1084 %license libsanitizer/LICENSE.TXT
1085 %defattr(-,root,root)
1086 %{libsubdir}/32/liblsan.so.*
1087 %endif
1088
1089 %ifarch %atomic_arch
1090 %files -n libatomic-32bit
1091 %manifest gcc.manifest
1092 %license COPYING3 COPYING.RUNTIME
1093 %defattr(-,root,root)
1094 %{libsubdir}/32/libatomic.so.*
1095 %endif
1096
1097 %ifarch %cilkrts_arch
1098 %files -n libcilkrts-32bit
1099 %defattr(-,root,root)
1100 %{libsubdir}/32/libcilkrts.so.*
1101 %endif
1102
1103 %files -n libgcc-32bit
1104 %manifest gcc.manifest
1105 %license COPYING3 COPYING.RUNTIME
1106 %defattr(-,root,root)
1107 %{libsubdir}/32/libgcc_s.so.*
1108
1109 %files -n libgomp-32bit
1110 %manifest gcc.manifest
1111 %license COPYING3 COPYING.RUNTIME
1112 %defattr(-,root,root)
1113 %{libsubdir}/32/libgomp.so.*
1114
1115 %ifarch %itm_arch
1116 %files -n libitm-32bit
1117 %license COPYING3 COPYING.RUNTIME
1118 %defattr(-,root,root)
1119 %{libsubdir}/32/libitm.so.*
1120 %endif
1121
1122 %files -n libgfortran-32bit
1123 %defattr(-,root,root)
1124 %dir %{libsubdir}/32/finclude
1125 %{libsubdir}/32/libgfortran.so.*
1126 %{libsubdir}/32/finclude/*
1127
1128 %ifarch %quadmath_arch
1129 %files -n libquadmath-32bit
1130 %license COPYING.LIB
1131 %defattr(-,root,root)
1132 %{libsubdir}/32/libquadmath.so.*
1133 %endif
1134
1135 %ifarch %ubsan_arch
1136 %files -n libubsan-32bit
1137 %manifest gcc.manifest
1138 %license libsanitizer/LICENSE.TXT
1139 %defattr(-,root,root)
1140 %{libsubdir}/32/libubsan.so.*
1141 %endif
1142
1143 %files -n libstdc++-32bit
1144 %manifest gcc.manifest
1145 %license COPYING3 COPYING.RUNTIME
1146 %defattr(-,root,root)
1147 %{libsubdir}/32/libstdc++.so.*
1148 %exclude %{libsubdir}/32/libstdc++.so.*-gdb.py
1149
1150 %files -n libstdc++-devel-32bit
1151 %defattr(-,root,root)
1152 %{libsubdir}/32/libstdc++.so.*-gdb.py
1153 %endif
1154
1155 %files -n sanitizer-sources
1156 %defattr(-,root,root,-)
1157 /src/libsanitizer.tar.bz
1158
1159 }
1160
1161 %changelog