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 tsan_arch x86_64 aarch64
27 %define asan_arch x86_64 %ix86 ppc ppc64 %sparc %arm aarch64
28 %define itm_arch x86_64 %ix86 %arm ppc ppc64 ppc64le s390 s390x %sparc aarch64
29 %define atomic_arch x86_64 %ix86 %arm aarch64 ppc ppc64 ppc64le s390 s390x %sparc m68k
30 %define lsan_arch x86_64 aarch64 %arm %ix86
31 %define ubsan_arch x86_64 %ix86 ppc ppc64 %arm aarch64
32 %define cilkrts_arch x86_64 %ix86
47 %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
49 %define target_cpu %{?cross}%{!?cross:%{ARCH}}
50 %define target_abi %{?cross:%{?armv7l:eabi}}%{!?cross:%{?ABI}}
52 %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi}
53 %define libdir %{!?cross:%{_libdir}}%{?cross:%{_prefix}/lib%{?aarch64:64}}
54 %define libsubdir %{libdir}/gcc/%{target_arch}/%{version}
56 Name: gcc%{?cross:-%{cross}}
57 # With generated files in src we could drop the following
60 BuildRequires: gettext-devel
61 BuildRequires: makeinfo
62 ## until here, but at least renaming and patching info files breaks this
63 BuildRequires: gcc-c++
64 BuildRequires: zlib-devel
66 BuildRequires: glibc-devel-32bit
69 %{?cross:BuildRequires: binutils-%{cross}}
70 # here we use %%if because OBS spec parser cannot expand
71 # %%{?macro:...} correctly
72 %if 0%{?gcc_run_tests}
73 BuildRequires: dejagnu
77 URL: http://gcc.gnu.org/
80 Source: gcc-%{version}.tar.bz2
81 Source10: gmp-6.1.1.tar.bz2
82 Source11: mpfr-3.1.5.tar.bz2
83 Source12: mpc-1.0.3.tar.gz
84 Source13: isl-0.17.1.tar.bz2
85 Source14: cloog-0.18.4.tar.gz
86 Source15: gcc-force-options
87 Source16: gcc-unforce-options
88 Source17: ASAN_OPTIONS
89 Source18: asan_symbolize.py
90 Source19: LSAN_OPTIONS
91 Source20: gcc.manifest
92 Source21: UBSAN_OPTIONS
93 Source22: macros.ubsan
94 Source23: extract-ubsan-logs
96 Group: Development/Building
97 Summary: The GNU C Compiler and Support Files
99 %{?cross:ExcludeArch: %{cross}}
101 Core package for the GNU Compiler Collection, including the C language
105 Summary: The GNU C++ Compiler
107 Group: Development/Languages
109 This package contains the GNU compiler for C++.
111 %package -n libstdc++
112 Summary: The standard C++ shared library
113 License: GPL-3.0-with-GCC-exception
114 Group: Development/Building
115 %description -n libstdc++
116 The standard C++ library, needed for dynamically linked C++ programs.
117 %post -n libstdc++ -p /sbin/ldconfig
118 %postun -n libstdc++ -p /sbin/ldconfig
120 %package -n libstdc++-devel
121 Summary: Include Files and Libraries mandatory for Development
122 License: GPL-3.0-with-GCC-exception
123 Group: Development/Building
124 %description -n libstdc++-devel
125 This package contains all the headers and libraries of the standard C++
126 library. It is needed for compiling C++ code.
129 Summary: C compiler runtime library
130 License: GPL-3.0-with-GCC-exception
131 Group: Development/Building
132 %description -n libgcc
133 Libgcc is needed for dynamically linked C programs.
134 %post -n libgcc -p /sbin/ldconfig
135 %postun -n libgcc -p /sbin/ldconfig
138 Summary: The GNU compiler collection OpenMP runtime library
139 License: GPL-3.0-with-GCC-exception
140 Group: Development/Building
141 %description -n libgomp
142 This is the OpenMP runtime library needed by OpenMP enabled programs
143 that were built with the -fopenmp compiler option and by programs that
144 were auto-parallelized via the -ftree-parallelize-loops compiler
146 %post -n libgomp -p /sbin/ldconfig
147 %postun -n libgomp -p /sbin/ldconfig
150 Summary: GNU Objective C Compiler
152 Group: Development/Languages
154 This package contains the GNU Objective C compiler. Objective C is an
155 object oriented language, created by Next Inc. and used in their
156 Nextstep OS. The source code is available in the gcc package.
159 Summary: Library for the GNU Objective C Compiler
160 License: GPL-3.0-with-GCC-exception
161 Group: Development/Building
162 %description -n libobjc
163 The library for the GNU Objective C compiler.
164 %post -n libobjc -p /sbin/ldconfig
165 %postun -n libobjc -p /sbin/ldconfig
168 Summary: GNU Objective C++ Compiler
170 Group: Development/Languages
172 This package contains the GNU Objective C++ compiler. Objective C++ is an
173 object oriented language, created by Next Inc. and used in their
174 Nextstep OS. The source code is available in the gcc package.
177 Summary: The GCC Preprocessor
179 Group: Development/Languages
181 This Package contains just the preprocessor that is used by the X11
185 Summary: GNU Ada95 Compiler Based on GCC (GNAT)
187 Group: Development/Languages
189 This package contains an Ada95 compiler and associated development
190 tools based on the GNU GCC technology. Ada95 is the object oriented
191 successor of the Ada83 language. To build this package from source you
192 must have installed a binary version to bootstrap the compiler.
195 Summary: GNU Ada Runtime Libraries
196 License: GPL-3.0-with-GCC-exception
197 Group: Development/Languages
198 %description -n libada
199 This package contains the shared libraries required to run programs
200 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
201 shared libraries. It also contains the shared libraries for the
202 Implementation of the Ada Semantic Interface Specification (ASIS), the
203 implementation of Distributed Systems Programming (GLADE) and the Posix
204 1003.5 Binding (Florist).
205 %post -n libada -p /sbin/ldconfig
206 %postun -n libada -p /sbin/ldconfig
208 %package -n libquadmath
209 Summary: The GNU Fortran Compiler Quadmath Runtime Library
211 Group: Development/Languages
212 %description -n libquadmath
213 The runtime library needed to run programs compiled with the Fortran compiler
214 of the GNU Compiler Collection (GCC) and quadruple precision floating point
216 %post -n libquadmath -p /sbin/ldconfig
217 %postun -n libquadmath -p /sbin/ldconfig
220 Summary: The GNU Compiler Transactional Memory Runtime Library
222 Group: Development/Languages
223 %description -n libitm
224 The runtime library needed to run programs compiled with the
225 -fgnu-tm option of the GNU Compiler Collection (GCC).
226 %post -n libitm -p /sbin/ldconfig
227 %postun -n libitm -p /sbin/ldconfig
230 Summary: The GNU Compiler Address Sanitizer Runtime Library
232 Group: Development/Languages
233 %description -n libasan
234 The runtime library needed to run programs compiled with the
235 -fsanitize=address option of the GNU Compiler Collection (GCC).
236 %post -n libasan -p /sbin/ldconfig
237 %postun -n libasan -p /sbin/ldconfig
240 Summary: The GNU Compiler Thread Sanitizer Runtime Library
242 Group: Development/Languages
243 %description -n libtsan
244 The runtime library needed to run programs compiled with the
245 -fsanitize=thread option of the GNU Compiler Collection (GCC).
246 %post -n libtsan -p /sbin/ldconfig
247 %postun -n libtsan -p /sbin/ldconfig
249 %package -n libatomic
250 Summary: The GNU Compiler Atomic Operations Runtime Library
251 License: GPL-3.0-with-GCC-exception
252 Group: Development/Languages
253 %description -n libatomic
254 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
255 %post -n libatomic -p /sbin/ldconfig
256 %postun -n libatomic -p /sbin/ldconfig
258 %package -n libcilkrts
259 Summary: The GNU Compiler Cilk+ Runtime Library
261 Group: Development/Languages
262 %description -n libcilkrts
263 The runtime library needed to run programs compiled with the
264 -fcilkplus option of the GNU Compiler Collection (GCC).
265 %post -n libcilkrts -p /sbin/ldconfig
266 %postun -n libcilkrts -p /sbin/ldconfig
269 Summary: The GNU Compiler Leak Sanitizer Runtime Library
271 Group: Development/Languages
272 %description -n liblsan
273 The runtime library needed to run programs compiled with the
274 -fsanitize=leak option of the GNU Compiler Collection (GCC).
275 %post -n liblsan -p /sbin/ldconfig
276 %postun -n liblsan -p /sbin/ldconfig
279 Summary: The GNU Compiler Undefined Sanitizer Runtime Library
281 Group: Development/Languages
282 %description -n libubsan
283 The runtime library needed to run programs compiled with the
284 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
285 %post -n libubsan -p /sbin/ldconfig
286 %postun -n libubsan -p /sbin/ldconfig
289 Summary: The GNU Compiler Vtable Verifier Runtime Library
291 Group: Development/Languages
292 %description -n libvtv
293 The runtime library needed to run programs compiled with the
294 -fvtable-verify option of the GNU Compiler Collection (GCC).
295 %post -n libvtv -p /sbin/ldconfig
296 %postun -n libvtv -p /sbin/ldconfig
299 Summary: Java Runtime Library for gcc
300 License: GPL-2.0-with-classpath-exception
301 Group: Development/Building
302 %description -n libgcj
303 This library is needed if you want to use the GNU Java compiler, gcj.
304 Source code for this package is in gcc.
305 %post -n libgcj -p /sbin/ldconfig
306 %postun -n libgcj -p /sbin/ldconfig
309 Summary: The GNU Java Compiler
311 Group: Development/Languages
313 The Java compiler from the GCC-tools-suite.
315 %package -n libgcj_bc
316 Summary: Fake library for BC-ABI compatibility.
317 License: GPL-2.0-with-classpath-exception
318 Group: Development/Languages
319 %description -n libgcj_bc
320 A fake library that is used at link time only. It ensures that
321 binaries built with the BC-ABI link against a constant SONAME.
322 This way, BC-ABI binaries continue to work if the SONAME underlying
325 %package -n libgcj-jar
326 Summary: Java runtime library (jar files).
327 License: GPL-2.0-with-classpath-exception
328 Group: Development/Languages
329 %description -n libgcj-jar
330 These are the jar files that go along with the gcj front end to gcc.
332 %package -n libgcj-devel
333 Summary: Include Files and Libraries mandatory for Development.
334 License: GPL-2.0-with-classpath-exception
335 Group: Development/Languages
336 %description -n libgcj-devel
337 This package contains all necessary include files and libraries needed
338 to develop applications that require these.
341 Summary: Java Bytecode Interpreter for gcc
342 License: GPL-2.0-with-classpath-exception
343 Group: Development/Languages
344 %description -n gcc-gij
345 This package contains the java bytecode interpreter gij and related tools.
348 Summary: Foreign Function Interface library
349 License: BSD-3-Clause
350 Group: Development/Building
351 %description -n libffi
352 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.
353 %post -n libffi -p /sbin/ldconfig
354 %postun -n libffi -p /sbin/ldconfig
356 %package -n libffi-devel
357 Summary: Foreign Function Interface library development files
358 License: BSD 3-Clause
359 Group: Development/Building
360 %description -n libffi-devel
361 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.
364 Summary: GNU Go Compiler
366 Group: Development/Languages
368 This package contains a Go compiler and associated development
369 files based on the GNU GCC technology.
372 Summary: GNU Go compiler runtime library
373 License: BSD-3-Clause
374 Group: Development/Languages
375 %description -n libgo
376 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.
377 %post -n libgo -p /sbin/ldconfig
378 %postun -n libgo -p /sbin/ldconfig
381 Summary: Testsuite results
382 License: SUSE-Public-Domain
383 Group: Development/Languages
384 %description testresults
385 Results from running the gcc and target library testsuites.
387 %package -n gcc-32bit
388 Summary: The GNU C Compiler 32bit support
389 Group: Development/Building
390 %description -n gcc-32bit
391 This package contains 32bit support for the GNU Compiler Collection.
393 %package -n libstdc++-devel-32bit
394 Summary: Include Files and Libraries mandatory for Development
395 License: GPL-3.0-with-GCC-exception
396 Group: Development/Building
397 %description -n libstdc++-devel-32bit
398 This package contains all the headers and libraries of the standard C++
399 library. It is needed for compiling C++ code.
401 %package -n libgcc-32bit
402 Summary: C compiler runtime library
403 License: GPL-3.0-with-GCC-exception
404 Group: Development/Building
405 %description -n libgcc-32bit
406 Libgcc is needed for dynamically linked C programs.
407 %post -n libgcc-32bit -p /sbin/ldconfig
408 %postun -n libgcc-32bit -p /sbin/ldconfig
410 %package -n libgomp-32bit
411 Summary: The GNU compiler collection OpenMP runtime library
412 License: GPL-3.0-with-GCC-exception
413 Group: Development/Building
414 %description -n libgomp-32bit
415 This is the OpenMP runtime library needed by OpenMP enabled programs
416 that were built with the -fopenmp compiler option and by programs that
417 were auto-parallelized via the -ftree-parallelize-loops compiler
419 %post -n libgomp-32bit -p /sbin/ldconfig
420 %postun -n libgomp-32bit -p /sbin/ldconfig
422 %package -n libstdc++-32bit
423 Summary: The standard C++ shared library
424 License: GPL-3.0-with-GCC-exception
425 Group: Development/Building
426 %description -n libstdc++-32bit
427 The standard C++ library, needed for dynamically linked C++ programs.
428 %post -n libstdc++-32bit -p /sbin/ldconfig
429 %postun -n libstdc++-32bit -p /sbin/ldconfig
432 Summary: GNU Objective C Compiler
434 Group: Development/Languages
435 %description objc-32bit
436 This package contains the GNU Objective C compiler. Objective C is an
437 object oriented language, created by Next Inc. and used in their
438 Nextstep OS. The source code is available in the gcc package.
440 %package -n libobjc-32bit
441 Summary: Library for the GNU Objective C Compiler
442 License: GPL-3.0-with-GCC-exception
443 Group: Development/Building
444 %description -n libobjc-32bit
445 The library for the GNU Objective C compiler.
446 %post -n libobjc-32bit -p /sbin/ldconfig
447 %postun -n libobjc-32bit -p /sbin/ldconfig
450 Summary: GNU Ada95 Compiler Based on GCC (GNAT)
452 Group: Development/Languages
453 %description ada-32bit
454 This package contains an Ada95 compiler and associated development
455 tools based on the GNU GCC technology. Ada95 is the object oriented
456 successor of the Ada83 language. To build this package from source you
457 must have installed a binary version to bootstrap the compiler.
459 %package -n libada-32bit
460 Summary: GNU Ada Runtime Libraries
461 License: GPL-3.0-with-GCC-exception
462 Group: Development/Languages
463 %description -n libada-32bit
464 This package contains the shared libraries required to run programs
465 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
466 shared libraries. It also contains the shared libraries for the
467 Implementation of the Ada Semantic Interface Specification (ASIS), the
468 implementation of Distributed Systems Programming (GLADE) and the Posix
469 1003.5 Binding (Florist).
470 %post -n libada-32bit -p /sbin/ldconfig
471 %postun -n libada-32bit -p /sbin/ldconfig
473 %package -n libquadmath-32bit
474 Summary: The GNU Fortran Compiler Quadmath Runtime Library
476 Group: Development/Languages
477 %description -n libquadmath-32bit
478 The runtime library needed to run programs compiled with the Fortran compiler
479 of the GNU Compiler Collection (GCC) and quadruple precision floating point
481 %post -n libquadmath-32bit -p /sbin/ldconfig
482 %postun -n libquadmath-32bit -p /sbin/ldconfig
484 %package -n libitm-32bit
485 Summary: The GNU Compiler Transactional Memory Runtime Library
487 Group: Development/Languages
488 %description -n libitm-32bit
489 The runtime library needed to run programs compiled with the
490 -fgnu-tm option of the GNU Compiler Collection (GCC).
491 %post -n libitm-32bit -p /sbin/ldconfig
492 %postun -n libitm-32bit -p /sbin/ldconfig
494 %package -n libasan-32bit
495 Summary: The GNU Compiler Address Sanitizer Runtime Library
497 Group: Development/Languages
498 %description -n libasan-32bit
499 The runtime library needed to run programs compiled with the
500 -fsanitize=address option of the GNU Compiler Collection (GCC).
501 %post -n libasan-32bit -p /sbin/ldconfig
502 %postun -n libasan-32bit -p /sbin/ldconfig
504 %package -n libtsan-32bit
505 Summary: The GNU Compiler Thread Sanitizer Runtime Library
507 Group: Development/Languages
508 %description -n libtsan-32bit
509 The runtime library needed to run programs compiled with the
510 -fsanitize=thread option of the GNU Compiler Collection (GCC).
511 %post -n libtsan-32bit -p /sbin/ldconfig
512 %postun -n libtsan-32bit -p /sbin/ldconfig
514 %package -n libatomic-32bit
515 Summary: The GNU Compiler Atomic Operations Runtime Library
516 License: GPL-3.0-with-GCC-exception
517 Group: Development/Languages
518 %description -n libatomic-32bit
519 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
520 %post -n libatomic-32bit -p /sbin/ldconfig
521 %postun -n libatomic-32bit -p /sbin/ldconfig
523 %package -n libcilkrts-32bit
524 Summary: The GNU Compiler Cilk+ Runtime Library
526 Group: Development/Languages
527 %description -n libcilkrts-32bit
528 The runtime library needed to run programs compiled with the
529 -fcilkplus option of the GNU Compiler Collection (GCC).
530 %post -n libcilkrts-32bit -p /sbin/ldconfig
531 %postun -n libcilkrts-32bit -p /sbin/ldconfig
533 %package -n liblsan-32bit
534 Summary: The GNU Compiler Leak Sanitizer Runtime Library
536 Group: Development/Languages
537 %description -n liblsan-32bit
538 The runtime library needed to run programs compiled with the
539 -fsanitize=leak option of the GNU Compiler Collection (GCC).
540 %post -n liblsan-32bit -p /sbin/ldconfig
541 %postun -n liblsan-32bit -p /sbin/ldconfig
543 %package -n libubsan-32bit
544 Summary: The GNU Compiler Undefined Sanitizer Runtime Library
546 Group: Development/Languages
547 %description -n libubsan-32bit
548 The runtime library needed to run programs compiled with the
549 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
550 %post -n libubsan-32bit -p /sbin/ldconfig
551 %postun -n libubsan-32bit -p /sbin/ldconfig
553 %package -n libvtv-32bit
554 Summary: The GNU Compiler Vtable Verifier Runtime Library
556 Group: Development/Languages
557 %description -n libvtv-32bit
558 The runtime library needed to run programs compiled with the
559 -fvtable-verify option of the GNU Compiler Collection (GCC).
560 %post -n libvtv-32bit -p /sbin/ldconfig
561 %postun -n libvtv-32bit -p /sbin/ldconfig
563 %package -n libffi-32bit
564 Summary: Foreign Function Interface library
565 License: BSD-3-Clause
566 Group: Development/Building
567 %description -n libffi-32bit
568 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.
569 %post -n libffi-32bit -p /sbin/ldconfig
570 %postun -n libffi-32bit -p /sbin/ldconfig
572 %package -n libffi-devel-32bit
573 Summary: Foreign Function Interface library development files
574 License: BSD 3-Clause
575 Group: Development/Building
576 %description -n libffi-devel-32bit
577 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.
580 Summary: GNU Go Compiler
582 Group: Development/Languages
583 %description go-32bit
584 This package contains a Go compiler and associated development
585 files based on the GNU GCC technology.
587 %package -n libgo-32bit
588 Summary: GNU Go compiler runtime library
589 License: BSD-3-Clause
590 Group: Development/Languages
591 %description -n libgo-32bit
592 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.
593 %post -n libgo-32bit -p /sbin/ldconfig
594 %postun -n libgo-32bit -p /sbin/ldconfig
596 %package -n asan-force-options
597 Summary: Scripts to enable automatic package sanitization
598 Group: System Environment
602 %description -n asan-force-options
603 Scripts for ASan instrumentation
605 %post -n asan-force-options
606 # Change mode to allow all users to run gcc-force/unforce-options
608 [ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
609 /usr/bin/gcc-force-options -fsanitize-recover=address -fsanitize=address -fno-common -fno-omit-frame-pointer -U_FORTIFY_SOURCE
610 # Add restore_fcommon macro
611 cat >> /usr/lib/rpm/tizen_macros << EOF
614 /usr/bin/gcc-unforce-options \\
615 /usr/bin/gcc-force-options -fsanitize-recover=address -fsanitize=address -fcommon -fno-omit-frame-pointer -U_FORTIFY_SOURCE
619 %preun -n asan-force-options
620 # Restore read-only mode
622 [ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
623 /usr/bin/gcc-unforce-options
625 %package -n ubsan-force-options
626 Summary: Scripts to enable automatic package sanitization
627 Group: System Environment
631 %description -n ubsan-force-options
632 Scripts for UBSan instrumentation
634 %post -n ubsan-force-options
635 # Change mode to allow all users to run gcc-force/unforce-options
637 [ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
638 /usr/bin/gcc-force-options -fsanitize=undefined,bounds-strict,float-divide-by-zero,float-cast-overflow
640 %preun -n ubsan-force-options
641 # Restore read-only mode
643 [ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
644 /usr/bin/gcc-unforce-options
646 %package -n ubsan-build-env
647 Summary: UBSan build environment
648 Group: System Environment
650 Requires: libubsan rpm
652 %description -n ubsan-build-env
653 UBSan build environment support files and scripts
655 %post -n ubsan-build-env
656 cat %{_rpmconfigdir}/macros.ubsan >> %{_rpmconfigdir}/tizen_macros
658 %package -n lsan-force-options
659 Summary: Scripts to enable automatic package sanitization
660 Group: System Environment
664 %description -n lsan-force-options
665 Scripts for LSan instrumentation
667 %post -n lsan-force-options
668 # Change mode to allow all users to run gcc-force/unforce-options
670 [ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
671 /usr/bin/gcc-force-options -fsanitize=leak -fno-omit-frame-pointer -U_FORTIFY_SOURCE
673 %preun -n lsan-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
678 [ -d /emul/ ] && chmod a-w /emul/usr/bin/
680 %package -n asan-build-env
681 Summary: Asan build environment
682 Group: Development/Libraries
685 %description -n asan-build-env
686 Asan build environment
688 %post -n asan-build-env
689 # Add /usr/lib/libasan.so to /etc/ld.so.preload
690 [ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
691 echo "libasan.so" > /etc/ld.so.preload
692 [ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
693 [ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
695 %preun -n asan-build-env
696 # Restore /etc/ld.so.preload
697 [ -f /etc/ld.so.preload.orig ] && mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
699 %package -n lsan-runtime-env
700 Summary: LSan runtime environment
701 Group: Development/Libraries
703 Requires(post): smack
705 %description -n lsan-runtime-env
706 LSan runtime environment
708 %post -n lsan-runtime-env
709 # Add /usr/lib64/liblsan.so to /etc/ld.so.preload
710 [ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
711 echo "%{libdir}/liblsan.so" > /etc/ld.so.preload
712 [ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
713 [ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
714 chsmack -a "_" /etc/ld.so.preload /LSAN_OPTIONS /lsan.supp
716 %preun -n lsan-runtime-env
717 # Restore /etc/ld.so.preload
718 mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
720 %package -n sanitizer-devel
721 Summary: Sanitizer platform-independent tools
723 Group: Development/Tools
725 Requires: binutils python
726 Requires(post): smack
728 %description -n sanitizer-devel
729 The package contatins platform-independent tools for sanitization:
730 - asan_symbolize.py: script for offline symbolization of asan logs
732 %package -n asan-runtime-env
733 Summary: Asan runtime environment for target device
734 Group: Development/Libraries
736 %description -n asan-runtime-env
737 Asan runtime environment
739 %post -n asan-runtime-env
740 # Add /usr/lib/libasan.so to /etc/ld.so.preload
741 [ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
742 echo "%{libdir}/libasan.so" > /etc/ld.so.preload
743 [ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
744 [ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
745 echo "halt_on_error=false:start_deactivated=true:print_cmdline=true:quarantine_size_mb=1:detect_leaks=0:log_path=/tmp/asan.log:log_exe_path=1" > /ASAN_OPTIONS
746 chsmack -a "_" /etc/ld.so.preload /ASAN_OPTIONS
748 %preun -n asan-runtime-env
749 # Restore /etc/ld.so.preload
750 [ -f /etc/ld.so.preload.orig ] && mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
752 %package -n ubsan-runtime-env
753 Summary: UBSan runtime environment for target device
754 Group: Development/Libraries
757 %description -n ubsan-runtime-env
758 UBSan runtime environment
760 %post -n ubsan-runtime-env
761 echo "print_cmdline=true:log_path=/tmp/ubsan.log" > /UBSAN_OPTIONS
763 %package plugin-devel
764 Summary: GNU GCC Plugin development files
766 Group: Development/Languages
767 %description plugin-devel
768 This package contains GCC Plugin development files needed for compiler
771 %package -n sanitizer-sources
772 Summary: Sanitizer family tools sources
774 Group: Development/Tools
777 %description -n sanitizer-sources
778 Sanitizer family tools sources for external tools.
782 %setup -q -n gcc-%{version}
788 ln -sf mpfr-3.1.5 mpfr
792 ln -sf isl-0.17.1 isl
794 ln -sf cloog-0.18.4 cloog
796 echo "" > gcc/DEV-PHASE
798 %global gcc_release `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/LINARO-VERSION`
805 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'
806 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D__USE_FORTIFY_LEVEL=0"`
808 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
809 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(sse\|fpmath\)[^ ]*//g'`
811 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ */ /g'`
815 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
816 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
818 --prefix=%{_prefix} \
819 --infodir=%{_infodir} \
820 --mandir=%{_mandir} \
822 --libexecdir=%{libdir} \
823 --enable-languages=c,c++ \
824 --enable-checking=release \
826 --disable-bootstrap \
830 --with-slibdir=%{libdir} \
833 --enable-__cxa_atexit \
834 --enable-libstdcxx-allocator=new \
835 --enable-version-specific-runtime-libs \
836 --enable-linker-build-id \
837 --without-system-libunwind \
838 --enable-threads=posix \
840 --disable-libquadmath \
844 --with-arch=armv7-a \
845 --with-tune=cortex-a8 \
846 --disable-sjlj-exceptions \
849 --with-arch=armv8-a \
850 --disable-sjlj-exceptions \
853 --with-arch-32=i586 \
854 --with-tune=generic \
858 --with-arch-32=i586 \
859 --with-tune=generic \
866 --with-arch=armv7-a \
867 --with-tune=cortex-a8 \
868 --disable-sjlj-exceptions \
871 --with-arch=armv8-a \
872 --disable-sjlj-exceptions \
876 --disable-libatomic \
877 --disable-libstdc++-v3 \
878 --disable-libsanitizer \
881 --with-bugurl="http://bugs.tizen.org/" \
882 --with-pkgversion="Tizen/Linaro GCC %{version} %{gcc_release}" \
883 --target=%{target_arch} \
884 --host=%{host_arch} \
889 make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
892 # asan needs a whole shadow address space
893 ulimit -v unlimited || true
894 make -k check %{?_smp_mflags} || true
896 ../contrib/test_summary | tee ../testresults/test_summary.txt
902 make install DESTDIR=$RPM_BUILD_ROOT
905 cp `find . -name "*.sum"` ../testresults/
906 cp `find . -name "*.log" \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
907 chmod 644 ../testresults/*
911 rm -rf %{buildroot}/%{_datadir}/locale
913 #remove everything we don't need
914 rm -rf %{buildroot}/%{libsubdir}/install-tools
915 find %{buildroot}/%{libsubdir} -name "*.la" -exec rm -rf {} +
918 ln -s gcc %{buildroot}%{_bindir}/cc
919 mv %{buildroot}%{libsubdir}/libstdc++.so*-gdb.py %{buildroot}%{_datadir}/gcc-%{version}/python/libstdcxx/
921 # expose plugins for ar (required for lto builds)
922 mkdir -p %{buildroot}%{_prefix}/lib/bfd-plugins
923 ln -sf %{libsubdir}/liblto_plugin.so %{buildroot}%{_prefix}/lib/bfd-plugins/liblto_plugin.so
925 # legacy preprocessor
926 mkdir -p %{buildroot}/lib
927 ln -s %{_bindir}/cpp %{buildroot}/lib/cpp
929 # 32-bit libgcc in multilib configuration
931 mv %{buildroot}%{_prefix}/lib/libgcc_s.so* %{buildroot}%{libsubdir}/32/
934 # move libraries to libdir
935 for lib in asan atomic cilkrts gfortran gomp itm lsan quadmath stdc++ supc++ tsan ubsan
937 [ -e %{buildroot}%{libsubdir}/lib$lib.a ] && mv %{buildroot}%{libsubdir}/lib$lib.a %{buildroot}%{libdir}/
938 [ -e %{buildroot}%{libsubdir}/lib$lib.so ] && mv %{buildroot}%{libsubdir}/lib$lib.so* %{buildroot}%{libdir}/
943 rm -rf %{buildroot}/%{libsubdir}/include-fixed
944 rm -rf %{buildroot}/%{libsubdir}/include
948 cp %{SOURCE15} %{SOURCE16} %{SOURCE18} %{buildroot}%{_prefix}/bin
949 chmod a+x %{buildroot}%{_prefix}/bin/gcc-force-options
950 chmod a+x %{buildroot}%{_prefix}/bin/gcc-unforce-options
951 chmod a+x %{buildroot}%{_prefix}/bin/asan_symbolize.py
953 cp %{SOURCE17} %{buildroot}
954 chmod 644 %{buildroot}/ASAN_OPTIONS
957 cp %{SOURCE19} %{SOURCE24} %{buildroot}
958 chmod 644 %{buildroot}/LSAN_OPTIONS
959 chmod 644 %{buildroot}/lsan.supp
963 tar -czf libsanitizer.tar.bz libsanitizer
964 mkdir -p %{buildroot}/src
965 mv -v libsanitizer.tar.bz %{buildroot}/src
967 mkdir -p %{buildroot}/%{_rpmconfigdir}/tizen/
968 install -m 0644 %{SOURCE21} %{buildroot}/
969 install -m 0644 %{SOURCE22} %{buildroot}/%{_rpmconfigdir}/
970 install -m 0755 %{SOURCE23} %{buildroot}/%{_rpmconfigdir}/tizen/
974 %manifest gcc.manifest
975 %defattr(-,root,root)
987 %{_bindir}/gcc-ranlib
988 %{_bindir}/%{target_arch}-gcc
989 %{_bindir}/%{target_arch}-gcc-%{version}
990 %{_bindir}/%{target_arch}-gcc-ar
991 %{_bindir}/%{target_arch}-gcc-nm
992 %{_bindir}/%{target_arch}-gcc-ranlib
993 %{libsubdir}/collect2
995 %{libsubdir}/lto-wrapper
996 %{libsubdir}/liblto_plugin.so*
997 %{_prefix}/lib/bfd-plugins/liblto_plugin.so
998 %{libsubdir}/include-fixed/*
999 %{libsubdir}/include/*.h
1006 %ifarch %cilkrts_arch
1007 %{libsubdir}/include/cilk/*
1009 %{libsubdir}/include/sanitizer/*
1011 %exclude %{libdir}/libasan.so
1014 %exclude %{libdir}/liblsan.so
1017 %exclude %{libdir}/libtsan.so
1021 %defattr(-,root,root)
1022 %{libsubdir}/cc1plus
1025 %{_bindir}/%{target_arch}-g++
1026 %{_bindir}/%{target_arch}-c++
1029 %manifest gcc.manifest
1030 %defattr(-,root,root)
1031 %{libdir}/libstdc++.so.*
1033 %files -n libstdc++-devel
1034 %defattr(-,root,root)
1035 %{libdir}/libstdc++.so
1036 %{libdir}/libstdc++.a
1037 %{libdir}/libsupc++.a
1038 %{libsubdir}/include/c++/*
1039 %{_datadir}/gcc-%{version}/python/libstdcxx/*
1042 %manifest gcc.manifest
1043 %defattr(-,root,root)
1044 %{libdir}/libgcc_s.so.*
1047 %manifest gcc.manifest
1048 %defattr(-,root,root)
1049 %{libdir}/libgomp.so.*
1053 %manifest gcc.manifest
1054 %defattr(-,root,root)
1055 %{libdir}/libasan.so*
1060 %manifest gcc.manifest
1061 %defattr(-,root,root)
1062 %{libdir}/liblsan.so*
1067 %manifest gcc.manifest
1068 %defattr(-,root,root)
1069 %{libdir}/libtsan.so*
1072 %ifarch %atomic_arch
1074 %manifest gcc.manifest
1075 %defattr(-,root,root)
1076 %{libdir}/libatomic.so.*
1081 %manifest gcc.manifest
1082 %defattr(-,root,root)
1083 %{libdir}/libitm.so.*
1086 %ifarch %cilkrts_arch
1087 %files -n libcilkrts
1088 %manifest gcc.manifest
1089 %defattr(-,root,root)
1090 %{libdir}/libcilkrts.so.*
1095 %manifest gcc.manifest
1096 %defattr(-,root,root)
1097 %{libdir}/libubsan.so.*
1100 %ifarch %quadmath_arch
1101 %files -n libquadmath
1102 %manifest gcc.manifest
1103 %defattr(-,root,root)
1104 %{libdir}/libquadmath.so.*
1108 %defattr(-,root,root)
1114 %defattr(-,root,root)
1115 %{libsubdir}/plugin/*
1119 %defattr(-,root,root)
1120 %doc testresults/test_summary.txt
1121 %doc testresults/*.sum
1122 %doc testresults/*.log
1126 %defattr(-,root,root)
1127 %{libsubdir}/32/crt*
1129 %{libsubdir}/32/*.so
1131 %{libsubdir}/32/*.spec
1134 %files -n libasan-32bit
1135 %manifest gcc.manifest
1136 %defattr(-,root,root)
1137 %{libsubdir}/32/libasan.so.*
1141 %files -n liblsan-32bit
1142 %manifest gcc.manifest
1143 %defattr(-,root,root)
1144 %{libsubdir}/32/liblsan.so.*
1147 %ifarch %atomic_arch
1148 %files -n libatomic-32bit
1149 %manifest gcc.manifest
1150 %defattr(-,root,root)
1151 %{libsubdir}/32/libatomic.so.*
1154 %ifarch %cilkrts_arch
1155 %files -n libcilkrts-32bit
1156 %defattr(-,root,root)
1157 %{libsubdir}/32/libcilkrts.so.*
1160 %files -n libgcc-32bit
1161 %manifest gcc.manifest
1162 %defattr(-,root,root)
1163 %{libsubdir}/32/libgcc_s.so.*
1165 %files -n libgomp-32bit
1166 %manifest gcc.manifest
1167 %defattr(-,root,root)
1168 %{libsubdir}/32/libgomp.so.*
1171 %files -n libitm-32bit
1172 %defattr(-,root,root)
1173 %{libsubdir}/32/libitm.so.*
1176 %ifarch %quadmath_arch
1177 %files -n libquadmath-32bit
1178 %defattr(-,root,root)
1179 %{libsubdir}/32/libquadmath.so.*
1183 %files -n libubsan-32bit
1184 %manifest gcc.manifest
1185 %defattr(-,root,root)
1186 %{libsubdir}/32/libubsan.so.*
1189 %files -n libstdc++-32bit
1190 %manifest gcc.manifest
1191 %defattr(-,root,root)
1192 %{libsubdir}/32/libstdc++.so.*
1193 %exclude %{libsubdir}/32/libstdc++.so.*-gdb.py
1195 %files -n libstdc++-devel-32bit
1196 %defattr(-,root,root)
1197 %{libsubdir}/32/libstdc++.so.*-gdb.py
1200 %files -n asan-force-options
1201 %defattr(-,root,root,-)
1202 %{_prefix}/bin/gcc-force-options
1203 %{_prefix}/bin/gcc-unforce-options
1205 %files -n ubsan-force-options
1206 %defattr(-,root,root,-)
1207 %{_prefix}/bin/gcc-force-options
1208 %{_prefix}/bin/gcc-unforce-options
1211 %files -n lsan-force-options
1212 %manifest gcc.manifest
1213 %defattr(-,root,root,-)
1214 %{_prefix}/bin/gcc-force-options
1215 %{_prefix}/bin/gcc-unforce-options
1218 %files -n asan-build-env
1219 %defattr(-,root,root,-)
1222 %files -n asan-runtime-env
1223 %defattr(-,root,root,-)
1226 %files -n lsan-runtime-env
1227 %defattr(-,root,root,-)
1233 %files -n ubsan-build-env
1234 %defattr(-,root,root,-)
1236 %{_rpmconfigdir}/macros.ubsan
1237 %{_rpmconfigdir}/tizen/extract-ubsan-logs
1239 %files -n ubsan-runtime-env
1240 %defattr(-,root,root,-)
1243 %files -n sanitizer-devel
1244 %defattr(-,root,root,-)
1245 %{_prefix}/bin/asan_symbolize.py
1247 %files -n sanitizer-sources
1248 %defattr(-,root,root,-)
1249 /src/libsanitizer.tar.bz