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