5 # spec file for package gcc6
7 # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
8 # Copyright (c) 2015 Tizen
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.
19 # Please submit bugfixes or comments via http://bugs.tizen.org/
21 # we use %%{?macro: ... } as it is more compact
23 %define gcc_run_tests 1
26 %define quadmath_arch %ix86 x86_64 ia64
27 %define tsan_arch x86_64 aarch64
28 %define asan_arch x86_64 %ix86 ppc ppc64 %sparc %arm aarch64
29 %define itm_arch x86_64 %ix86 %arm ppc ppc64 ppc64le s390 s390x %sparc aarch64
30 %define atomic_arch x86_64 %ix86 %arm aarch64 ppc ppc64 ppc64le s390 s390x %sparc m68k
31 %define lsan_arch x86_64 %ix86 armv7l aarch64
32 %define ubsan_arch x86_64 %ix86 ppc ppc64 %arm aarch64
33 %define cilkrts_arch x86_64 %ix86
48 %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
50 %define target_cpu %{?cross}%{!?cross:%{ARCH}}
51 %define target_abi %{?cross:%{?armv7l:eabi}}%{!?cross:%{?ABI}}
53 %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi}
54 %define libdir %{!?cross:%{_libdir}}%{?cross:%{_prefix}/lib%{?aarch64:64}}
55 %define libsubdir %{libdir}/gcc/%{target_arch}/%{version}
57 %define asan_force_options -fsanitize-recover=address -fsanitize=address -fno-omit-frame-pointer -Wp,-U_FORTIFY_SOURCE
58 %define ubsan_force_options -fsanitize=undefined,bounds-strict,float-divide-by-zero,float-cast-overflow
59 %define lsan_force_options -fsanitize=leak -fno-omit-frame-pointer -Wp,-U_FORTIFY_SOURCE
61 %define asan_runtime_options halt_on_error=false:start_deactivated=true:print_cmdline=true:quarantine_size_mb=1:detect_leaks=0:log_path=/tmp/asan.log:log_exe_name=1
62 %define ubsan_runtime_options print_cmdline=true:log_path=/tmp/ubsan.log
63 %define lsan_runtime_options print_cmdline=true:detect_leaks=1:log_path=/tmp/lsan.log:log_exe_name=1:fast_unwind_on_malloc=false:malloc_context_size=5:suppressions=/lsan.supp:print_suppressions=false
65 Name: gcc%{?cross:-%{cross}}
66 # With generated files in src we could drop the following
69 BuildRequires: gettext-devel
70 BuildRequires: makeinfo
71 ## until here, but at least renaming and patching info files breaks this
72 BuildRequires: gcc-c++
73 BuildRequires: zlib-devel
75 BuildRequires: glibc-devel-32bit
78 %{?cross:BuildRequires: binutils-%{cross}}
79 # here we use %%if because OBS spec parser cannot expand
80 # %%{?macro:...} correctly
81 %if 0%{?gcc_run_tests}
82 BuildRequires: dejagnu
86 URL: http://gcc.gnu.org/
89 Source: gcc-%{version}.tar.bz2
90 Source10: gmp-6.1.1.tar.bz2
91 Source11: mpfr-3.1.5.tar.bz2
92 Source12: mpc-1.0.3.tar.gz
93 Source13: isl-0.17.1.tar.bz2
94 Source15: gcc-force-options
95 Source16: gcc-unforce-options
96 Source17: ASAN_OPTIONS
97 Source18: asan_symbolize.py
98 Source19: LSAN_OPTIONS
99 Source20: gcc.manifest
100 Source21: UBSAN_OPTIONS
101 Source22: macros.ubsan
102 Source23: extract-ubsan-logs
104 Group: Development/Building
105 Summary: The GNU C Compiler and Support Files
107 %{?cross:ExcludeArch: %{cross}}
109 Core package for the GNU Compiler Collection, including the C language
113 Summary: The GNU C++ Compiler
115 Group: Development/Languages
117 This package contains the GNU compiler for C++.
119 %package -n libstdc++
120 Summary: The standard C++ shared library
121 License: GPL-3.0-with-GCC-exception
122 Group: Development/Building
123 %description -n libstdc++
124 The standard C++ library, needed for dynamically linked C++ programs.
125 %post -n libstdc++ -p /sbin/ldconfig
126 %postun -n libstdc++ -p /sbin/ldconfig
128 %package -n libstdc++-devel
129 Summary: Include Files and Libraries mandatory for Development
130 License: GPL-3.0-with-GCC-exception
131 Group: Development/Building
132 %description -n libstdc++-devel
133 This package contains all the headers and libraries of the standard C++
134 library. It is needed for compiling C++ code.
137 Summary: C compiler runtime library
138 License: GPL-3.0-with-GCC-exception
139 Group: Development/Building
140 %description -n libgcc
141 Libgcc is needed for dynamically linked C programs.
142 %post -n libgcc -p /sbin/ldconfig
143 %postun -n libgcc -p /sbin/ldconfig
146 Summary: The GNU compiler collection OpenMP runtime library
147 License: GPL-3.0-with-GCC-exception
148 Group: Development/Building
149 %description -n libgomp
150 This is the OpenMP runtime library needed by OpenMP enabled programs
151 that were built with the -fopenmp compiler option and by programs that
152 were auto-parallelized via the -ftree-parallelize-loops compiler
154 %post -n libgomp -p /sbin/ldconfig
155 %postun -n libgomp -p /sbin/ldconfig
158 Summary: GNU Objective C Compiler
160 Group: Development/Languages
162 This package contains the GNU Objective C compiler. Objective C is an
163 object oriented language, created by Next Inc. and used in their
164 Nextstep OS. The source code is available in the gcc package.
167 Summary: Library for the GNU Objective C Compiler
168 License: GPL-3.0-with-GCC-exception
169 Group: Development/Building
170 %description -n libobjc
171 The library for the GNU Objective C compiler.
172 %post -n libobjc -p /sbin/ldconfig
173 %postun -n libobjc -p /sbin/ldconfig
176 Summary: GNU C Compiler plugin for GDB
177 License: GPL-3.0-with-GCC-exception
178 Group: Development/Building
179 %description -n libcc1
180 The GCC plugin for GDB
181 %post -n libcc1 -p /sbin/ldconfig
182 %postun -n libcc1 -p /sbin/ldconfig
185 Summary: GNU Objective C++ Compiler
187 Group: Development/Languages
189 This package contains the GNU Objective C++ compiler. Objective C++ is an
190 object oriented language, created by Next Inc. and used in their
191 Nextstep OS. The source code is available in the gcc package.
194 Summary: The GCC Preprocessor
196 Group: Development/Languages
198 This Package contains just the preprocessor that is used by the X11
202 Summary: GNU Ada95 Compiler Based on GCC (GNAT)
204 Group: Development/Languages
206 This package contains an Ada95 compiler and associated development
207 tools based on the GNU GCC technology. Ada95 is the object oriented
208 successor of the Ada83 language. To build this package from source you
209 must have installed a binary version to bootstrap the compiler.
212 Summary: GNU Ada Runtime Libraries
213 License: GPL-3.0-with-GCC-exception
214 Group: Development/Languages
215 %description -n libada
216 This package contains the shared libraries required to run programs
217 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
218 shared libraries. It also contains the shared libraries for the
219 Implementation of the Ada Semantic Interface Specification (ASIS), the
220 implementation of Distributed Systems Programming (GLADE) and the Posix
221 1003.5 Binding (Florist).
222 %post -n libada -p /sbin/ldconfig
223 %postun -n libada -p /sbin/ldconfig
226 Summary: The GNU Fortran Compiler and Support Files
228 Group: Development/Languages
230 This is the Fortran compiler of the GNU Compiler Collection (GCC).
232 %package -n libgfortran
233 Summary: The GNU Fortran Compiler Runtime Library
234 License: GPL-3.0-with-GCC-exception
235 Group: Development/Languages
236 %description -n libgfortran
237 The runtime library needed to run programs compiled with the Fortran compiler
238 of the GNU Compiler Collection (GCC).
239 %post -n libgfortran -p /sbin/ldconfig
240 %postun -n libgfortran -p /sbin/ldconfig
242 %package -n libquadmath
243 Summary: The GNU Fortran Compiler Quadmath Runtime Library
245 Group: Development/Languages
246 %description -n libquadmath
247 The runtime library needed to run programs compiled with the Fortran compiler
248 of the GNU Compiler Collection (GCC) and quadruple precision floating point
250 %post -n libquadmath -p /sbin/ldconfig
251 %postun -n libquadmath -p /sbin/ldconfig
254 Summary: The GNU Compiler Transactional Memory Runtime Library
255 License: GPL-3.0-with-GCC-exception
256 Group: Development/Languages
257 %description -n libitm
258 The runtime library needed to run programs compiled with the
259 -fgnu-tm option of the GNU Compiler Collection (GCC).
260 %post -n libitm -p /sbin/ldconfig
261 %postun -n libitm -p /sbin/ldconfig
264 Summary: The GNU Compiler Address Sanitizer Runtime Library
266 Group: Development/Languages
267 %description -n libasan
268 The runtime library needed to run programs compiled with the
269 -fsanitize=address option of the GNU Compiler Collection (GCC).
270 %post -n libasan -p /sbin/ldconfig
271 %postun -n libasan -p /sbin/ldconfig
274 Summary: The GNU Compiler Thread Sanitizer Runtime Library
276 Group: Development/Languages
277 %description -n libtsan
278 The runtime library needed to run programs compiled with the
279 -fsanitize=thread option of the GNU Compiler Collection (GCC).
280 %post -n libtsan -p /sbin/ldconfig
281 %postun -n libtsan -p /sbin/ldconfig
283 %package -n libatomic
284 Summary: The GNU Compiler Atomic Operations Runtime Library
285 License: GPL-3.0-with-GCC-exception
286 Group: Development/Languages
287 %description -n libatomic
288 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
289 %post -n libatomic -p /sbin/ldconfig
290 %postun -n libatomic -p /sbin/ldconfig
292 %package -n libcilkrts
293 Summary: The GNU Compiler Cilk+ Runtime Library
295 Group: Development/Languages
296 %description -n libcilkrts
297 The runtime library needed to run programs compiled with the
298 -fcilkplus option of the GNU Compiler Collection (GCC).
299 %post -n libcilkrts -p /sbin/ldconfig
300 %postun -n libcilkrts -p /sbin/ldconfig
303 Summary: The GNU Compiler Leak Sanitizer Runtime Library
305 Group: Development/Languages
306 %description -n liblsan
307 The runtime library needed to run programs compiled with the
308 -fsanitize=leak option of the GNU Compiler Collection (GCC).
309 %post -n liblsan -p /sbin/ldconfig
310 %postun -n liblsan -p /sbin/ldconfig
313 Summary: The GNU Compiler Undefined Sanitizer Runtime Library
315 Group: Development/Languages
316 %description -n libubsan
317 The runtime library needed to run programs compiled with the
318 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
319 %post -n libubsan -p /sbin/ldconfig
320 %postun -n libubsan -p /sbin/ldconfig
323 Summary: The GNU Compiler Vtable Verifier Runtime Library
325 Group: Development/Languages
326 %description -n libvtv
327 The runtime library needed to run programs compiled with the
328 -fvtable-verify option of the GNU Compiler Collection (GCC).
329 %post -n libvtv -p /sbin/ldconfig
330 %postun -n libvtv -p /sbin/ldconfig
333 Summary: Java Runtime Library for gcc
334 License: GPL-2.0-with-classpath-exception
335 Group: Development/Building
336 %description -n libgcj
337 This library is needed if you want to use the GNU Java compiler, gcj.
338 Source code for this package is in gcc.
339 %post -n libgcj -p /sbin/ldconfig
340 %postun -n libgcj -p /sbin/ldconfig
343 Summary: The GNU Java Compiler
345 Group: Development/Languages
347 The Java compiler from the GCC-tools-suite.
349 %package -n libgcj_bc
350 Summary: Fake library for BC-ABI compatibility.
351 License: GPL-2.0-with-classpath-exception
352 Group: Development/Languages
353 %description -n libgcj_bc
354 A fake library that is used at link time only. It ensures that
355 binaries built with the BC-ABI link against a constant SONAME.
356 This way, BC-ABI binaries continue to work if the SONAME underlying
359 %package -n libgcj-jar
360 Summary: Java runtime library (jar files).
361 License: GPL-2.0-with-classpath-exception
362 Group: Development/Languages
363 %description -n libgcj-jar
364 These are the jar files that go along with the gcj front end to gcc.
366 %package -n libgcj-devel
367 Summary: Include Files and Libraries mandatory for Development.
368 License: GPL-2.0-with-classpath-exception
369 Group: Development/Languages
370 %description -n libgcj-devel
371 This package contains all necessary include files and libraries needed
372 to develop applications that require these.
375 Summary: Java Bytecode Interpreter for gcc
376 License: GPL-2.0-with-classpath-exception
377 Group: Development/Languages
378 %description -n gcc-gij
379 This package contains the java bytecode interpreter gij and related tools.
382 Summary: Foreign Function Interface library
383 License: BSD-3-Clause
384 Group: Development/Building
385 %description -n libffi
386 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.
387 %post -n libffi -p /sbin/ldconfig
388 %postun -n libffi -p /sbin/ldconfig
390 %package -n libffi-devel
391 Summary: Foreign Function Interface library development files
392 License: BSD 3-Clause
393 Group: Development/Building
394 %description -n libffi-devel
395 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.
398 Summary: GNU Go Compiler
400 Group: Development/Languages
402 This package contains a Go compiler and associated development
403 files based on the GNU GCC technology.
406 Summary: GNU Go compiler runtime library
407 License: BSD-3-Clause
408 Group: Development/Languages
409 %description -n libgo
410 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.
411 %post -n libgo -p /sbin/ldconfig
412 %postun -n libgo -p /sbin/ldconfig
415 Summary: Testsuite results
416 License: SUSE-Public-Domain
417 Group: Development/Languages
418 %description testresults
419 Results from running the gcc and target library testsuites.
421 %package -n gcc-32bit
422 Summary: The GNU C Compiler 32bit support
423 Group: Development/Building
424 %description -n gcc-32bit
425 This package contains 32bit support for the GNU Compiler Collection.
427 %package -n libstdc++-devel-32bit
428 Summary: Include Files and Libraries mandatory for Development
429 License: GPL-3.0-with-GCC-exception
430 Group: Development/Building
431 %description -n libstdc++-devel-32bit
432 This package contains all the headers and libraries of the standard C++
433 library. It is needed for compiling C++ code.
435 %package -n libgcc-32bit
436 Summary: C compiler runtime library
437 License: GPL-3.0-with-GCC-exception
438 Group: Development/Building
439 %description -n libgcc-32bit
440 Libgcc is needed for dynamically linked C programs.
441 %post -n libgcc-32bit -p /sbin/ldconfig
442 %postun -n libgcc-32bit -p /sbin/ldconfig
444 %package -n libgomp-32bit
445 Summary: The GNU compiler collection OpenMP runtime library
446 License: GPL-3.0-with-GCC-exception
447 Group: Development/Building
448 %description -n libgomp-32bit
449 This is the OpenMP runtime library needed by OpenMP enabled programs
450 that were built with the -fopenmp compiler option and by programs that
451 were auto-parallelized via the -ftree-parallelize-loops compiler
453 %post -n libgomp-32bit -p /sbin/ldconfig
454 %postun -n libgomp-32bit -p /sbin/ldconfig
456 %package -n libstdc++-32bit
457 Summary: The standard C++ shared library
458 License: GPL-3.0-with-GCC-exception
459 Group: Development/Building
460 %description -n libstdc++-32bit
461 The standard C++ library, needed for dynamically linked C++ programs.
462 %post -n libstdc++-32bit -p /sbin/ldconfig
463 %postun -n libstdc++-32bit -p /sbin/ldconfig
466 Summary: GNU Objective C Compiler
468 Group: Development/Languages
469 %description objc-32bit
470 This package contains the GNU Objective C compiler. Objective C is an
471 object oriented language, created by Next Inc. and used in their
472 Nextstep OS. The source code is available in the gcc package.
474 %package -n libobjc-32bit
475 Summary: Library for the GNU Objective C Compiler
476 License: GPL-3.0-with-GCC-exception
477 Group: Development/Building
478 %description -n libobjc-32bit
479 The library for the GNU Objective C compiler.
480 %post -n libobjc-32bit -p /sbin/ldconfig
481 %postun -n libobjc-32bit -p /sbin/ldconfig
484 Summary: GNU Ada95 Compiler Based on GCC (GNAT)
486 Group: Development/Languages
487 %description ada-32bit
488 This package contains an Ada95 compiler and associated development
489 tools based on the GNU GCC technology. Ada95 is the object oriented
490 successor of the Ada83 language. To build this package from source you
491 must have installed a binary version to bootstrap the compiler.
493 %package -n libada-32bit
494 Summary: GNU Ada Runtime Libraries
495 License: GPL-3.0-with-GCC-exception
496 Group: Development/Languages
497 %description -n libada-32bit
498 This package contains the shared libraries required to run programs
499 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
500 shared libraries. It also contains the shared libraries for the
501 Implementation of the Ada Semantic Interface Specification (ASIS), the
502 implementation of Distributed Systems Programming (GLADE) and the Posix
503 1003.5 Binding (Florist).
504 %post -n libada-32bit -p /sbin/ldconfig
505 %postun -n libada-32bit -p /sbin/ldconfig
507 %package fortran-32bit
508 Summary: The GNU Fortran Compiler and Support Files
510 Group: Development/Languages
511 %description fortran-32bit
512 This is the Fortran compiler of the GNU Compiler Collection (GCC).
514 %package -n libgfortran-32bit
515 Summary: The GNU Fortran Compiler Runtime Library
516 License: GPL-3.0-with-GCC-exception
517 Group: Development/Languages
518 %description -n libgfortran-32bit
519 The runtime library needed to run programs compiled with the Fortran compiler
520 of the GNU Compiler Collection (GCC).
521 %post -n libgfortran-32bit -p /sbin/ldconfig
522 %postun -n libgfortran-32bit -p /sbin/ldconfig
524 %package -n libquadmath-32bit
525 Summary: The GNU Fortran Compiler Quadmath Runtime Library
527 Group: Development/Languages
528 %description -n libquadmath-32bit
529 The runtime library needed to run programs compiled with the Fortran compiler
530 of the GNU Compiler Collection (GCC) and quadruple precision floating point
532 %post -n libquadmath-32bit -p /sbin/ldconfig
533 %postun -n libquadmath-32bit -p /sbin/ldconfig
535 %package -n libitm-32bit
536 Summary: The GNU Compiler Transactional Memory Runtime Library
537 License: GPL-3.0-with-GCC-exception
538 Group: Development/Languages
539 %description -n libitm-32bit
540 The runtime library needed to run programs compiled with the
541 -fgnu-tm option of the GNU Compiler Collection (GCC).
542 %post -n libitm-32bit -p /sbin/ldconfig
543 %postun -n libitm-32bit -p /sbin/ldconfig
545 %package -n libasan-32bit
546 Summary: The GNU Compiler Address Sanitizer Runtime Library
548 Group: Development/Languages
549 %description -n libasan-32bit
550 The runtime library needed to run programs compiled with the
551 -fsanitize=address option of the GNU Compiler Collection (GCC).
552 %post -n libasan-32bit -p /sbin/ldconfig
553 %postun -n libasan-32bit -p /sbin/ldconfig
555 %package -n liblsan-32bit
556 Summary: The GNU Compiler Address Sanitizer Runtime Library
558 Group: Development/Languages
559 %description -n liblsan-32bit
560 The runtime library needed to run programs compiled with the
561 -fsanitize=leak option of the GNU Compiler Collection (GCC).
562 %post -n liblsan-32bit -p /sbin/ldconfig
563 %postun -n liblsan-32bit -p /sbin/ldconfig
565 %package -n libtsan-32bit
566 Summary: The GNU Compiler Thread Sanitizer Runtime Library
568 Group: Development/Languages
569 %description -n libtsan-32bit
570 The runtime library needed to run programs compiled with the
571 -fsanitize=thread option of the GNU Compiler Collection (GCC).
572 %post -n libtsan-32bit -p /sbin/ldconfig
573 %postun -n libtsan-32bit -p /sbin/ldconfig
575 %package -n libatomic-32bit
576 Summary: The GNU Compiler Atomic Operations Runtime Library
577 License: GPL-3.0-with-GCC-exception
578 Group: Development/Languages
579 %description -n libatomic-32bit
580 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
581 %post -n libatomic-32bit -p /sbin/ldconfig
582 %postun -n libatomic-32bit -p /sbin/ldconfig
584 %package -n libcilkrts-32bit
585 Summary: The GNU Compiler Cilk+ Runtime Library
587 Group: Development/Languages
588 %description -n libcilkrts-32bit
589 The runtime library needed to run programs compiled with the
590 -fcilkplus option of the GNU Compiler Collection (GCC).
591 %post -n libcilkrts-32bit -p /sbin/ldconfig
592 %postun -n libcilkrts-32bit -p /sbin/ldconfig
594 %package -n libubsan-32bit
595 Summary: The GNU Compiler Undefined Sanitizer Runtime Library
597 Group: Development/Languages
598 %description -n libubsan-32bit
599 The runtime library needed to run programs compiled with the
600 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
601 %post -n libubsan-32bit -p /sbin/ldconfig
602 %postun -n libubsan-32bit -p /sbin/ldconfig
604 %package -n libvtv-32bit
605 Summary: The GNU Compiler Vtable Verifier Runtime Library
607 Group: Development/Languages
608 %description -n libvtv-32bit
609 The runtime library needed to run programs compiled with the
610 -fvtable-verify option of the GNU Compiler Collection (GCC).
611 %post -n libvtv-32bit -p /sbin/ldconfig
612 %postun -n libvtv-32bit -p /sbin/ldconfig
614 %package -n libffi-32bit
615 Summary: Foreign Function Interface library
616 License: BSD-3-Clause
617 Group: Development/Building
618 %description -n libffi-32bit
619 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.
620 %post -n libffi-32bit -p /sbin/ldconfig
621 %postun -n libffi-32bit -p /sbin/ldconfig
623 %package -n libffi-devel-32bit
624 Summary: Foreign Function Interface library development files
625 License: BSD 3-Clause
626 Group: Development/Building
627 %description -n libffi-devel-32bit
628 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.
631 Summary: GNU Go Compiler
633 Group: Development/Languages
634 %description go-32bit
635 This package contains a Go compiler and associated development
636 files based on the GNU GCC technology.
638 %package -n libgo-32bit
639 Summary: GNU Go compiler runtime library
640 License: BSD-3-Clause
641 Group: Development/Languages
642 %description -n libgo-32bit
643 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.
644 %post -n libgo-32bit -p /sbin/ldconfig
645 %postun -n libgo-32bit -p /sbin/ldconfig
647 %package -n asan-force-options
648 Summary: Scripts to enable automatic package sanitization
649 Group: System Environment
653 %description -n asan-force-options
654 Scripts for ASan instrumentation
656 %post -n asan-force-options
657 # Change mode to allow all users to run gcc-force/unforce-options
659 [ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
660 /usr/bin/gcc-force-options %asan_force_options -fno-common
661 # Add ASan-related macros
662 cat >> /usr/lib/rpm/tizen_macros << EOF
664 %%asan_force_options %{asan_force_options}
665 %%gcc_unforce_options /usr/bin/gcc-unforce-options
666 %%gcc_force_options /usr/bin/gcc-force-options
667 %%gcc_force_default_options %%gcc_force_options %%asan_force_options -fno-common
669 %%gcc_unforce_options \\
670 %%gcc_force_options %%asan_force_options -fcommon
673 %preun -n asan-force-options
674 # Restore read-only mode
676 [ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
677 /usr/bin/gcc-unforce-options
679 %package -n ubsan-force-options
680 Summary: Scripts to enable automatic package sanitization
681 Group: System Environment
685 %description -n ubsan-force-options
686 Scripts for UBSan instrumentation
688 %post -n ubsan-force-options
689 # Change mode to allow all users to run gcc-force/unforce-options
691 [ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
692 /usr/bin/gcc-force-options %ubsan_force_options
693 # Add UBSan-related macros
694 cat >> /usr/lib/rpm/tizen_macros << EOF
696 %%ubsan_force_options %{ubsan_force_options}
697 %%gcc_unforce_options /usr/bin/gcc-unforce-options
698 %%gcc_force_options /usr/bin/gcc-force-options
699 %%gcc_force_default_options %%gcc_force_options %%ubsan_force_options
702 %preun -n ubsan-force-options
703 # Restore read-only mode
705 [ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
706 /usr/bin/gcc-unforce-options
708 %package -n ubsan-build-env
709 Summary: UBSan build environment
710 Group: System Environment
712 Requires: libubsan rpm
714 %description -n ubsan-build-env
715 UBSan build environment support files and scripts
717 %post -n ubsan-build-env
718 cat %{_rpmconfigdir}/macros.ubsan >> %{_rpmconfigdir}/tizen_macros
720 %package -n lsan-force-options
721 Summary: Scripts to enable automatic package sanitization
722 Group: System Environment
726 %description -n lsan-force-options
727 Scripts for LSan instrumentation
729 %post -n lsan-force-options
730 # Change mode to allow all users to run gcc-force/unforce-options
732 [ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
733 /usr/bin/gcc-force-options %lsan_force_options
734 # Add LSan-related macros
735 cat >> /usr/lib/rpm/tizen_macros << EOF
737 %%lsan_force_options %{lsan_force_options}
738 %%gcc_unforce_options /usr/bin/gcc-unforce-options
739 %%gcc_force_options /usr/bin/gcc-force-options
740 %%gcc_force_default_options %%gcc_force_options %%lsan_force_options
743 %preun -n lsan-force-options
744 # Restore read-only mode
746 [ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
747 /usr/bin/gcc-unforce-options
748 [ -d /emul/ ] && chmod a-w /emul/usr/bin/
750 %package -n asan-build-env
751 Summary: Asan build environment
752 Group: Development/Libraries
755 %description -n asan-build-env
756 Asan build environment
758 %post -n asan-build-env
759 # Add /usr/lib/libasan.so to /etc/ld.so.preload
760 [ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
761 echo "libasan.so" > /etc/ld.so.preload
762 [ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
763 [ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
765 %preun -n asan-build-env
766 # Restore /etc/ld.so.preload
767 [ -f /etc/ld.so.preload.orig ] && mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
769 %package -n lsan-runtime-env
770 Summary: LSan runtime environment
771 Group: Development/Libraries
773 Requires(post): smack
775 %description -n lsan-runtime-env
776 LSan runtime environment
778 %post -n lsan-runtime-env
779 # Add /usr/lib64/liblsan.so to /etc/ld.so.preload
780 [ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
781 echo "%{libdir}/liblsan.so" > /etc/ld.so.preload
782 [ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
783 [ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
784 echo "%{lsan_runtime_options}" > /LSAN_OPTIONS
785 chsmack -a "_" /etc/ld.so.preload /LSAN_OPTIONS /lsan.supp
787 %preun -n lsan-runtime-env
788 # Restore /etc/ld.so.preload
789 mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
791 %package -n sanitizer-devel
792 Summary: Sanitizer platform-independent tools
794 Group: Development/Tools
796 Requires: binutils python
797 Requires(post): smack
799 %description -n sanitizer-devel
800 The package contatins platform-independent tools for sanitization:
801 - asan_symbolize.py: script for offline symbolization of asan logs
803 %package -n asan-runtime-env
804 Summary: Asan runtime environment for target device
805 Group: Development/Libraries
807 %description -n asan-runtime-env
808 Asan runtime environment
810 %post -n asan-runtime-env
811 # Add /usr/lib/libasan.so to /etc/ld.so.preload
812 [ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
813 echo "%{libdir}/libasan.so" > /etc/ld.so.preload
814 [ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
815 [ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
816 echo "%{asan_runtime_options}" > /ASAN_OPTIONS
817 chsmack -a "_" /etc/ld.so.preload /ASAN_OPTIONS
819 %preun -n asan-runtime-env
820 # Restore /etc/ld.so.preload
821 [ -f /etc/ld.so.preload.orig ] && mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
823 %package -n ubsan-runtime-env
824 Summary: UBSan runtime environment for target device
825 Group: Development/Libraries
828 %description -n ubsan-runtime-env
829 UBSan runtime environment
831 %post -n ubsan-runtime-env
832 echo "%{ubsan_runtime_options}" > /UBSAN_OPTIONS
834 %package plugin-devel
835 Summary: GNU GCC Plugin development files
837 Group: Development/Languages
838 %description plugin-devel
839 This package contains GCC Plugin development files needed for compiler
842 %package -n sanitizer-sources
843 Summary: Sanitizer family tools sources
845 Group: Development/Tools
848 %description -n sanitizer-sources
849 Sanitizer family tools sources for external tools.
853 %setup -q -n gcc-%{version}
859 ln -sf mpfr-3.1.5 mpfr
863 ln -sf isl-0.17.1 isl
865 echo "" > gcc/DEV-PHASE
867 %global gcc_release `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/LINARO-VERSION`
874 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'
875 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D__USE_FORTIFY_LEVEL=0"`
877 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
878 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(sse\|fpmath\)[^ ]*//g'`
880 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ */ /g'`
884 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
885 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
887 --prefix=%{_prefix} \
888 --infodir=%{_infodir} \
889 --mandir=%{_mandir} \
891 --libexecdir=%{libdir} \
892 --enable-languages=c,c++,fortran \
893 --enable-checking=release \
895 --disable-bootstrap \
900 --with-slibdir=%{libdir} \
903 --enable-__cxa_atexit \
904 --enable-libstdcxx-allocator=new \
905 --enable-version-specific-runtime-libs \
906 --enable-linker-build-id \
907 --without-system-libunwind \
908 --enable-threads=posix \
913 --enable-libgfortran \
915 --with-arch=armv7-a \
916 --with-tune=cortex-a8 \
917 --disable-sjlj-exceptions \
920 --with-arch=armv8-a \
921 --disable-sjlj-exceptions \
924 --with-arch-32=i586 \
925 --with-tune=generic \
929 --with-arch-32=i586 \
930 --with-tune=generic \
937 --with-arch=armv7-a \
938 --with-tune=cortex-a8 \
939 --disable-sjlj-exceptions \
942 --with-arch=armv8-a \
943 --disable-sjlj-exceptions \
946 --disable-libgfortran \
947 --disable-libquadmath \
949 --disable-libatomic \
950 --disable-libstdc++-v3 \
951 --disable-libsanitizer \
954 --with-bugurl="http://bugs.tizen.org/" \
955 --with-pkgversion="Tizen/Linaro GCC %{version} %{gcc_release}" \
956 --target=%{target_arch} \
957 --host=%{host_arch} \
962 make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
965 # asan needs a whole shadow address space
966 ulimit -v unlimited || true
967 make -k check %{?_smp_mflags} || true
969 ../contrib/test_summary | tee ../testresults/test_summary.txt
975 make install DESTDIR=$RPM_BUILD_ROOT
978 cp `find . -name "*.sum"` ../testresults/
979 cp `find . -name "*.log" \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
980 chmod 644 ../testresults/*
984 rm -rf %{buildroot}/%{_datadir}/locale
986 #remove everything we don't need
987 rm -rf %{buildroot}/%{libsubdir}/install-tools
988 find %{buildroot}/ -name "*.la" -delete
991 ln -s gcc %{buildroot}%{_bindir}/cc
992 mv %{buildroot}%{libsubdir}/libstdc++.so*-gdb.py %{buildroot}%{_datadir}/gcc-%{version}/python/libstdcxx/
994 # expose plugins for ar (required for lto builds)
995 mkdir -p %{buildroot}%{_prefix}/lib/bfd-plugins
996 ln -sf %{libsubdir}/liblto_plugin.so %{buildroot}%{_prefix}/lib/bfd-plugins/liblto_plugin.so
998 # legacy preprocessor
999 mkdir -p %{buildroot}/lib
1000 ln -s %{_bindir}/cpp %{buildroot}/lib/cpp
1002 # 32-bit libgcc in multilib configuration
1004 mv %{buildroot}%{_prefix}/lib/libgcc_s.so* %{buildroot}%{libsubdir}/32/
1007 # move libraries to libdir
1008 for lib in asan atomic cilkrts gfortran gomp cc1 itm lsan quadmath stdc++ supc++ tsan ubsan
1010 [ -e %{buildroot}%{libsubdir}/lib$lib.a ] && mv %{buildroot}%{libsubdir}/lib$lib.a %{buildroot}%{libdir}/
1011 [ -e %{buildroot}%{libsubdir}/lib$lib.so ] && mv %{buildroot}%{libsubdir}/lib$lib.so* %{buildroot}%{libdir}/
1016 rm -rf %{buildroot}/%{libsubdir}/include-fixed
1017 rm -rf %{buildroot}/%{libsubdir}/include
1021 cp %{SOURCE15} %{SOURCE16} %{SOURCE18} %{buildroot}%{_prefix}/bin
1022 chmod a+x %{buildroot}%{_prefix}/bin/gcc-force-options
1023 chmod a+x %{buildroot}%{_prefix}/bin/gcc-unforce-options
1024 chmod a+x %{buildroot}%{_prefix}/bin/asan_symbolize.py
1026 cp %{SOURCE17} %{buildroot}
1027 chmod 644 %{buildroot}/ASAN_OPTIONS
1030 cp %{SOURCE19} %{SOURCE24} %{buildroot}
1031 chmod 644 %{buildroot}/LSAN_OPTIONS
1032 chmod 644 %{buildroot}/lsan.supp
1036 tar -czf libsanitizer.tar.bz libsanitizer
1037 mkdir -p %{buildroot}/src
1038 mv -v libsanitizer.tar.bz %{buildroot}/src
1040 mkdir -p %{buildroot}/%{_rpmconfigdir}/tizen/
1041 install -m 0644 %{SOURCE21} %{buildroot}/
1042 install -m 0644 %{SOURCE22} %{buildroot}/%{_rpmconfigdir}/
1043 install -m 0755 %{SOURCE23} %{buildroot}/%{_rpmconfigdir}/tizen/
1047 %manifest gcc.manifest
1048 %defattr(-,root,root)
1057 %{_bindir}/gcov-tool
1060 %{_bindir}/gcc-ranlib
1061 %{_bindir}/%{target_arch}-gcc
1062 %{_bindir}/%{target_arch}-gcc-%{version}
1063 %{_bindir}/%{target_arch}-gcc-ar
1064 %{_bindir}/%{target_arch}-gcc-nm
1065 %{_bindir}/%{target_arch}-gcc-ranlib
1066 %{libsubdir}/collect2
1068 %{libsubdir}/lto-wrapper
1069 %{libsubdir}/liblto_plugin.so*
1070 %{_prefix}/lib/bfd-plugins/liblto_plugin.so
1071 %{libsubdir}/include-fixed/*
1072 %{libsubdir}/include/*.h
1079 %ifarch %cilkrts_arch
1080 %{libsubdir}/include/cilk/*
1082 %{libsubdir}/include/sanitizer/*
1084 %exclude %{libdir}/libasan.so
1087 %exclude %{libdir}/liblsan.so
1090 %exclude %{libdir}/libtsan.so
1094 %defattr(-,root,root)
1095 %{libsubdir}/cc1plus
1098 %{_bindir}/%{target_arch}-g++
1099 %{_bindir}/%{target_arch}-c++
1102 %manifest gcc.manifest
1103 %license COPYING3 COPYING.RUNTIME
1104 %defattr(-,root,root)
1105 %{libdir}/libstdc++.so.*
1107 %files -n libstdc++-devel
1108 %defattr(-,root,root)
1109 %{libdir}/libstdc++.so
1110 %{libdir}/libstdc++.a
1111 %{libdir}/libsupc++.a
1112 %{libsubdir}/include/c++/*
1113 %{_datadir}/gcc-%{version}/python/libstdcxx/*
1116 %manifest gcc.manifest
1117 %license COPYING3 COPYING.RUNTIME
1118 %defattr(-,root,root)
1119 %{libdir}/libgcc_s.so.*
1122 %manifest gcc.manifest
1123 %license COPYING3 COPYING.RUNTIME
1124 %defattr(-,root,root)
1125 %{libdir}/libgomp.so.*
1128 %manifest gcc.manifest
1129 %defattr(-,root,root)
1130 %{libdir}/libcc1.so.*
1134 %manifest gcc.manifest
1135 %license libsanitizer/LICENSE.TXT
1136 %defattr(-,root,root)
1137 %{libdir}/libasan.so*
1142 %manifest gcc.manifest
1143 %license libsanitizer/LICENSE.TXT
1144 %defattr(-,root,root)
1145 %{libdir}/liblsan.so*
1150 %manifest gcc.manifest
1151 %license libsanitizer/LICENSE.TXT
1152 %defattr(-,root,root)
1153 %{libdir}/libtsan.so*
1156 %ifarch %atomic_arch
1158 %manifest gcc.manifest
1159 %license COPYING3 COPYING.RUNTIME
1160 %defattr(-,root,root)
1161 %{libdir}/libatomic.so.*
1166 %manifest gcc.manifest
1167 %license COPYING3 COPYING.RUNTIME
1168 %defattr(-,root,root)
1169 %{libdir}/libitm.so.*
1172 %ifarch %cilkrts_arch
1173 %files -n libcilkrts
1174 %manifest gcc.manifest
1175 %defattr(-,root,root)
1176 %{libdir}/libcilkrts.so.*
1181 %manifest gcc.manifest
1182 %license libsanitizer/LICENSE.TXT
1183 %defattr(-,root,root)
1184 %{libdir}/libubsan.so.*
1188 %defattr(-,root,root)
1189 %dir %{libsubdir}/finclude
1191 %{_bindir}/%{target_arch}-gfortran
1193 %{libsubdir}/finclude/*
1194 %{libdir}/libgfortran.a
1195 %{libdir}/libgfortran.so
1196 %{libsubdir}/libgfortran.spec
1197 %{libsubdir}/libcaf_single.a
1198 %ifarch %quadmath_arch
1199 %{libdir}/libquadmath.a
1200 %{libdir}/libquadmath.so
1203 %files -n libgfortran
1204 %defattr(-,root,root)
1205 %{libdir}/libgfortran.so.*
1207 %ifarch %quadmath_arch
1208 %files -n libquadmath
1209 %manifest gcc.manifest
1210 %license COPYING.LIB
1211 %defattr(-,root,root)
1212 %{libdir}/libquadmath.so.*
1216 %defattr(-,root,root)
1222 %defattr(-,root,root)
1223 %{libsubdir}/plugin/*
1227 %defattr(-,root,root)
1228 %doc testresults/test_summary.txt
1229 %doc testresults/*.sum
1230 %doc testresults/*.log
1234 %defattr(-,root,root)
1235 %{libsubdir}/32/crt*
1237 %{libsubdir}/32/*.so
1239 %{libsubdir}/32/*.spec
1242 %files -n libasan-32bit
1243 %manifest gcc.manifest
1244 %license libsanitizer/LICENSE.TXT
1245 %defattr(-,root,root)
1246 %{libsubdir}/32/libasan.so.*
1250 %files -n liblsan-32bit
1251 %manifest gcc.manifest
1252 %license libsanitizer/LICENSE.TXT
1253 %defattr(-,root,root)
1254 %{libsubdir}/32/liblsan.so.*
1257 %ifarch %atomic_arch
1258 %files -n libatomic-32bit
1259 %manifest gcc.manifest
1260 %license COPYING3 COPYING.RUNTIME
1261 %defattr(-,root,root)
1262 %{libsubdir}/32/libatomic.so.*
1265 %ifarch %cilkrts_arch
1266 %files -n libcilkrts-32bit
1267 %defattr(-,root,root)
1268 %{libsubdir}/32/libcilkrts.so.*
1271 %files -n libgcc-32bit
1272 %manifest gcc.manifest
1273 %license COPYING3 COPYING.RUNTIME
1274 %defattr(-,root,root)
1275 %{libsubdir}/32/libgcc_s.so.*
1277 %files -n libgomp-32bit
1278 %manifest gcc.manifest
1279 %license COPYING3 COPYING.RUNTIME
1280 %defattr(-,root,root)
1281 %{libsubdir}/32/libgomp.so.*
1284 %files -n libitm-32bit
1285 %license COPYING3 COPYING.RUNTIME
1286 %defattr(-,root,root)
1287 %{libsubdir}/32/libitm.so.*
1290 %files -n libgfortran-32bit
1291 %defattr(-,root,root)
1292 %dir %{libsubdir}/32/finclude
1293 %{libsubdir}/32/libgfortran.so.*
1294 %{libsubdir}/32/finclude/*
1296 %ifarch %quadmath_arch
1297 %files -n libquadmath-32bit
1298 %license COPYING.LIB
1299 %defattr(-,root,root)
1300 %{libsubdir}/32/libquadmath.so.*
1304 %files -n libubsan-32bit
1305 %manifest gcc.manifest
1306 %license libsanitizer/LICENSE.TXT
1307 %defattr(-,root,root)
1308 %{libsubdir}/32/libubsan.so.*
1311 %files -n libstdc++-32bit
1312 %manifest gcc.manifest
1313 %license COPYING3 COPYING.RUNTIME
1314 %defattr(-,root,root)
1315 %{libsubdir}/32/libstdc++.so.*
1316 %exclude %{libsubdir}/32/libstdc++.so.*-gdb.py
1318 %files -n libstdc++-devel-32bit
1319 %defattr(-,root,root)
1320 %{libsubdir}/32/libstdc++.so.*-gdb.py
1323 %files -n asan-force-options
1324 %defattr(-,root,root,-)
1325 %{_prefix}/bin/gcc-force-options
1326 %{_prefix}/bin/gcc-unforce-options
1328 %files -n ubsan-force-options
1329 %defattr(-,root,root,-)
1330 %{_prefix}/bin/gcc-force-options
1331 %{_prefix}/bin/gcc-unforce-options
1334 %files -n lsan-force-options
1335 %manifest gcc.manifest
1336 %defattr(-,root,root,-)
1337 %{_prefix}/bin/gcc-force-options
1338 %{_prefix}/bin/gcc-unforce-options
1341 %files -n asan-build-env
1342 %defattr(-,root,root,-)
1345 %files -n asan-runtime-env
1346 %defattr(-,root,root,-)
1349 %files -n lsan-runtime-env
1350 %defattr(-,root,root,-)
1356 %files -n ubsan-build-env
1357 %defattr(-,root,root,-)
1359 %{_rpmconfigdir}/macros.ubsan
1360 %{_rpmconfigdir}/tizen/extract-ubsan-logs
1362 %files -n ubsan-runtime-env
1363 %defattr(-,root,root,-)
1366 %files -n sanitizer-devel
1367 %defattr(-,root,root,-)
1368 %{_prefix}/bin/asan_symbolize.py
1370 %files -n sanitizer-sources
1371 %defattr(-,root,root,-)
1372 /src/libsanitizer.tar.bz