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