2 # spec file for package gcc6
4 # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 # Copyright (c) 2015 Tizen
7 # All modifications and additions to the file contributed by third parties
8 # remain the property of their copyright owners, unless otherwise agreed
9 # upon. The license for this file, and modifications and additions to the
10 # file, is the same license as for the pristine package itself (unless the
11 # license for the pristine package is not an Open Source License, in which
12 # case the license is the MIT License). An "Open Source License" is a
13 # license that conforms to the Open Source Definition (Version 1.9)
14 # published by the Open Source Initiative.
16 # Please submit bugfixes or comments via http://bugs.tizen.org/
18 # we use %%{?macro: ... } as it is more compact
20 %define gcc_run_tests 1
23 %define quadmath_arch %ix86 x86_64 ia64
24 %define tsan_arch x86_64 aarch64
25 %define asan_arch x86_64 %ix86 ppc ppc64 %sparc %arm aarch64
26 %define itm_arch x86_64 %ix86 %arm ppc ppc64 ppc64le s390 s390x %sparc aarch64
27 %define atomic_arch x86_64 %ix86 %arm aarch64 ppc ppc64 ppc64le s390 s390x %sparc m68k
28 %define lsan_arch x86_64 %ix86 armv7l aarch64
29 %define ubsan_arch x86_64 %ix86 ppc ppc64 %arm aarch64
30 %define cilkrts_arch x86_64 %ix86
45 %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
47 %define target_cpu %{?cross}%{!?cross:%{ARCH}}
48 %define target_abi %{?cross:%{?armv7l:eabi}}%{!?cross:%{?ABI}}
50 %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi}
51 %define libdir %{!?cross:%{_libdir}}%{?cross:%{_prefix}/lib%{?aarch64:64}}
52 %define libsubdir %{libdir}/gcc/%{target_arch}/%{version}
54 %define asan_force_options -fsanitize-recover=address -fsanitize=address -fno-omit-frame-pointer -Wp,-U_FORTIFY_SOURCE
55 %define ubsan_force_options -fsanitize=undefined,bounds-strict,float-divide-by-zero,float-cast-overflow
56 %define lsan_force_options -fsanitize=leak -fno-omit-frame-pointer -Wp,-U_FORTIFY_SOURCE
58 %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
59 %define ubsan_runtime_options print_cmdline=true:log_path=/tmp/ubsan.log
60 %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
62 Name: gcc%{?cross:-%{cross}}
63 # With generated files in src we could drop the following
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
72 BuildRequires: glibc-devel-32bit
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
83 URL: http://gcc.gnu.org/
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 Source15: gcc-force-options
92 Source16: gcc-unforce-options
93 Source17: ASAN_OPTIONS
94 Source18: asan_symbolize.py
95 Source19: LSAN_OPTIONS
96 Source20: gcc.manifest
97 Source21: UBSAN_OPTIONS
98 Source22: macros.ubsan
99 Source23: extract-ubsan-logs
101 Group: Development/Building
102 Summary: The GNU C Compiler and Support Files
104 %{?cross:ExcludeArch: %{cross}}
106 Core package for the GNU Compiler Collection, including the C language
110 Summary: The GNU C++ Compiler
112 Group: Development/Languages
114 This package contains the GNU compiler for C++.
116 %package -n libstdc++
117 Summary: The standard C++ shared library
118 License: GPL-3.0-with-GCC-exception
119 Group: Development/Building
120 %description -n libstdc++
121 The standard C++ library, needed for dynamically linked C++ programs.
122 %post -n libstdc++ -p /sbin/ldconfig
123 %postun -n libstdc++ -p /sbin/ldconfig
125 %package -n libstdc++-devel
126 Summary: Include Files and Libraries mandatory for Development
127 License: GPL-3.0-with-GCC-exception
128 Group: Development/Building
129 %description -n libstdc++-devel
130 This package contains all the headers and libraries of the standard C++
131 library. It is needed for compiling C++ code.
134 Summary: C compiler runtime library
135 License: GPL-3.0-with-GCC-exception
136 Group: Development/Building
137 %description -n libgcc
138 Libgcc is needed for dynamically linked C programs.
139 %post -n libgcc -p /sbin/ldconfig
140 %postun -n libgcc -p /sbin/ldconfig
143 Summary: The GNU compiler collection OpenMP runtime library
144 License: GPL-3.0-with-GCC-exception
145 Group: Development/Building
146 %description -n libgomp
147 This is the OpenMP runtime library needed by OpenMP enabled programs
148 that were built with the -fopenmp compiler option and by programs that
149 were auto-parallelized via the -ftree-parallelize-loops compiler
151 %post -n libgomp -p /sbin/ldconfig
152 %postun -n libgomp -p /sbin/ldconfig
155 Summary: GNU Objective C Compiler
157 Group: Development/Languages
159 This package contains the GNU Objective C compiler. Objective C is an
160 object oriented language, created by Next Inc. and used in their
161 Nextstep OS. The source code is available in the gcc package.
164 Summary: Library for the GNU Objective C Compiler
165 License: GPL-3.0-with-GCC-exception
166 Group: Development/Building
167 %description -n libobjc
168 The library for the GNU Objective C compiler.
169 %post -n libobjc -p /sbin/ldconfig
170 %postun -n libobjc -p /sbin/ldconfig
173 Summary: GNU C Compiler plugin for GDB
174 License: GPL-3.0-with-GCC-exception
175 Group: Development/Building
176 %description -n libcc1
177 The GCC plugin for GDB
178 %post -n libcc1 -p /sbin/ldconfig
179 %postun -n libcc1 -p /sbin/ldconfig
182 Summary: GNU Objective C++ Compiler
184 Group: Development/Languages
186 This package contains the GNU Objective C++ compiler. Objective C++ is an
187 object oriented language, created by Next Inc. and used in their
188 Nextstep OS. The source code is available in the gcc package.
191 Summary: The GCC Preprocessor
193 Group: Development/Languages
195 This Package contains just the preprocessor that is used by the X11
199 Summary: GNU Ada95 Compiler Based on GCC (GNAT)
201 Group: Development/Languages
203 This package contains an Ada95 compiler and associated development
204 tools based on the GNU GCC technology. Ada95 is the object oriented
205 successor of the Ada83 language. To build this package from source you
206 must have installed a binary version to bootstrap the compiler.
209 Summary: GNU Ada Runtime Libraries
210 License: GPL-3.0-with-GCC-exception
211 Group: Development/Languages
212 %description -n libada
213 This package contains the shared libraries required to run programs
214 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
215 shared libraries. It also contains the shared libraries for the
216 Implementation of the Ada Semantic Interface Specification (ASIS), the
217 implementation of Distributed Systems Programming (GLADE) and the Posix
218 1003.5 Binding (Florist).
219 %post -n libada -p /sbin/ldconfig
220 %postun -n libada -p /sbin/ldconfig
223 Summary: The GNU Fortran Compiler and Support Files
225 Group: Development/Languages
227 This is the Fortran compiler of the GNU Compiler Collection (GCC).
229 %package -n libgfortran
230 Summary: The GNU Fortran Compiler Runtime Library
231 License: GPL-3.0-with-GCC-exception
232 Group: Development/Languages
233 %description -n libgfortran
234 The runtime library needed to run programs compiled with the Fortran compiler
235 of the GNU Compiler Collection (GCC).
236 %post -n libgfortran -p /sbin/ldconfig
237 %postun -n libgfortran -p /sbin/ldconfig
239 %package -n libquadmath
240 Summary: The GNU Fortran Compiler Quadmath Runtime Library
242 Group: Development/Languages
243 %description -n libquadmath
244 The runtime library needed to run programs compiled with the Fortran compiler
245 of the GNU Compiler Collection (GCC) and quadruple precision floating point
247 %post -n libquadmath -p /sbin/ldconfig
248 %postun -n libquadmath -p /sbin/ldconfig
251 Summary: The GNU Compiler Transactional Memory Runtime Library
252 License: GPL-3.0-with-GCC-exception
253 Group: Development/Languages
254 %description -n libitm
255 The runtime library needed to run programs compiled with the
256 -fgnu-tm option of the GNU Compiler Collection (GCC).
257 %post -n libitm -p /sbin/ldconfig
258 %postun -n libitm -p /sbin/ldconfig
261 Summary: The GNU Compiler Address Sanitizer Runtime Library
263 Group: Development/Languages
264 %description -n libasan
265 The runtime library needed to run programs compiled with the
266 -fsanitize=address option of the GNU Compiler Collection (GCC).
267 %post -n libasan -p /sbin/ldconfig
268 %postun -n libasan -p /sbin/ldconfig
271 Summary: The GNU Compiler Thread Sanitizer Runtime Library
273 Group: Development/Languages
274 %description -n libtsan
275 The runtime library needed to run programs compiled with the
276 -fsanitize=thread option of the GNU Compiler Collection (GCC).
277 %post -n libtsan -p /sbin/ldconfig
278 %postun -n libtsan -p /sbin/ldconfig
280 %package -n libatomic
281 Summary: The GNU Compiler Atomic Operations Runtime Library
282 License: GPL-3.0-with-GCC-exception
283 Group: Development/Languages
284 %description -n libatomic
285 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
286 %post -n libatomic -p /sbin/ldconfig
287 %postun -n libatomic -p /sbin/ldconfig
289 %package -n libcilkrts
290 Summary: The GNU Compiler Cilk+ Runtime Library
292 Group: Development/Languages
293 %description -n libcilkrts
294 The runtime library needed to run programs compiled with the
295 -fcilkplus option of the GNU Compiler Collection (GCC).
296 %post -n libcilkrts -p /sbin/ldconfig
297 %postun -n libcilkrts -p /sbin/ldconfig
300 Summary: The GNU Compiler Leak Sanitizer Runtime Library
302 Group: Development/Languages
303 %description -n liblsan
304 The runtime library needed to run programs compiled with the
305 -fsanitize=leak option of the GNU Compiler Collection (GCC).
306 %post -n liblsan -p /sbin/ldconfig
307 %postun -n liblsan -p /sbin/ldconfig
310 Summary: The GNU Compiler Undefined Sanitizer Runtime Library
312 Group: Development/Languages
313 %description -n libubsan
314 The runtime library needed to run programs compiled with the
315 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
316 %post -n libubsan -p /sbin/ldconfig
317 %postun -n libubsan -p /sbin/ldconfig
320 Summary: The GNU Compiler Vtable Verifier Runtime Library
322 Group: Development/Languages
323 %description -n libvtv
324 The runtime library needed to run programs compiled with the
325 -fvtable-verify option of the GNU Compiler Collection (GCC).
326 %post -n libvtv -p /sbin/ldconfig
327 %postun -n libvtv -p /sbin/ldconfig
330 Summary: Java Runtime Library for gcc
331 License: GPL-2.0-with-classpath-exception
332 Group: Development/Building
333 %description -n libgcj
334 This library is needed if you want to use the GNU Java compiler, gcj.
335 Source code for this package is in gcc.
336 %post -n libgcj -p /sbin/ldconfig
337 %postun -n libgcj -p /sbin/ldconfig
340 Summary: The GNU Java Compiler
342 Group: Development/Languages
344 The Java compiler from the GCC-tools-suite.
346 %package -n libgcj_bc
347 Summary: Fake library for BC-ABI compatibility.
348 License: GPL-2.0-with-classpath-exception
349 Group: Development/Languages
350 %description -n libgcj_bc
351 A fake library that is used at link time only. It ensures that
352 binaries built with the BC-ABI link against a constant SONAME.
353 This way, BC-ABI binaries continue to work if the SONAME underlying
356 %package -n libgcj-jar
357 Summary: Java runtime library (jar files).
358 License: GPL-2.0-with-classpath-exception
359 Group: Development/Languages
360 %description -n libgcj-jar
361 These are the jar files that go along with the gcj front end to gcc.
363 %package -n libgcj-devel
364 Summary: Include Files and Libraries mandatory for Development.
365 License: GPL-2.0-with-classpath-exception
366 Group: Development/Languages
367 %description -n libgcj-devel
368 This package contains all necessary include files and libraries needed
369 to develop applications that require these.
372 Summary: Java Bytecode Interpreter for gcc
373 License: GPL-2.0-with-classpath-exception
374 Group: Development/Languages
375 %description -n gcc-gij
376 This package contains the java bytecode interpreter gij and related tools.
379 Summary: Foreign Function Interface library
380 License: BSD-3-Clause
381 Group: Development/Building
382 %description -n libffi
383 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.
384 %post -n libffi -p /sbin/ldconfig
385 %postun -n libffi -p /sbin/ldconfig
387 %package -n libffi-devel
388 Summary: Foreign Function Interface library development files
389 License: BSD 3-Clause
390 Group: Development/Building
391 %description -n libffi-devel
392 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.
395 Summary: GNU Go Compiler
397 Group: Development/Languages
399 This package contains a Go compiler and associated development
400 files based on the GNU GCC technology.
403 Summary: GNU Go compiler runtime library
404 License: BSD-3-Clause
405 Group: Development/Languages
406 %description -n libgo
407 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.
408 %post -n libgo -p /sbin/ldconfig
409 %postun -n libgo -p /sbin/ldconfig
412 Summary: Testsuite results
413 License: SUSE-Public-Domain
414 Group: Development/Languages
415 %description testresults
416 Results from running the gcc and target library testsuites.
418 %package -n gcc-32bit
419 Summary: The GNU C Compiler 32bit support
420 Group: Development/Building
421 %description -n gcc-32bit
422 This package contains 32bit support for the GNU Compiler Collection.
424 %package -n libstdc++-devel-32bit
425 Summary: Include Files and Libraries mandatory for Development
426 License: GPL-3.0-with-GCC-exception
427 Group: Development/Building
428 %description -n libstdc++-devel-32bit
429 This package contains all the headers and libraries of the standard C++
430 library. It is needed for compiling C++ code.
432 %package -n libgcc-32bit
433 Summary: C compiler runtime library
434 License: GPL-3.0-with-GCC-exception
435 Group: Development/Building
436 %description -n libgcc-32bit
437 Libgcc is needed for dynamically linked C programs.
438 %post -n libgcc-32bit -p /sbin/ldconfig
439 %postun -n libgcc-32bit -p /sbin/ldconfig
441 %package -n libgomp-32bit
442 Summary: The GNU compiler collection OpenMP runtime library
443 License: GPL-3.0-with-GCC-exception
444 Group: Development/Building
445 %description -n libgomp-32bit
446 This is the OpenMP runtime library needed by OpenMP enabled programs
447 that were built with the -fopenmp compiler option and by programs that
448 were auto-parallelized via the -ftree-parallelize-loops compiler
450 %post -n libgomp-32bit -p /sbin/ldconfig
451 %postun -n libgomp-32bit -p /sbin/ldconfig
453 %package -n libstdc++-32bit
454 Summary: The standard C++ shared library
455 License: GPL-3.0-with-GCC-exception
456 Group: Development/Building
457 %description -n libstdc++-32bit
458 The standard C++ library, needed for dynamically linked C++ programs.
459 %post -n libstdc++-32bit -p /sbin/ldconfig
460 %postun -n libstdc++-32bit -p /sbin/ldconfig
463 Summary: GNU Objective C Compiler
465 Group: Development/Languages
466 %description objc-32bit
467 This package contains the GNU Objective C compiler. Objective C is an
468 object oriented language, created by Next Inc. and used in their
469 Nextstep OS. The source code is available in the gcc package.
471 %package -n libobjc-32bit
472 Summary: Library for the GNU Objective C Compiler
473 License: GPL-3.0-with-GCC-exception
474 Group: Development/Building
475 %description -n libobjc-32bit
476 The library for the GNU Objective C compiler.
477 %post -n libobjc-32bit -p /sbin/ldconfig
478 %postun -n libobjc-32bit -p /sbin/ldconfig
481 Summary: GNU Ada95 Compiler Based on GCC (GNAT)
483 Group: Development/Languages
484 %description ada-32bit
485 This package contains an Ada95 compiler and associated development
486 tools based on the GNU GCC technology. Ada95 is the object oriented
487 successor of the Ada83 language. To build this package from source you
488 must have installed a binary version to bootstrap the compiler.
490 %package -n libada-32bit
491 Summary: GNU Ada Runtime Libraries
492 License: GPL-3.0-with-GCC-exception
493 Group: Development/Languages
494 %description -n libada-32bit
495 This package contains the shared libraries required to run programs
496 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
497 shared libraries. It also contains the shared libraries for the
498 Implementation of the Ada Semantic Interface Specification (ASIS), the
499 implementation of Distributed Systems Programming (GLADE) and the Posix
500 1003.5 Binding (Florist).
501 %post -n libada-32bit -p /sbin/ldconfig
502 %postun -n libada-32bit -p /sbin/ldconfig
504 %package fortran-32bit
505 Summary: The GNU Fortran Compiler and Support Files
507 Group: Development/Languages
508 %description fortran-32bit
509 This is the Fortran compiler of the GNU Compiler Collection (GCC).
511 %package -n libgfortran-32bit
512 Summary: The GNU Fortran Compiler Runtime Library
513 License: GPL-3.0-with-GCC-exception
514 Group: Development/Languages
515 %description -n libgfortran-32bit
516 The runtime library needed to run programs compiled with the Fortran compiler
517 of the GNU Compiler Collection (GCC).
518 %post -n libgfortran-32bit -p /sbin/ldconfig
519 %postun -n libgfortran-32bit -p /sbin/ldconfig
521 %package -n libquadmath-32bit
522 Summary: The GNU Fortran Compiler Quadmath Runtime Library
524 Group: Development/Languages
525 %description -n libquadmath-32bit
526 The runtime library needed to run programs compiled with the Fortran compiler
527 of the GNU Compiler Collection (GCC) and quadruple precision floating point
529 %post -n libquadmath-32bit -p /sbin/ldconfig
530 %postun -n libquadmath-32bit -p /sbin/ldconfig
532 %package -n libitm-32bit
533 Summary: The GNU Compiler Transactional Memory Runtime Library
534 License: GPL-3.0-with-GCC-exception
535 Group: Development/Languages
536 %description -n libitm-32bit
537 The runtime library needed to run programs compiled with the
538 -fgnu-tm option of the GNU Compiler Collection (GCC).
539 %post -n libitm-32bit -p /sbin/ldconfig
540 %postun -n libitm-32bit -p /sbin/ldconfig
542 %package -n libasan-32bit
543 Summary: The GNU Compiler Address Sanitizer Runtime Library
545 Group: Development/Languages
546 %description -n libasan-32bit
547 The runtime library needed to run programs compiled with the
548 -fsanitize=address option of the GNU Compiler Collection (GCC).
549 %post -n libasan-32bit -p /sbin/ldconfig
550 %postun -n libasan-32bit -p /sbin/ldconfig
552 %package -n liblsan-32bit
553 Summary: The GNU Compiler Address Sanitizer Runtime Library
555 Group: Development/Languages
556 %description -n liblsan-32bit
557 The runtime library needed to run programs compiled with the
558 -fsanitize=leak option of the GNU Compiler Collection (GCC).
559 %post -n liblsan-32bit -p /sbin/ldconfig
560 %postun -n liblsan-32bit -p /sbin/ldconfig
562 %package -n libtsan-32bit
563 Summary: The GNU Compiler Thread Sanitizer Runtime Library
565 Group: Development/Languages
566 %description -n libtsan-32bit
567 The runtime library needed to run programs compiled with the
568 -fsanitize=thread option of the GNU Compiler Collection (GCC).
569 %post -n libtsan-32bit -p /sbin/ldconfig
570 %postun -n libtsan-32bit -p /sbin/ldconfig
572 %package -n libatomic-32bit
573 Summary: The GNU Compiler Atomic Operations Runtime Library
574 License: GPL-3.0-with-GCC-exception
575 Group: Development/Languages
576 %description -n libatomic-32bit
577 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
578 %post -n libatomic-32bit -p /sbin/ldconfig
579 %postun -n libatomic-32bit -p /sbin/ldconfig
581 %package -n libcilkrts-32bit
582 Summary: The GNU Compiler Cilk+ Runtime Library
584 Group: Development/Languages
585 %description -n libcilkrts-32bit
586 The runtime library needed to run programs compiled with the
587 -fcilkplus option of the GNU Compiler Collection (GCC).
588 %post -n libcilkrts-32bit -p /sbin/ldconfig
589 %postun -n libcilkrts-32bit -p /sbin/ldconfig
591 %package -n libubsan-32bit
592 Summary: The GNU Compiler Undefined Sanitizer Runtime Library
594 Group: Development/Languages
595 %description -n libubsan-32bit
596 The runtime library needed to run programs compiled with the
597 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
598 %post -n libubsan-32bit -p /sbin/ldconfig
599 %postun -n libubsan-32bit -p /sbin/ldconfig
601 %package -n libvtv-32bit
602 Summary: The GNU Compiler Vtable Verifier Runtime Library
604 Group: Development/Languages
605 %description -n libvtv-32bit
606 The runtime library needed to run programs compiled with the
607 -fvtable-verify option of the GNU Compiler Collection (GCC).
608 %post -n libvtv-32bit -p /sbin/ldconfig
609 %postun -n libvtv-32bit -p /sbin/ldconfig
611 %package -n libffi-32bit
612 Summary: Foreign Function Interface library
613 License: BSD-3-Clause
614 Group: Development/Building
615 %description -n libffi-32bit
616 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.
617 %post -n libffi-32bit -p /sbin/ldconfig
618 %postun -n libffi-32bit -p /sbin/ldconfig
620 %package -n libffi-devel-32bit
621 Summary: Foreign Function Interface library development files
622 License: BSD 3-Clause
623 Group: Development/Building
624 %description -n libffi-devel-32bit
625 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.
628 Summary: GNU Go Compiler
630 Group: Development/Languages
631 %description go-32bit
632 This package contains a Go compiler and associated development
633 files based on the GNU GCC technology.
635 %package -n libgo-32bit
636 Summary: GNU Go compiler runtime library
637 License: BSD-3-Clause
638 Group: Development/Languages
639 %description -n libgo-32bit
640 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.
641 %post -n libgo-32bit -p /sbin/ldconfig
642 %postun -n libgo-32bit -p /sbin/ldconfig
644 %package -n asan-force-options
645 Summary: Scripts to enable automatic package sanitization
646 Group: System Environment
650 %description -n asan-force-options
651 Scripts for ASan instrumentation
653 %post -n asan-force-options
654 # Change mode to allow all users to run gcc-force/unforce-options
656 [ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
657 /usr/bin/gcc-force-options %asan_force_options -fno-common
658 # Add ASan-related macros
659 cat >> /usr/lib/rpm/tizen_macros << EOF
661 %%asan_force_options %{asan_force_options}
662 %%gcc_unforce_options /usr/bin/gcc-unforce-options
663 %%gcc_force_options /usr/bin/gcc-force-options
664 %%gcc_force_default_options %%gcc_force_options %%asan_force_options -fno-common
666 %%gcc_unforce_options \\
667 %%gcc_force_options %%asan_force_options -fcommon
670 %preun -n asan-force-options
671 # Restore read-only mode
673 [ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
674 /usr/bin/gcc-unforce-options
676 %package -n ubsan-force-options
677 Summary: Scripts to enable automatic package sanitization
678 Group: System Environment
682 %description -n ubsan-force-options
683 Scripts for UBSan instrumentation
685 %post -n ubsan-force-options
686 # Change mode to allow all users to run gcc-force/unforce-options
688 [ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
689 /usr/bin/gcc-force-options %ubsan_force_options
690 # Add UBSan-related macros
691 cat >> /usr/lib/rpm/tizen_macros << EOF
693 %%ubsan_force_options %{ubsan_force_options}
694 %%gcc_unforce_options /usr/bin/gcc-unforce-options
695 %%gcc_force_options /usr/bin/gcc-force-options
696 %%gcc_force_default_options %%gcc_force_options %%ubsan_force_options
699 %preun -n ubsan-force-options
700 # Restore read-only mode
702 [ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
703 /usr/bin/gcc-unforce-options
705 %package -n ubsan-build-env
706 Summary: UBSan build environment
707 Group: System Environment
709 Requires: libubsan rpm
711 %description -n ubsan-build-env
712 UBSan build environment support files and scripts
714 %post -n ubsan-build-env
715 cat %{_rpmconfigdir}/macros.ubsan >> %{_rpmconfigdir}/tizen_macros
717 %package -n lsan-force-options
718 Summary: Scripts to enable automatic package sanitization
719 Group: System Environment
723 %description -n lsan-force-options
724 Scripts for LSan instrumentation
726 %post -n lsan-force-options
727 # Change mode to allow all users to run gcc-force/unforce-options
729 [ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
730 /usr/bin/gcc-force-options %lsan_force_options
731 # Add LSan-related macros
732 cat >> /usr/lib/rpm/tizen_macros << EOF
734 %%lsan_force_options %{lsan_force_options}
735 %%gcc_unforce_options /usr/bin/gcc-unforce-options
736 %%gcc_force_options /usr/bin/gcc-force-options
737 %%gcc_force_default_options %%gcc_force_options %%lsan_force_options
740 %preun -n lsan-force-options
741 # Restore read-only mode
743 [ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
744 /usr/bin/gcc-unforce-options
745 [ -d /emul/ ] && chmod a-w /emul/usr/bin/
747 %package -n asan-build-env
748 Summary: Asan build environment
749 Group: Development/Libraries
752 %description -n asan-build-env
753 Asan build environment
755 %post -n asan-build-env
756 # Add /usr/lib/libasan.so to /etc/ld.so.preload
757 [ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
758 echo "libasan.so" > /etc/ld.so.preload
759 [ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
760 [ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
762 %preun -n asan-build-env
763 # Restore /etc/ld.so.preload
764 [ -f /etc/ld.so.preload.orig ] && mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
766 %package -n lsan-runtime-env
767 Summary: LSan runtime environment
768 Group: Development/Libraries
770 Requires(post): smack
772 %description -n lsan-runtime-env
773 LSan runtime environment
775 %post -n lsan-runtime-env
776 # Add /usr/lib64/liblsan.so to /etc/ld.so.preload
777 [ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
778 echo "%{libdir}/liblsan.so" > /etc/ld.so.preload
779 [ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
780 [ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
781 echo "%{lsan_runtime_options}" > /LSAN_OPTIONS
782 chsmack -a "_" /etc/ld.so.preload /LSAN_OPTIONS /lsan.supp
784 %preun -n lsan-runtime-env
785 # Restore /etc/ld.so.preload
786 mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
788 %package -n sanitizer-devel
789 Summary: Sanitizer platform-independent tools
791 Group: Development/Tools
793 Requires: binutils python
794 Requires(post): smack
796 %description -n sanitizer-devel
797 The package contatins platform-independent tools for sanitization:
798 - asan_symbolize.py: script for offline symbolization of asan logs
800 %package -n asan-runtime-env
801 Summary: Asan runtime environment for target device
802 Group: Development/Libraries
804 %description -n asan-runtime-env
805 Asan runtime environment
807 %post -n asan-runtime-env
808 # Add /usr/lib/libasan.so to /etc/ld.so.preload
809 [ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
810 echo "%{libdir}/libasan.so" > /etc/ld.so.preload
811 [ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
812 [ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
813 echo "%{asan_runtime_options}" > /ASAN_OPTIONS
814 chsmack -a "_" /etc/ld.so.preload /ASAN_OPTIONS
816 %preun -n asan-runtime-env
817 # Restore /etc/ld.so.preload
818 [ -f /etc/ld.so.preload.orig ] && mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
820 %package -n ubsan-runtime-env
821 Summary: UBSan runtime environment for target device
822 Group: Development/Libraries
825 %description -n ubsan-runtime-env
826 UBSan runtime environment
828 %post -n ubsan-runtime-env
829 echo "%{ubsan_runtime_options}" > /UBSAN_OPTIONS
831 %package plugin-devel
832 Summary: GNU GCC Plugin development files
834 Group: Development/Languages
835 %description plugin-devel
836 This package contains GCC Plugin development files needed for compiler
839 %package -n sanitizer-sources
840 Summary: Sanitizer family tools sources
842 Group: Development/Tools
845 %description -n sanitizer-sources
846 Sanitizer family tools sources for external tools.
850 %setup -q -n gcc-%{version}
856 ln -sf mpfr-3.1.5 mpfr
860 ln -sf isl-0.17.1 isl
862 echo "" > gcc/DEV-PHASE
864 %global gcc_release `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/LINARO-VERSION`
871 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'
872 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D__USE_FORTIFY_LEVEL=0"`
874 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
875 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(sse\|fpmath\)[^ ]*//g'`
877 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ */ /g'`
881 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
882 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
884 --prefix=%{_prefix} \
885 --infodir=%{_infodir} \
886 --mandir=%{_mandir} \
888 --libexecdir=%{libdir} \
889 --enable-languages=c,c++,fortran \
890 --enable-checking=release \
892 --disable-bootstrap \
897 --with-slibdir=%{libdir} \
900 --enable-__cxa_atexit \
901 --enable-libstdcxx-allocator=new \
902 --enable-version-specific-runtime-libs \
903 --enable-linker-build-id \
904 --without-system-libunwind \
905 --enable-threads=posix \
910 --enable-libgfortran \
912 --with-arch=armv7-a \
913 --with-tune=cortex-a8 \
914 --disable-sjlj-exceptions \
917 --with-arch=armv8-a \
918 --disable-sjlj-exceptions \
921 --with-arch-32=i586 \
922 --with-tune=generic \
926 --with-arch-32=i586 \
927 --with-tune=generic \
934 --with-arch=armv7-a \
935 --with-tune=cortex-a8 \
936 --disable-sjlj-exceptions \
939 --with-arch=armv8-a \
940 --disable-sjlj-exceptions \
943 --disable-libgfortran \
944 --disable-libquadmath \
946 --disable-libatomic \
947 --disable-libstdc++-v3 \
948 --disable-libsanitizer \
951 --with-bugurl="http://bugs.tizen.org/" \
952 --with-pkgversion="Tizen/Linaro GCC %{version} %{gcc_release}" \
953 --target=%{target_arch} \
954 --host=%{host_arch} \
959 make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
962 # asan needs a whole shadow address space
963 ulimit -v unlimited || true
964 make -k check %{?_smp_mflags} || true
966 ../contrib/test_summary | tee ../testresults/test_summary.txt
972 make install DESTDIR=$RPM_BUILD_ROOT
975 cp `find . -name "*.sum"` ../testresults/
976 cp `find . -name "*.log" \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
977 chmod 644 ../testresults/*
981 rm -rf %{buildroot}/%{_datadir}/locale
983 #remove everything we don't need
984 rm -rf %{buildroot}/%{libsubdir}/install-tools
985 find %{buildroot}/ -name "*.la" -delete
988 ln -s gcc %{buildroot}%{_bindir}/cc
989 mv %{buildroot}%{libsubdir}/libstdc++.so*-gdb.py %{buildroot}%{_datadir}/gcc-%{version}/python/libstdcxx/
991 # expose plugins for ar (required for lto builds)
992 mkdir -p %{buildroot}%{_prefix}/lib/bfd-plugins
993 ln -sf %{libsubdir}/liblto_plugin.so %{buildroot}%{_prefix}/lib/bfd-plugins/liblto_plugin.so
995 # legacy preprocessor
996 mkdir -p %{buildroot}/lib
997 ln -s %{_bindir}/cpp %{buildroot}/lib/cpp
999 # 32-bit libgcc in multilib configuration
1001 mv %{buildroot}%{_prefix}/lib/libgcc_s.so* %{buildroot}%{libsubdir}/32/
1004 # move libraries to libdir
1005 for lib in asan atomic cilkrts gfortran gomp cc1 itm lsan quadmath stdc++ supc++ tsan ubsan
1007 [ -e %{buildroot}%{libsubdir}/lib$lib.a ] && mv %{buildroot}%{libsubdir}/lib$lib.a %{buildroot}%{libdir}/
1008 [ -e %{buildroot}%{libsubdir}/lib$lib.so ] && mv %{buildroot}%{libsubdir}/lib$lib.so* %{buildroot}%{libdir}/
1013 rm -rf %{buildroot}/%{libsubdir}/include-fixed
1014 rm -rf %{buildroot}/%{libsubdir}/include
1018 cp %{SOURCE15} %{SOURCE16} %{SOURCE18} %{buildroot}%{_prefix}/bin
1019 chmod a+x %{buildroot}%{_prefix}/bin/gcc-force-options
1020 chmod a+x %{buildroot}%{_prefix}/bin/gcc-unforce-options
1021 chmod a+x %{buildroot}%{_prefix}/bin/asan_symbolize.py
1023 cp %{SOURCE17} %{buildroot}
1024 chmod 644 %{buildroot}/ASAN_OPTIONS
1027 cp %{SOURCE19} %{SOURCE24} %{buildroot}
1028 chmod 644 %{buildroot}/LSAN_OPTIONS
1029 chmod 644 %{buildroot}/lsan.supp
1033 tar -czf libsanitizer.tar.bz libsanitizer
1034 mkdir -p %{buildroot}/src
1035 mv -v libsanitizer.tar.bz %{buildroot}/src
1037 mkdir -p %{buildroot}/%{_rpmconfigdir}/tizen/
1038 install -m 0644 %{SOURCE21} %{buildroot}/
1039 install -m 0644 %{SOURCE22} %{buildroot}/%{_rpmconfigdir}/
1040 install -m 0755 %{SOURCE23} %{buildroot}/%{_rpmconfigdir}/tizen/
1044 %manifest gcc.manifest
1045 %defattr(-,root,root)
1054 %{_bindir}/gcov-tool
1057 %{_bindir}/gcc-ranlib
1058 %{_bindir}/%{target_arch}-gcc
1059 %{_bindir}/%{target_arch}-gcc-%{version}
1060 %{_bindir}/%{target_arch}-gcc-ar
1061 %{_bindir}/%{target_arch}-gcc-nm
1062 %{_bindir}/%{target_arch}-gcc-ranlib
1063 %{libsubdir}/collect2
1065 %{libsubdir}/lto-wrapper
1066 %{libsubdir}/liblto_plugin.so*
1067 %{_prefix}/lib/bfd-plugins/liblto_plugin.so
1068 %{libsubdir}/include-fixed/*
1069 %{libsubdir}/include/*.h
1076 %ifarch %cilkrts_arch
1077 %{libsubdir}/include/cilk/*
1079 %{libsubdir}/include/sanitizer/*
1081 %exclude %{libdir}/libasan.so
1084 %exclude %{libdir}/liblsan.so
1087 %exclude %{libdir}/libtsan.so
1091 %defattr(-,root,root)
1092 %{libsubdir}/cc1plus
1095 %{_bindir}/%{target_arch}-g++
1096 %{_bindir}/%{target_arch}-c++
1099 %manifest gcc.manifest
1100 %license COPYING3 COPYING.RUNTIME
1101 %defattr(-,root,root)
1102 %{libdir}/libstdc++.so.*
1104 %files -n libstdc++-devel
1105 %defattr(-,root,root)
1106 %{libdir}/libstdc++.so
1107 %{libdir}/libstdc++.a
1108 %{libdir}/libsupc++.a
1109 %{libsubdir}/include/c++/*
1110 %{_datadir}/gcc-%{version}/python/libstdcxx/*
1113 %manifest gcc.manifest
1114 %license COPYING3 COPYING.RUNTIME
1115 %defattr(-,root,root)
1116 %{libdir}/libgcc_s.so.*
1119 %manifest gcc.manifest
1120 %license COPYING3 COPYING.RUNTIME
1121 %defattr(-,root,root)
1122 %{libdir}/libgomp.so.*
1125 %manifest gcc.manifest
1126 %defattr(-,root,root)
1127 %{libdir}/libcc1.so.*
1131 %manifest gcc.manifest
1132 %license libsanitizer/LICENSE.TXT
1133 %defattr(-,root,root)
1134 %{libdir}/libasan.so*
1139 %manifest gcc.manifest
1140 %license libsanitizer/LICENSE.TXT
1141 %defattr(-,root,root)
1142 %{libdir}/liblsan.so*
1147 %manifest gcc.manifest
1148 %license libsanitizer/LICENSE.TXT
1149 %defattr(-,root,root)
1150 %{libdir}/libtsan.so*
1153 %ifarch %atomic_arch
1155 %manifest gcc.manifest
1156 %license COPYING3 COPYING.RUNTIME
1157 %defattr(-,root,root)
1158 %{libdir}/libatomic.so.*
1163 %manifest gcc.manifest
1164 %license COPYING3 COPYING.RUNTIME
1165 %defattr(-,root,root)
1166 %{libdir}/libitm.so.*
1169 %ifarch %cilkrts_arch
1170 %files -n libcilkrts
1171 %manifest gcc.manifest
1172 %defattr(-,root,root)
1173 %{libdir}/libcilkrts.so.*
1178 %manifest gcc.manifest
1179 %license libsanitizer/LICENSE.TXT
1180 %defattr(-,root,root)
1181 %{libdir}/libubsan.so.*
1185 %defattr(-,root,root)
1186 %dir %{libsubdir}/finclude
1188 %{_bindir}/%{target_arch}-gfortran
1190 %{libsubdir}/finclude/*
1191 %{libdir}/libgfortran.a
1192 %{libdir}/libgfortran.so
1193 %{libsubdir}/libgfortran.spec
1194 %{libsubdir}/libcaf_single.a
1195 %ifarch %quadmath_arch
1196 %{libdir}/libquadmath.a
1197 %{libdir}/libquadmath.so
1200 %files -n libgfortran
1201 %defattr(-,root,root)
1202 %{libdir}/libgfortran.so.*
1204 %ifarch %quadmath_arch
1205 %files -n libquadmath
1206 %manifest gcc.manifest
1207 %license COPYING.LIB
1208 %defattr(-,root,root)
1209 %{libdir}/libquadmath.so.*
1213 %defattr(-,root,root)
1219 %defattr(-,root,root)
1220 %{libsubdir}/plugin/*
1224 %defattr(-,root,root)
1225 %doc testresults/test_summary.txt
1226 %doc testresults/*.sum
1227 %doc testresults/*.log
1231 %defattr(-,root,root)
1232 %{libsubdir}/32/crt*
1234 %{libsubdir}/32/*.so
1236 %{libsubdir}/32/*.spec
1239 %files -n libasan-32bit
1240 %manifest gcc.manifest
1241 %license libsanitizer/LICENSE.TXT
1242 %defattr(-,root,root)
1243 %{libsubdir}/32/libasan.so.*
1247 %files -n liblsan-32bit
1248 %manifest gcc.manifest
1249 %license libsanitizer/LICENSE.TXT
1250 %defattr(-,root,root)
1251 %{libsubdir}/32/liblsan.so.*
1254 %ifarch %atomic_arch
1255 %files -n libatomic-32bit
1256 %manifest gcc.manifest
1257 %license COPYING3 COPYING.RUNTIME
1258 %defattr(-,root,root)
1259 %{libsubdir}/32/libatomic.so.*
1262 %ifarch %cilkrts_arch
1263 %files -n libcilkrts-32bit
1264 %defattr(-,root,root)
1265 %{libsubdir}/32/libcilkrts.so.*
1268 %files -n libgcc-32bit
1269 %manifest gcc.manifest
1270 %license COPYING3 COPYING.RUNTIME
1271 %defattr(-,root,root)
1272 %{libsubdir}/32/libgcc_s.so.*
1274 %files -n libgomp-32bit
1275 %manifest gcc.manifest
1276 %license COPYING3 COPYING.RUNTIME
1277 %defattr(-,root,root)
1278 %{libsubdir}/32/libgomp.so.*
1281 %files -n libitm-32bit
1282 %license COPYING3 COPYING.RUNTIME
1283 %defattr(-,root,root)
1284 %{libsubdir}/32/libitm.so.*
1287 %files -n libgfortran-32bit
1288 %defattr(-,root,root)
1289 %dir %{libsubdir}/32/finclude
1290 %{libsubdir}/32/libgfortran.so.*
1291 %{libsubdir}/32/finclude/*
1293 %ifarch %quadmath_arch
1294 %files -n libquadmath-32bit
1295 %license COPYING.LIB
1296 %defattr(-,root,root)
1297 %{libsubdir}/32/libquadmath.so.*
1301 %files -n libubsan-32bit
1302 %manifest gcc.manifest
1303 %license libsanitizer/LICENSE.TXT
1304 %defattr(-,root,root)
1305 %{libsubdir}/32/libubsan.so.*
1308 %files -n libstdc++-32bit
1309 %manifest gcc.manifest
1310 %license COPYING3 COPYING.RUNTIME
1311 %defattr(-,root,root)
1312 %{libsubdir}/32/libstdc++.so.*
1313 %exclude %{libsubdir}/32/libstdc++.so.*-gdb.py
1315 %files -n libstdc++-devel-32bit
1316 %defattr(-,root,root)
1317 %{libsubdir}/32/libstdc++.so.*-gdb.py
1320 %files -n asan-force-options
1321 %defattr(-,root,root,-)
1322 %{_prefix}/bin/gcc-force-options
1323 %{_prefix}/bin/gcc-unforce-options
1325 %files -n ubsan-force-options
1326 %defattr(-,root,root,-)
1327 %{_prefix}/bin/gcc-force-options
1328 %{_prefix}/bin/gcc-unforce-options
1331 %files -n lsan-force-options
1332 %manifest gcc.manifest
1333 %defattr(-,root,root,-)
1334 %{_prefix}/bin/gcc-force-options
1335 %{_prefix}/bin/gcc-unforce-options
1338 %files -n asan-build-env
1339 %defattr(-,root,root,-)
1342 %files -n asan-runtime-env
1343 %defattr(-,root,root,-)
1346 %files -n lsan-runtime-env
1347 %defattr(-,root,root,-)
1353 %files -n ubsan-build-env
1354 %defattr(-,root,root,-)
1356 %{_rpmconfigdir}/macros.ubsan
1357 %{_rpmconfigdir}/tizen/extract-ubsan-logs
1359 %files -n ubsan-runtime-env
1360 %defattr(-,root,root,-)
1363 %files -n sanitizer-devel
1364 %defattr(-,root,root,-)
1365 %{_prefix}/bin/asan_symbolize.py
1367 %files -n sanitizer-sources
1368 %defattr(-,root,root,-)
1369 /src/libsanitizer.tar.bz