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
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 libubsan-32bit
534 Summary: The GNU Compiler Undefined Sanitizer Runtime Library
536 Group: Development/Languages
537 %description -n libubsan-32bit
538 The runtime library needed to run programs compiled with the
539 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
540 %post -n libubsan-32bit -p /sbin/ldconfig
541 %postun -n libubsan-32bit -p /sbin/ldconfig
543 %package -n libvtv-32bit
544 Summary: The GNU Compiler Vtable Verifier Runtime Library
546 Group: Development/Languages
547 %description -n libvtv-32bit
548 The runtime library needed to run programs compiled with the
549 -fvtable-verify option of the GNU Compiler Collection (GCC).
550 %post -n libvtv-32bit -p /sbin/ldconfig
551 %postun -n libvtv-32bit -p /sbin/ldconfig
553 %package -n libffi-32bit
554 Summary: Foreign Function Interface library
555 License: BSD-3-Clause
556 Group: Development/Building
557 %description -n libffi-32bit
558 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.
559 %post -n libffi-32bit -p /sbin/ldconfig
560 %postun -n libffi-32bit -p /sbin/ldconfig
562 %package -n libffi-devel-32bit
563 Summary: Foreign Function Interface library development files
564 License: BSD 3-Clause
565 Group: Development/Building
566 %description -n libffi-devel-32bit
567 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.
570 Summary: GNU Go Compiler
572 Group: Development/Languages
573 %description go-32bit
574 This package contains a Go compiler and associated development
575 files based on the GNU GCC technology.
577 %package -n libgo-32bit
578 Summary: GNU Go compiler runtime library
579 License: BSD-3-Clause
580 Group: Development/Languages
581 %description -n libgo-32bit
582 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.
583 %post -n libgo-32bit -p /sbin/ldconfig
584 %postun -n libgo-32bit -p /sbin/ldconfig
586 %package -n asan-force-options
587 Summary: Scripts to enable automatic package sanitization
588 Group: System Environment
592 %description -n asan-force-options
593 Scripts for ASan instrumentation
595 %post -n asan-force-options
596 # Change mode to allow all users to run gcc-force/unforce-options
598 [ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
599 /usr/bin/gcc-force-options -fsanitize-recover=address -fsanitize=address -fno-common -fno-omit-frame-pointer -U_FORTIFY_SOURCE
600 # Add restore_fcommon macro
601 cat >> /usr/lib/rpm/tizen_macros << EOF
604 /usr/bin/gcc-unforce-options \\
605 /usr/bin/gcc-force-options -fsanitize-recover=address -fsanitize=address -fcommon -fno-omit-frame-pointer -U_FORTIFY_SOURCE
609 %preun -n asan-force-options
610 # Restore read-only mode
612 [ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
613 /usr/bin/gcc-unforce-options
615 %package -n ubsan-force-options
616 Summary: Scripts to enable automatic package sanitization
617 Group: System Environment
621 %description -n ubsan-force-options
622 Scripts for UBSan instrumentation
624 %post -n ubsan-force-options
625 # Change mode to allow all users to run gcc-force/unforce-options
627 [ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
628 /usr/bin/gcc-force-options -fsanitize=undefined,bounds-strict,float-divide-by-zero,float-cast-overflow
630 %preun -n ubsan-force-options
631 # Restore read-only mode
633 [ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
634 /usr/bin/gcc-unforce-options
636 %package -n ubsan-build-env
637 Summary: UBSan build environment
638 Group: System Environment
640 Requires: libubsan rpm
642 %description -n ubsan-build-env
643 UBSan build environment support files and scripts
645 %post -n ubsan-build-env
646 cat %{_rpmconfigdir}/macros.ubsan >> %{_rpmconfigdir}/tizen_macros
648 %package -n lsan-force-options
649 Summary: Scripts to enable automatic package sanitization
650 Group: System Environment
654 %description -n lsan-force-options
655 Scripts for LSan instrumentation
657 %post -n lsan-force-options
658 # Change mode to allow all users to run gcc-force/unforce-options
660 [ -d /emul/ ] && chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
661 /usr/bin/gcc-force-options -fsanitize=leak -fno-omit-frame-pointer -U_FORTIFY_SOURCE
663 %preun -n lsan-force-options
664 # Restore read-only mode
666 [ -d /emul/ ] && chmod a-w /emul/usr/bin/ && chmod a-w /emul/home/abuild/rpmbuild/BUILD/gcc-%{version}/obj/gcc/
667 /usr/bin/gcc-unforce-options
668 [ -d /emul/ ] && chmod a-w /emul/usr/bin/
670 %package -n asan-build-env
671 Summary: Asan build environment
672 Group: Development/Libraries
675 %description -n asan-build-env
676 Asan build environment
678 %post -n asan-build-env
679 # Add /usr/lib/libasan.so to /etc/ld.so.preload
680 [ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
681 echo "libasan.so" > /etc/ld.so.preload
682 [ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
683 [ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
685 %preun -n asan-build-env
686 # Restore /etc/ld.so.preload
687 [ -f /etc/ld.so.preload.orig ] && mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
689 %package -n lsan-runtime-env
690 Summary: LSan runtime environment
691 Group: Development/Libraries
693 Requires(post): smack
695 %description -n lsan-runtime-env
696 LSan runtime environment
698 %post -n lsan-runtime-env
699 # Add /usr/lib64/liblsan.so to /etc/ld.so.preload
700 [ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
701 echo "%{libdir}/liblsan.so" > /etc/ld.so.preload
702 [ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
703 [ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
704 chsmack -a "_" /etc/ld.so.preload /LSAN_OPTIONS /lsan.supp
706 %preun -n lsan-runtime-env
707 # Restore /etc/ld.so.preload
708 mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
710 %package -n sanitizer-devel
711 Summary: Sanitizer platform-independent tools
713 Group: Development/Tools
715 Requires: binutils python
716 Requires(post): smack
718 %description -n sanitizer-devel
719 The package contatins platform-independent tools for sanitization:
720 - asan_symbolize.py: script for offline symbolization of asan logs
722 %package -n asan-runtime-env
723 Summary: Asan runtime environment for target device
724 Group: Development/Libraries
726 %description -n asan-runtime-env
727 Asan runtime environment
729 %post -n asan-runtime-env
730 # Add /usr/lib/libasan.so to /etc/ld.so.preload
731 [ -f /etc/ld.so.preload ] && mv -v /etc/ld.so.preload /etc/ld.so.preload.orig
732 echo "%{libdir}/libasan.so" > /etc/ld.so.preload
733 [ -f /etc/ld.so.preload.orig ] && cat /etc/ld.so.preload.orig >> /etc/ld.so.preload
734 [ -f /etc/ld.so.preload.orig ] && rm -f /etc/ld.so.preload.orig
735 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
736 chsmack -a "_" /etc/ld.so.preload /ASAN_OPTIONS
738 %preun -n asan-runtime-env
739 # Restore /etc/ld.so.preload
740 [ -f /etc/ld.so.preload.orig ] && mv -v /etc/ld.so.preload.orig /etc/ld.so.preload
742 %package -n ubsan-runtime-env
743 Summary: UBSan runtime environment for target device
744 Group: Development/Libraries
747 %description -n ubsan-runtime-env
748 UBSan runtime environment
750 %post -n ubsan-runtime-env
751 echo "print_cmdline=true:log_path=/tmp/ubsan.log" > /UBSAN_OPTIONS
753 %package plugin-devel
754 Summary: GNU GCC Plugin development files
756 Group: Development/Languages
757 %description plugin-devel
758 This package contains GCC Plugin development files needed for compiler
761 %package -n sanitizer-sources
762 Summary: Sanitizer family tools sources
764 Group: Development/Tools
767 %description -n sanitizer-sources
768 Sanitizer family tools sources for external tools.
772 %setup -q -n gcc-%{version}
778 ln -sf mpfr-3.1.5 mpfr
782 ln -sf isl-0.17.1 isl
784 ln -sf cloog-0.18.4 cloog
786 echo "" > gcc/DEV-PHASE
788 %global gcc_release `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/LINARO-VERSION`
795 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'
796 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D__USE_FORTIFY_LEVEL=0"`
798 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
799 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(sse\|fpmath\)[^ ]*//g'`
801 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ */ /g'`
805 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
806 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
808 --prefix=%{_prefix} \
809 --infodir=%{_infodir} \
810 --mandir=%{_mandir} \
812 --libexecdir=%{libdir} \
813 --enable-languages=c,c++ \
814 --enable-checking=release \
816 --disable-bootstrap \
821 --with-slibdir=%{libdir} \
824 --enable-__cxa_atexit \
825 --enable-libstdcxx-allocator=new \
826 --enable-version-specific-runtime-libs \
827 --enable-linker-build-id \
828 --without-system-libunwind \
829 --enable-threads=posix \
831 --disable-libquadmath \
835 --with-arch=armv7-a \
836 --with-tune=cortex-a8 \
837 --disable-sjlj-exceptions \
840 --with-arch=armv8-a \
841 --disable-sjlj-exceptions \
844 --with-arch-32=i586 \
845 --with-tune=generic \
849 --with-arch-32=i586 \
850 --with-tune=generic \
857 --with-arch=armv7-a \
858 --with-tune=cortex-a8 \
859 --disable-sjlj-exceptions \
862 --with-arch=armv8-a \
863 --disable-sjlj-exceptions \
867 --disable-libatomic \
868 --disable-libstdc++-v3 \
869 --disable-libsanitizer \
872 --with-bugurl="http://bugs.tizen.org/" \
873 --with-pkgversion="Tizen/Linaro GCC %{version} %{gcc_release}" \
874 --target=%{target_arch} \
875 --host=%{host_arch} \
880 make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
883 # asan needs a whole shadow address space
884 ulimit -v unlimited || true
885 make -k check %{?_smp_mflags} || true
887 ../contrib/test_summary | tee ../testresults/test_summary.txt
893 make install DESTDIR=$RPM_BUILD_ROOT
896 cp `find . -name "*.sum"` ../testresults/
897 cp `find . -name "*.log" \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
898 chmod 644 ../testresults/*
902 rm -rf %{buildroot}/%{_datadir}/locale
904 #remove everything we don't need
905 rm -rf %{buildroot}/%{libsubdir}/install-tools
906 find %{buildroot}/%{libsubdir} -name "*.la" -exec rm -rf {} +
909 ln -s gcc %{buildroot}%{_bindir}/cc
910 mv %{buildroot}%{libsubdir}/libstdc++.so*-gdb.py %{buildroot}%{_datadir}/gcc-%{version}/python/libstdcxx/
912 # expose plugins for ar (required for lto builds)
913 mkdir -p %{buildroot}%{_prefix}/lib/bfd-plugins
914 ln -sf %{libsubdir}/liblto_plugin.so %{buildroot}%{_prefix}/lib/bfd-plugins/liblto_plugin.so
916 # legacy preprocessor
917 mkdir -p %{buildroot}/lib
918 ln -s %{_bindir}/cpp %{buildroot}/lib/cpp
920 # 32-bit libgcc in multilib configuration
922 mv %{buildroot}%{_prefix}/lib/libgcc_s.so* %{buildroot}%{libsubdir}/32/
925 # move libraries to libdir
926 for lib in asan atomic cilkrts gfortran gomp itm lsan quadmath stdc++ supc++ tsan ubsan
928 [ -e %{buildroot}%{libsubdir}/lib$lib.a ] && mv %{buildroot}%{libsubdir}/lib$lib.a %{buildroot}%{libdir}/
929 [ -e %{buildroot}%{libsubdir}/lib$lib.so ] && mv %{buildroot}%{libsubdir}/lib$lib.so* %{buildroot}%{libdir}/
934 rm -rf %{buildroot}/%{libsubdir}/include-fixed
935 rm -rf %{buildroot}/%{libsubdir}/include
939 cp %{SOURCE15} %{SOURCE16} %{SOURCE18} %{buildroot}%{_prefix}/bin
940 chmod a+x %{buildroot}%{_prefix}/bin/gcc-force-options
941 chmod a+x %{buildroot}%{_prefix}/bin/gcc-unforce-options
942 chmod a+x %{buildroot}%{_prefix}/bin/asan_symbolize.py
944 cp %{SOURCE17} %{buildroot}
945 chmod 644 %{buildroot}/ASAN_OPTIONS
948 cp %{SOURCE19} %{SOURCE24} %{buildroot}
949 chmod 644 %{buildroot}/LSAN_OPTIONS
950 chmod 644 %{buildroot}/lsan.supp
954 tar -czf libsanitizer.tar.bz libsanitizer
955 mkdir -p %{buildroot}/src
956 mv -v libsanitizer.tar.bz %{buildroot}/src
958 mkdir -p %{buildroot}/%{_rpmconfigdir}/tizen/
959 install -m 0644 %{SOURCE21} %{buildroot}/
960 install -m 0644 %{SOURCE22} %{buildroot}/%{_rpmconfigdir}/
961 install -m 0755 %{SOURCE23} %{buildroot}/%{_rpmconfigdir}/tizen/
965 %manifest gcc.manifest
966 %defattr(-,root,root)
978 %{_bindir}/gcc-ranlib
979 %{_bindir}/%{target_arch}-gcc
980 %{_bindir}/%{target_arch}-gcc-%{version}
981 %{_bindir}/%{target_arch}-gcc-ar
982 %{_bindir}/%{target_arch}-gcc-nm
983 %{_bindir}/%{target_arch}-gcc-ranlib
984 %{libsubdir}/collect2
986 %{libsubdir}/lto-wrapper
987 %{libsubdir}/liblto_plugin.so*
988 %{_prefix}/lib/bfd-plugins/liblto_plugin.so
989 %{libsubdir}/include-fixed/*
990 %{libsubdir}/include/*.h
997 %ifarch %cilkrts_arch
998 %{libsubdir}/include/cilk/*
1000 %{libsubdir}/include/sanitizer/*
1002 %exclude %{libdir}/libasan.so
1005 %exclude %{libdir}/liblsan.so
1008 %exclude %{libdir}/libtsan.so
1012 %defattr(-,root,root)
1013 %{libsubdir}/cc1plus
1016 %{_bindir}/%{target_arch}-g++
1017 %{_bindir}/%{target_arch}-c++
1020 %manifest gcc.manifest
1021 %defattr(-,root,root)
1022 %{libdir}/libstdc++.so.*
1024 %files -n libstdc++-devel
1025 %defattr(-,root,root)
1026 %{libdir}/libstdc++.so
1027 %{libdir}/libstdc++.a
1028 %{libdir}/libsupc++.a
1029 %{libsubdir}/include/c++/*
1030 %{_datadir}/gcc-%{version}/python/libstdcxx/*
1033 %manifest gcc.manifest
1034 %defattr(-,root,root)
1035 %{libdir}/libgcc_s.so.*
1038 %manifest gcc.manifest
1039 %defattr(-,root,root)
1040 %{libdir}/libgomp.so.*
1044 %manifest gcc.manifest
1045 %defattr(-,root,root)
1046 %{libdir}/libasan.so*
1051 %manifest gcc.manifest
1052 %defattr(-,root,root)
1053 %{libdir}/liblsan.so*
1058 %manifest gcc.manifest
1059 %defattr(-,root,root)
1060 %{libdir}/libtsan.so*
1063 %ifarch %atomic_arch
1065 %manifest gcc.manifest
1066 %defattr(-,root,root)
1067 %{libdir}/libatomic.so.*
1072 %manifest gcc.manifest
1073 %defattr(-,root,root)
1074 %{libdir}/libitm.so.*
1077 %ifarch %cilkrts_arch
1078 %files -n libcilkrts
1079 %manifest gcc.manifest
1080 %defattr(-,root,root)
1081 %{libdir}/libcilkrts.so.*
1086 %manifest gcc.manifest
1087 %defattr(-,root,root)
1088 %{libdir}/libubsan.so.*
1091 %ifarch %quadmath_arch
1092 %files -n libquadmath
1093 %manifest gcc.manifest
1094 %defattr(-,root,root)
1095 %{libdir}/libquadmath.so.*
1099 %defattr(-,root,root)
1105 %defattr(-,root,root)
1106 %{libsubdir}/plugin/*
1110 %defattr(-,root,root)
1111 %doc testresults/test_summary.txt
1112 %doc testresults/*.sum
1113 %doc testresults/*.log
1117 %defattr(-,root,root)
1118 %{libsubdir}/32/crt*
1120 %{libsubdir}/32/*.so
1122 %{libsubdir}/32/*.spec
1125 %files -n libasan-32bit
1126 %manifest gcc.manifest
1127 %defattr(-,root,root)
1128 %{libsubdir}/32/libasan.so.*
1131 %ifarch %atomic_arch
1132 %files -n libatomic-32bit
1133 %manifest gcc.manifest
1134 %defattr(-,root,root)
1135 %{libsubdir}/32/libatomic.so.*
1138 %ifarch %cilkrts_arch
1139 %files -n libcilkrts-32bit
1140 %defattr(-,root,root)
1141 %{libsubdir}/32/libcilkrts.so.*
1144 %files -n libgcc-32bit
1145 %manifest gcc.manifest
1146 %defattr(-,root,root)
1147 %{libsubdir}/32/libgcc_s.so.*
1149 %files -n libgomp-32bit
1150 %manifest gcc.manifest
1151 %defattr(-,root,root)
1152 %{libsubdir}/32/libgomp.so.*
1155 %files -n libitm-32bit
1156 %defattr(-,root,root)
1157 %{libsubdir}/32/libitm.so.*
1160 %ifarch %quadmath_arch
1161 %files -n libquadmath-32bit
1162 %defattr(-,root,root)
1163 %{libsubdir}/32/libquadmath.so.*
1167 %files -n libubsan-32bit
1168 %manifest gcc.manifest
1169 %defattr(-,root,root)
1170 %{libsubdir}/32/libubsan.so.*
1173 %files -n libstdc++-32bit
1174 %manifest gcc.manifest
1175 %defattr(-,root,root)
1176 %{libsubdir}/32/libstdc++.so.*
1177 %exclude %{libsubdir}/32/libstdc++.so.*-gdb.py
1179 %files -n libstdc++-devel-32bit
1180 %defattr(-,root,root)
1181 %{libsubdir}/32/libstdc++.so.*-gdb.py
1184 %files -n asan-force-options
1185 %defattr(-,root,root,-)
1186 %{_prefix}/bin/gcc-force-options
1187 %{_prefix}/bin/gcc-unforce-options
1189 %files -n ubsan-force-options
1190 %defattr(-,root,root,-)
1191 %{_prefix}/bin/gcc-force-options
1192 %{_prefix}/bin/gcc-unforce-options
1195 %files -n lsan-force-options
1196 %manifest gcc.manifest
1197 %defattr(-,root,root,-)
1198 %{_prefix}/bin/gcc-force-options
1199 %{_prefix}/bin/gcc-unforce-options
1202 %files -n asan-build-env
1203 %defattr(-,root,root,-)
1206 %files -n asan-runtime-env
1207 %defattr(-,root,root,-)
1210 %files -n lsan-runtime-env
1211 %defattr(-,root,root,-)
1217 %files -n ubsan-build-env
1218 %defattr(-,root,root,-)
1220 %{_rpmconfigdir}/macros.ubsan
1221 %{_rpmconfigdir}/tizen/extract-ubsan-logs
1223 %files -n ubsan-runtime-env
1224 %defattr(-,root,root,-)
1227 %files -n sanitizer-devel
1228 %defattr(-,root,root,-)
1229 %{_prefix}/bin/asan_symbolize.py
1231 %files -n sanitizer-sources
1232 %defattr(-,root,root,-)
1233 /src/libsanitizer.tar.bz