5 # spec file for package gcc
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 # Enable this when testing on device to:
27 # 1. Enable macro to turn on testsuite building ('gcc_run_tests 1')
28 # 2. Keep 'obj/' folder in build stage as we do not want to rebuild all gcc
29 # again on device after invoking rpmbuild --short-circuit -bc ...
30 # 3. Skip configure and make commands and go directly to 'make check'
31 %if 0%{?run_tests_on_device}
32 %define gcc_run_tests 1
33 %define gcc_keep_build_dir 1
34 %define gcc_skip_configure 1
35 %define gcc_skip_make 1
38 # Exit right after 'make ..' step to keep all object files produced by gcc build
39 %if 0%{?exit_on_make_finish}
40 %define gcc_exit_on_make_finish 1
43 # Bootstrap build constrains for ASan config
44 %if 0%{?asanbootstrap}
45 %ifarch %arm aarch64 # or #if 0#{?qemu_user_space_build}
46 %{error:"'asanbootstrap' supposed to be used with i586/x86_64 arch"}
47 # The #error macro primitive cannot stop the build because macros are context
48 # free, lazily expanded whereever they are needed, not only during build.
49 # Use non-existing define for now to abort the build.
52 # We'll get 2 libasan runtime conflict: preloaded one and another from build dir.
54 %{error:"'asanbootstrap' could not be used with sanitized environment."}
55 %{error:"Use 'asanbootstrap' without defined 'asan'"}
60 %define quadmath_arch %ix86 x86_64 ia64
61 %define tsan_arch x86_64 aarch64
62 %define asan_arch x86_64 %ix86 ppc ppc64 %sparc %arm aarch64
63 %define itm_arch x86_64 %ix86 %arm ppc ppc64 ppc64le s390 s390x %sparc aarch64
64 %define atomic_arch x86_64 %ix86 %arm aarch64 ppc ppc64 ppc64le s390 s390x %sparc m68k
65 %define lsan_arch x86_64 %ix86 %arm aarch64
66 %define ubsan_arch x86_64 %ix86 ppc ppc64 %arm aarch64
85 %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
87 %define target_cpu %{?cross}%{!?cross:%{ARCH}}
88 %define target_abi %{?cross:%{?armv7l:eabi}%{?armv7hl:eabihf}}%{!?cross:%{?ABI}}
90 %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi}
91 %define libdir %{!?cross:%{_libdir}}%{?cross:%{_prefix}/lib%{?aarch64:64}}
92 %define libsubdir %{libdir}/gcc/%{target_arch}/%{version}
94 Name: gcc%{?cross:-%{cross}}
95 # With generated files in src we could drop the following
98 BuildRequires: gettext-devel
99 BuildRequires: makeinfo
100 ## until here, but at least renaming and patching info files breaks this
101 BuildRequires: gcc-c++
102 BuildRequires: zlib-devel
104 BuildRequires: glibc-devel-32bit
107 %{?cross:BuildRequires: binutils-%{cross}}
108 # here we use %%if because OBS spec parser cannot expand
109 # %%{?macro:...} correctly
110 %if 0%{?gcc_run_tests}
111 BuildRequires: dejagnu
112 BuildRequires: expect
115 URL: http://gcc.gnu.org/
118 Source: gcc-%{version}.tar.bz2
119 Source10: gmp-6.1.1.tar.bz2
120 Source11: mpfr-3.1.5.tar.bz2
121 Source12: mpc-1.0.3.tar.gz
122 Source13: isl-0.17.1.tar.bz2
123 Source20: gcc.manifest
124 Group: Development/Building
125 Summary: The GNU C Compiler and Support Files
127 %{?cross:ExcludeArch: %{cross}}
129 Core package for the GNU Compiler Collection, including the C language
133 Summary: The GNU C++ Compiler
135 Group: Development/Languages
137 This package contains the GNU compiler for C++.
139 %package -n libstdc++
140 Summary: The standard C++ shared library
141 License: GPL-3.0-with-GCC-exception
142 Group: Development/Building
143 %description -n libstdc++
144 The standard C++ library, needed for dynamically linked C++ programs.
145 %post -n libstdc++ -p /sbin/ldconfig
146 %postun -n libstdc++ -p /sbin/ldconfig
148 %package -n libstdc++-devel
149 Summary: Include Files and Libraries mandatory for Development
150 License: GPL-3.0-with-GCC-exception
151 Group: Development/Building
152 %description -n libstdc++-devel
153 This package contains all the headers and libraries of the standard C++
154 library. It is needed for compiling C++ code.
157 Summary: C compiler runtime library
158 License: GPL-3.0-with-GCC-exception
159 Group: Development/Building
160 %description -n libgcc
161 Libgcc is needed for dynamically linked C programs.
162 %post -n libgcc -p /sbin/ldconfig
163 %postun -n libgcc -p /sbin/ldconfig
166 Summary: The GNU compiler collection OpenMP runtime library
167 License: GPL-3.0-with-GCC-exception
168 Group: Development/Building
169 %description -n libgomp
170 This is the OpenMP runtime library needed by OpenMP enabled programs
171 that were built with the -fopenmp compiler option and by programs that
172 were auto-parallelized via the -ftree-parallelize-loops compiler
174 %post -n libgomp -p /sbin/ldconfig
175 %postun -n libgomp -p /sbin/ldconfig
178 Summary: GNU Objective C Compiler
180 Group: Development/Languages
182 This package contains the GNU Objective C compiler. Objective C is an
183 object oriented language, created by Next Inc. and used in their
184 Nextstep OS. The source code is available in the gcc package.
187 Summary: Library for the GNU Objective C Compiler
188 License: GPL-3.0-with-GCC-exception
189 Group: Development/Building
190 %description -n libobjc
191 The library for the GNU Objective C compiler.
192 %post -n libobjc -p /sbin/ldconfig
193 %postun -n libobjc -p /sbin/ldconfig
196 Summary: GNU C Compiler plugin for GDB
197 License: GPL-3.0-with-GCC-exception
198 Group: Development/Building
199 %description -n libcc1
200 The GCC plugin for GDB
201 %post -n libcc1 -p /sbin/ldconfig
202 %postun -n libcc1 -p /sbin/ldconfig
205 Summary: GNU Objective C++ Compiler
207 Group: Development/Languages
209 This package contains the GNU Objective C++ compiler. Objective C++ is an
210 object oriented language, created by Next Inc. and used in their
211 Nextstep OS. The source code is available in the gcc package.
214 Summary: The GCC Preprocessor
216 Group: Development/Languages
218 This Package contains just the preprocessor that is used by the X11
222 Summary: GNU Ada95 Compiler Based on GCC (GNAT)
224 Group: Development/Languages
226 This package contains an Ada95 compiler and associated development
227 tools based on the GNU GCC technology. Ada95 is the object oriented
228 successor of the Ada83 language. To build this package from source you
229 must have installed a binary version to bootstrap the compiler.
232 Summary: GNU Ada Runtime Libraries
233 License: GPL-3.0-with-GCC-exception
234 Group: Development/Languages
235 %description -n libada
236 This package contains the shared libraries required to run programs
237 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
238 shared libraries. It also contains the shared libraries for the
239 Implementation of the Ada Semantic Interface Specification (ASIS), the
240 implementation of Distributed Systems Programming (GLADE) and the Posix
241 1003.5 Binding (Florist).
242 %post -n libada -p /sbin/ldconfig
243 %postun -n libada -p /sbin/ldconfig
246 Summary: The GNU Fortran Compiler and Support Files
248 Group: Development/Languages
250 This is the Fortran compiler of the GNU Compiler Collection (GCC).
252 %package -n libgfortran
253 Summary: The GNU Fortran Compiler Runtime Library
254 License: GPL-3.0-with-GCC-exception
255 Group: Development/Languages
256 %description -n libgfortran
257 The runtime library needed to run programs compiled with the Fortran compiler
258 of the GNU Compiler Collection (GCC).
259 %post -n libgfortran -p /sbin/ldconfig
260 %postun -n libgfortran -p /sbin/ldconfig
262 %package -n libquadmath
263 Summary: The GNU Fortran Compiler Quadmath Runtime Library
265 Group: Development/Languages
266 %description -n libquadmath
267 The runtime library needed to run programs compiled with the Fortran compiler
268 of the GNU Compiler Collection (GCC) and quadruple precision floating point
270 %post -n libquadmath -p /sbin/ldconfig
271 %postun -n libquadmath -p /sbin/ldconfig
274 Summary: The GNU Compiler Transactional Memory Runtime Library
275 License: GPL-3.0-with-GCC-exception
276 Group: Development/Languages
277 %description -n libitm
278 The runtime library needed to run programs compiled with the
279 -fgnu-tm option of the GNU Compiler Collection (GCC).
280 %post -n libitm -p /sbin/ldconfig
281 %postun -n libitm -p /sbin/ldconfig
284 Summary: The GNU Compiler Address Sanitizer Runtime Library
286 Group: Development/Languages
287 %description -n libasan
288 The runtime library needed to run programs compiled with the
289 -fsanitize=address option of the GNU Compiler Collection (GCC).
290 %post -n libasan -p /sbin/ldconfig
291 %postun -n libasan -p /sbin/ldconfig
294 Summary: The GNU Compiler Thread Sanitizer Runtime Library
296 Group: Development/Languages
297 %description -n libtsan
298 The runtime library needed to run programs compiled with the
299 -fsanitize=thread option of the GNU Compiler Collection (GCC).
300 %post -n libtsan -p /sbin/ldconfig
301 %postun -n libtsan -p /sbin/ldconfig
303 %package -n libatomic
304 Summary: The GNU Compiler Atomic Operations Runtime Library
305 License: GPL-3.0-with-GCC-exception
306 Group: Development/Languages
307 %description -n libatomic
308 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
309 %post -n libatomic -p /sbin/ldconfig
310 %postun -n libatomic -p /sbin/ldconfig
313 Summary: The GNU Compiler Leak Sanitizer Runtime Library
315 Group: Development/Languages
316 %description -n liblsan
317 The runtime library needed to run programs compiled with the
318 -fsanitize=leak option of the GNU Compiler Collection (GCC).
319 %post -n liblsan -p /sbin/ldconfig
320 %postun -n liblsan -p /sbin/ldconfig
323 Summary: The GNU Compiler Undefined Sanitizer Runtime Library
325 Group: Development/Languages
326 %description -n libubsan
327 The runtime library needed to run programs compiled with the
328 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
329 %post -n libubsan -p /sbin/ldconfig
330 %postun -n libubsan -p /sbin/ldconfig
333 Summary: The GNU Compiler Vtable Verifier Runtime Library
335 Group: Development/Languages
336 %description -n libvtv
337 The runtime library needed to run programs compiled with the
338 -fvtable-verify option of the GNU Compiler Collection (GCC).
339 %post -n libvtv -p /sbin/ldconfig
340 %postun -n libvtv -p /sbin/ldconfig
343 Summary: Java Runtime Library for gcc
344 License: GPL-2.0-with-classpath-exception
345 Group: Development/Building
346 %description -n libgcj
347 This library is needed if you want to use the GNU Java compiler, gcj.
348 Source code for this package is in gcc.
349 %post -n libgcj -p /sbin/ldconfig
350 %postun -n libgcj -p /sbin/ldconfig
353 Summary: The GNU Java Compiler
355 Group: Development/Languages
357 The Java compiler from the GCC-tools-suite.
359 %package -n libgcj_bc
360 Summary: Fake library for BC-ABI compatibility.
361 License: GPL-2.0-with-classpath-exception
362 Group: Development/Languages
363 %description -n libgcj_bc
364 A fake library that is used at link time only. It ensures that
365 binaries built with the BC-ABI link against a constant SONAME.
366 This way, BC-ABI binaries continue to work if the SONAME underlying
369 %package -n libgcj-jar
370 Summary: Java runtime library (jar files).
371 License: GPL-2.0-with-classpath-exception
372 Group: Development/Languages
373 %description -n libgcj-jar
374 These are the jar files that go along with the gcj front end to gcc.
376 %package -n libgcj-devel
377 Summary: Include Files and Libraries mandatory for Development.
378 License: GPL-2.0-with-classpath-exception
379 Group: Development/Languages
380 %description -n libgcj-devel
381 This package contains all necessary include files and libraries needed
382 to develop applications that require these.
385 Summary: Java Bytecode Interpreter for gcc
386 License: GPL-2.0-with-classpath-exception
387 Group: Development/Languages
388 %description -n gcc-gij
389 This package contains the java bytecode interpreter gij and related tools.
392 Summary: Foreign Function Interface library
393 License: BSD-3-Clause
394 Group: Development/Building
395 %description -n libffi
396 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.
397 %post -n libffi -p /sbin/ldconfig
398 %postun -n libffi -p /sbin/ldconfig
400 %package -n libffi-devel
401 Summary: Foreign Function Interface library development files
402 License: BSD 3-Clause
403 Group: Development/Building
404 %description -n libffi-devel
405 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 Summary: GNU Go Compiler
410 Group: Development/Languages
412 This package contains a Go compiler and associated development
413 files based on the GNU GCC technology.
416 Summary: GNU Go compiler runtime library
417 License: BSD-3-Clause
418 Group: Development/Languages
419 %description -n libgo
420 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.
421 %post -n libgo -p /sbin/ldconfig
422 %postun -n libgo -p /sbin/ldconfig
425 Summary: Testsuite results
426 License: SUSE-Public-Domain
427 Group: Development/Languages
428 %description testresults
429 Results from running the gcc and target library testsuites.
431 %package -n gcc-32bit
432 Summary: The GNU C Compiler 32bit support
433 Group: Development/Building
434 %description -n gcc-32bit
435 This package contains 32bit support for the GNU Compiler Collection.
437 %package -n libstdc++-devel-32bit
438 Summary: Include Files and Libraries mandatory for Development
439 License: GPL-3.0-with-GCC-exception
440 Group: Development/Building
441 %description -n libstdc++-devel-32bit
442 This package contains all the headers and libraries of the standard C++
443 library. It is needed for compiling C++ code.
445 %package -n libgcc-32bit
446 Summary: C compiler runtime library
447 License: GPL-3.0-with-GCC-exception
448 Group: Development/Building
449 %description -n libgcc-32bit
450 Libgcc is needed for dynamically linked C programs.
451 %post -n libgcc-32bit -p /sbin/ldconfig
452 %postun -n libgcc-32bit -p /sbin/ldconfig
454 %package -n libgomp-32bit
455 Summary: The GNU compiler collection OpenMP runtime library
456 License: GPL-3.0-with-GCC-exception
457 Group: Development/Building
458 %description -n libgomp-32bit
459 This is the OpenMP runtime library needed by OpenMP enabled programs
460 that were built with the -fopenmp compiler option and by programs that
461 were auto-parallelized via the -ftree-parallelize-loops compiler
463 %post -n libgomp-32bit -p /sbin/ldconfig
464 %postun -n libgomp-32bit -p /sbin/ldconfig
466 %package -n libstdc++-32bit
467 Summary: The standard C++ shared library
468 License: GPL-3.0-with-GCC-exception
469 Group: Development/Building
470 %description -n libstdc++-32bit
471 The standard C++ library, needed for dynamically linked C++ programs.
472 %post -n libstdc++-32bit -p /sbin/ldconfig
473 %postun -n libstdc++-32bit -p /sbin/ldconfig
476 Summary: GNU Objective C Compiler
478 Group: Development/Languages
479 %description objc-32bit
480 This package contains the GNU Objective C compiler. Objective C is an
481 object oriented language, created by Next Inc. and used in their
482 Nextstep OS. The source code is available in the gcc package.
484 %package -n libobjc-32bit
485 Summary: Library for the GNU Objective C Compiler
486 License: GPL-3.0-with-GCC-exception
487 Group: Development/Building
488 %description -n libobjc-32bit
489 The library for the GNU Objective C compiler.
490 %post -n libobjc-32bit -p /sbin/ldconfig
491 %postun -n libobjc-32bit -p /sbin/ldconfig
494 Summary: GNU Ada95 Compiler Based on GCC (GNAT)
496 Group: Development/Languages
497 %description ada-32bit
498 This package contains an Ada95 compiler and associated development
499 tools based on the GNU GCC technology. Ada95 is the object oriented
500 successor of the Ada83 language. To build this package from source you
501 must have installed a binary version to bootstrap the compiler.
503 %package -n libada-32bit
504 Summary: GNU Ada Runtime Libraries
505 License: GPL-3.0-with-GCC-exception
506 Group: Development/Languages
507 %description -n libada-32bit
508 This package contains the shared libraries required to run programs
509 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
510 shared libraries. It also contains the shared libraries for the
511 Implementation of the Ada Semantic Interface Specification (ASIS), the
512 implementation of Distributed Systems Programming (GLADE) and the Posix
513 1003.5 Binding (Florist).
514 %post -n libada-32bit -p /sbin/ldconfig
515 %postun -n libada-32bit -p /sbin/ldconfig
517 %package fortran-32bit
518 Summary: The GNU Fortran Compiler and Support Files
520 Group: Development/Languages
521 %description fortran-32bit
522 This is the Fortran compiler of the GNU Compiler Collection (GCC).
524 %package -n libgfortran-32bit
525 Summary: The GNU Fortran Compiler Runtime Library
526 License: GPL-3.0-with-GCC-exception
527 Group: Development/Languages
528 %description -n libgfortran-32bit
529 The runtime library needed to run programs compiled with the Fortran compiler
530 of the GNU Compiler Collection (GCC).
531 %post -n libgfortran-32bit -p /sbin/ldconfig
532 %postun -n libgfortran-32bit -p /sbin/ldconfig
534 %package -n libquadmath-32bit
535 Summary: The GNU Fortran Compiler Quadmath Runtime Library
537 Group: Development/Languages
538 %description -n libquadmath-32bit
539 The runtime library needed to run programs compiled with the Fortran compiler
540 of the GNU Compiler Collection (GCC) and quadruple precision floating point
542 %post -n libquadmath-32bit -p /sbin/ldconfig
543 %postun -n libquadmath-32bit -p /sbin/ldconfig
545 %package -n libitm-32bit
546 Summary: The GNU Compiler Transactional Memory Runtime Library
547 License: GPL-3.0-with-GCC-exception
548 Group: Development/Languages
549 %description -n libitm-32bit
550 The runtime library needed to run programs compiled with the
551 -fgnu-tm option of the GNU Compiler Collection (GCC).
552 %post -n libitm-32bit -p /sbin/ldconfig
553 %postun -n libitm-32bit -p /sbin/ldconfig
555 %package -n libasan-32bit
556 Summary: The GNU Compiler Address Sanitizer Runtime Library
558 Group: Development/Languages
559 %description -n libasan-32bit
560 The runtime library needed to run programs compiled with the
561 -fsanitize=address option of the GNU Compiler Collection (GCC).
562 %post -n libasan-32bit -p /sbin/ldconfig
563 %postun -n libasan-32bit -p /sbin/ldconfig
565 %package -n liblsan-32bit
566 Summary: The GNU Compiler Address Sanitizer Runtime Library
568 Group: Development/Languages
569 %description -n liblsan-32bit
570 The runtime library needed to run programs compiled with the
571 -fsanitize=leak option of the GNU Compiler Collection (GCC).
572 %post -n liblsan-32bit -p /sbin/ldconfig
573 %postun -n liblsan-32bit -p /sbin/ldconfig
575 %package -n libtsan-32bit
576 Summary: The GNU Compiler Thread Sanitizer Runtime Library
578 Group: Development/Languages
579 %description -n libtsan-32bit
580 The runtime library needed to run programs compiled with the
581 -fsanitize=thread option of the GNU Compiler Collection (GCC).
582 %post -n libtsan-32bit -p /sbin/ldconfig
583 %postun -n libtsan-32bit -p /sbin/ldconfig
585 %package -n libatomic-32bit
586 Summary: The GNU Compiler Atomic Operations Runtime Library
587 License: GPL-3.0-with-GCC-exception
588 Group: Development/Languages
589 %description -n libatomic-32bit
590 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
591 %post -n libatomic-32bit -p /sbin/ldconfig
592 %postun -n libatomic-32bit -p /sbin/ldconfig
594 %package -n libubsan-32bit
595 Summary: The GNU Compiler Undefined Sanitizer Runtime Library
597 Group: Development/Languages
598 %description -n libubsan-32bit
599 The runtime library needed to run programs compiled with the
600 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
601 %post -n libubsan-32bit -p /sbin/ldconfig
602 %postun -n libubsan-32bit -p /sbin/ldconfig
604 %package -n libvtv-32bit
605 Summary: The GNU Compiler Vtable Verifier Runtime Library
607 Group: Development/Languages
608 %description -n libvtv-32bit
609 The runtime library needed to run programs compiled with the
610 -fvtable-verify option of the GNU Compiler Collection (GCC).
611 %post -n libvtv-32bit -p /sbin/ldconfig
612 %postun -n libvtv-32bit -p /sbin/ldconfig
614 %package -n libffi-32bit
615 Summary: Foreign Function Interface library
616 License: BSD-3-Clause
617 Group: Development/Building
618 %description -n libffi-32bit
619 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
620 %post -n libffi-32bit -p /sbin/ldconfig
621 %postun -n libffi-32bit -p /sbin/ldconfig
623 %package -n libffi-devel-32bit
624 Summary: Foreign Function Interface library development files
625 License: BSD 3-Clause
626 Group: Development/Building
627 %description -n libffi-devel-32bit
628 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
631 Summary: GNU Go Compiler
633 Group: Development/Languages
634 %description go-32bit
635 This package contains a Go compiler and associated development
636 files based on the GNU GCC technology.
638 %package -n libgo-32bit
639 Summary: GNU Go compiler runtime library
640 License: BSD-3-Clause
641 Group: Development/Languages
642 %description -n libgo-32bit
643 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
644 %post -n libgo-32bit -p /sbin/ldconfig
645 %postun -n libgo-32bit -p /sbin/ldconfig
647 %package plugin-devel
648 Summary: GNU GCC Plugin development files
650 Group: Development/Languages
651 %description plugin-devel
652 This package contains GCC Plugin development files needed for compiler
655 %package -n sanitizer-sources
656 Summary: Sanitizer family tools sources
658 Group: Development/Tools
661 %description -n sanitizer-sources
662 Sanitizer family tools sources for external tools.
666 %setup -q -n gcc-%{version}
672 ln -sf mpfr-3.1.5 mpfr
676 ln -sf isl-0.17.1 isl
678 echo "" > gcc/DEV-PHASE
680 %global gcc_release `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/BASE-VER`
686 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -mthumb -mthumb-fp -Wa,-mimplicit-it=thumb -fno-omit-frame-pointer"
689 %{!?gcc_keep_build_dir:
695 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'
696 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D__USE_FORTIFY_LEVEL=0"`
698 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
699 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(sse\|fpmath\)[^ ]*//g'`
701 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ */ /g'`
703 # -Wall is stripped off now, so -Wformat will not turn on implicitly for
704 # "-Wformat-.." option group, causing additional build warnings and testsuite
705 # FAIL ("test for excess errors" type).
706 # Insert "-Wformat" if we find "-Wformat-..."
707 if [ ! -z "$(echo $RPM_OPT_FLAGS | grep -o "\B\-Wformat\-")" ]; then
708 if [ -z "$(echo $RPM_OPT_FLAGS | grep -Po "\B\-Wformat(\s|\Z)")" ]; then
709 RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e "s/-Wformat-/-Wformat -Wformat-/")
713 %{?asan: RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS -DASAN_INIT_FIRST) }
714 %{?asan_shadow_scale: RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS -Wp,-DASAN_SHADOW_SCALE=%{asan_shadow_scale})}
716 %ifarch armv7l armv7hl aarch64
717 %undefine gcc_profiledbootstrap
720 %{!?gcc_skip_configure:
721 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
722 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
724 --prefix=%{_prefix} \
725 --infodir=%{_infodir} \
726 --mandir=%{_mandir} \
728 --libexecdir=%{libdir} \
729 --enable-languages=c,c++,fortran \
730 --enable-checking=release \
732 %{!?gcc_profiledbootstrap:--disable-bootstrap} \
737 --with-slibdir=%{libdir} \
740 --enable-__cxa_atexit \
741 --enable-libstdcxx-allocator=new \
742 --enable-version-specific-runtime-libs \
743 --enable-linker-build-id \
744 --without-system-libunwind \
745 --enable-threads=posix \
750 --enable-libgfortran \
751 %{?asanbootstrap:--enable-bootstrap --with-build-config=bootstrap-asan} \
753 --with-arch=armv7-a \
754 --with-tune=cortex-a8 \
755 --disable-sjlj-exceptions \
758 --with-arch=armv7-a \
759 --with-tune=cortex-a8 \
760 --disable-sjlj-exceptions \
764 --with-arch=armv8-a \
765 --disable-sjlj-exceptions \
768 --with-arch-32=i586 \
769 --with-tune=generic \
773 --with-arch-32=i586 \
774 --with-tune=generic \
781 --with-arch=armv7-a \
782 --with-tune=cortex-a8 \
783 --disable-sjlj-exceptions \
786 --with-arch=armv7-a \
787 --with-tune=cortex-a8 \
788 --disable-sjlj-exceptions \
792 --with-arch=armv8-a \
793 --disable-sjlj-exceptions \
796 --disable-libgfortran \
797 --disable-libquadmath \
799 --disable-libatomic \
800 --disable-libstdc++-v3 \
801 --disable-libsanitizer \
804 --with-bugurl="http://bugs.tizen.org/" \
805 --with-pkgversion="Tizen GCC %{version} %{gcc_release} %{release}" \
806 --target=%{target_arch} \
807 --host=%{host_arch} \
812 make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} %{!?cross:%{?gcc_profiledbootstrap:profiledbootstrap}}
815 %{?gcc_exit_on_make_finish:
821 # asan needs a whole shadow address space
822 ulimit -v unlimited || true
823 make -k check %{?_smp_mflags} || true
825 ../contrib/test_summary | tee ../testresults/test_summary.txt
831 make install DESTDIR=$RPM_BUILD_ROOT
834 cp `find . -name "*.sum"` ../testresults/
835 cp --parents `find . -name "*.log" \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
836 chmod 644 `find ../testresults/ -type f`
840 rm -rf %{buildroot}/%{_datadir}/locale
842 #remove everything we don't need
843 rm -rf %{buildroot}/%{libsubdir}/install-tools
844 find %{buildroot}/ -name "*.la" -delete
847 ln -s gcc %{buildroot}%{_bindir}/cc
848 mv %{buildroot}%{libsubdir}/libstdc++.so*-gdb.py %{buildroot}%{_datadir}/gcc-%{version}/python/libstdcxx/
850 # expose plugins for ar (required for lto builds)
851 mkdir -p %{buildroot}%{_prefix}/lib/bfd-plugins
852 ln -sf %{libsubdir}/liblto_plugin.so %{buildroot}%{_prefix}/lib/bfd-plugins/liblto_plugin.so
854 # legacy preprocessor
855 mkdir -p %{buildroot}/lib
856 ln -s %{_bindir}/cpp %{buildroot}/lib/cpp
858 # 32-bit libgcc in multilib configuration
860 mv %{buildroot}%{_prefix}/lib/libgcc_s.so* %{buildroot}%{libsubdir}/32/
863 # move libraries to libdir
864 for lib in asan atomic gfortran gomp cc1 itm lsan quadmath stdc++ supc++ tsan ubsan
866 [ -e %{buildroot}%{libsubdir}/lib$lib.a ] && mv %{buildroot}%{libsubdir}/lib$lib.a %{buildroot}%{libdir}/
867 [ -e %{buildroot}%{libsubdir}/lib$lib.so ] && mv %{buildroot}%{libsubdir}/lib$lib.so* %{buildroot}%{libdir}/
872 rm -rf %{buildroot}/%{libsubdir}/include-fixed
873 rm -rf %{buildroot}/%{libsubdir}/include
878 tar -czf libsanitizer.tar.bz libsanitizer
879 mkdir -p %{buildroot}/src
880 mv -v libsanitizer.tar.bz %{buildroot}/src
884 %manifest gcc.manifest
885 %defattr(-,root,root)
897 %{_bindir}/gcc-ranlib
898 %{_bindir}/%{target_arch}-gcc
899 %{_bindir}/%{target_arch}-gcc-%{version}
900 %{_bindir}/%{target_arch}-gcc-ar
901 %{_bindir}/%{target_arch}-gcc-nm
902 %{_bindir}/%{target_arch}-gcc-ranlib
903 %{libsubdir}/collect2
905 %{libsubdir}/lto-wrapper
906 %{libsubdir}/liblto_plugin.so*
907 %{_prefix}/lib/bfd-plugins/liblto_plugin.so
908 %{libsubdir}/include-fixed/*
909 %{libsubdir}/include/*.h
916 %{libsubdir}/include/sanitizer/*
918 %exclude %{libdir}/libasan.so
921 %exclude %{libdir}/liblsan.so
924 %exclude %{libdir}/libtsan.so
928 %defattr(-,root,root)
932 %{_bindir}/%{target_arch}-g++
933 %{_bindir}/%{target_arch}-c++
936 %manifest gcc.manifest
937 %license COPYING3 COPYING.RUNTIME
938 %defattr(-,root,root)
939 %{libdir}/libstdc++.so.*
941 %files -n libstdc++-devel
942 %defattr(-,root,root)
943 %{libdir}/libstdc++.so
944 %{libdir}/libstdc++.a
945 %{libdir}/libsupc++.a
946 %{libsubdir}/include/c++/*
947 %{_datadir}/gcc-%{version}/python/libstdcxx/*
950 %manifest gcc.manifest
951 %license COPYING3 COPYING.RUNTIME
952 %defattr(-,root,root)
953 %{libdir}/libgcc_s.so.*
956 %manifest gcc.manifest
957 %license COPYING3 COPYING.RUNTIME
958 %defattr(-,root,root)
959 %{libdir}/libgomp.so.*
962 %manifest gcc.manifest
963 %defattr(-,root,root)
964 %{libdir}/libcc1.so.*
968 %manifest gcc.manifest
969 %license libsanitizer/LICENSE.TXT
970 %defattr(-,root,root)
971 %{libdir}/libasan.so*
976 %manifest gcc.manifest
977 %license libsanitizer/LICENSE.TXT
978 %defattr(-,root,root)
979 %{libdir}/liblsan.so*
984 %manifest gcc.manifest
985 %license libsanitizer/LICENSE.TXT
986 %defattr(-,root,root)
987 %{libdir}/libtsan.so*
992 %manifest gcc.manifest
993 %license COPYING3 COPYING.RUNTIME
994 %defattr(-,root,root)
995 %{libdir}/libatomic.so.*
1000 %manifest gcc.manifest
1001 %license COPYING3 COPYING.RUNTIME
1002 %defattr(-,root,root)
1003 %{libdir}/libitm.so.*
1008 %manifest gcc.manifest
1009 %license libsanitizer/LICENSE.TXT
1010 %defattr(-,root,root)
1011 %{libdir}/libubsan.so.*
1015 %defattr(-,root,root)
1016 %dir %{libsubdir}/finclude
1018 %{_bindir}/%{target_arch}-gfortran
1020 %{libsubdir}/finclude/*
1021 %{libdir}/libgfortran.a
1022 %{libdir}/libgfortran.so
1023 %{libsubdir}/libgfortran.spec
1024 %{libsubdir}/libcaf_single.a
1025 %ifarch %quadmath_arch
1026 %{libdir}/libquadmath.a
1027 %{libdir}/libquadmath.so
1030 %files -n libgfortran
1031 %defattr(-,root,root)
1032 %{libdir}/libgfortran.so.*
1034 %ifarch %quadmath_arch
1035 %files -n libquadmath
1036 %manifest gcc.manifest
1037 %license COPYING.LIB
1038 %defattr(-,root,root)
1039 %{libdir}/libquadmath.so.*
1043 %defattr(-,root,root)
1049 %defattr(-,root,root)
1050 %{libsubdir}/plugin/*
1054 %defattr(-,root,root)
1055 %doc testresults/test_summary.txt
1056 %doc testresults/*.sum
1061 %defattr(-,root,root)
1062 %{libsubdir}/32/crt*
1064 %{libsubdir}/32/*.so
1066 %{libsubdir}/32/*.spec
1069 %files -n libasan-32bit
1070 %manifest gcc.manifest
1071 %license libsanitizer/LICENSE.TXT
1072 %defattr(-,root,root)
1073 %{libsubdir}/32/libasan.so.*
1077 %files -n liblsan-32bit
1078 %manifest gcc.manifest
1079 %license libsanitizer/LICENSE.TXT
1080 %defattr(-,root,root)
1081 %{libsubdir}/32/liblsan.so.*
1084 %ifarch %atomic_arch
1085 %files -n libatomic-32bit
1086 %manifest gcc.manifest
1087 %license COPYING3 COPYING.RUNTIME
1088 %defattr(-,root,root)
1089 %{libsubdir}/32/libatomic.so.*
1092 %files -n libgcc-32bit
1093 %manifest gcc.manifest
1094 %license COPYING3 COPYING.RUNTIME
1095 %defattr(-,root,root)
1096 %{libsubdir}/32/libgcc_s.so.*
1098 %files -n libgomp-32bit
1099 %manifest gcc.manifest
1100 %license COPYING3 COPYING.RUNTIME
1101 %defattr(-,root,root)
1102 %{libsubdir}/32/libgomp.so.*
1105 %files -n libitm-32bit
1106 %license COPYING3 COPYING.RUNTIME
1107 %defattr(-,root,root)
1108 %{libsubdir}/32/libitm.so.*
1111 %files -n libgfortran-32bit
1112 %defattr(-,root,root)
1113 %dir %{libsubdir}/32/finclude
1114 %{libsubdir}/32/libgfortran.so.*
1115 %{libsubdir}/32/finclude/*
1117 %ifarch %quadmath_arch
1118 %files -n libquadmath-32bit
1119 %license COPYING.LIB
1120 %defattr(-,root,root)
1121 %{libsubdir}/32/libquadmath.so.*
1125 %files -n libubsan-32bit
1126 %manifest gcc.manifest
1127 %license libsanitizer/LICENSE.TXT
1128 %defattr(-,root,root)
1129 %{libsubdir}/32/libubsan.so.*
1132 %files -n libstdc++-32bit
1133 %manifest gcc.manifest
1134 %license COPYING3 COPYING.RUNTIME
1135 %defattr(-,root,root)
1136 %{libsubdir}/32/libstdc++.so.*
1137 %exclude %{libsubdir}/32/libstdc++.so.*-gdb.py
1139 %files -n libstdc++-devel-32bit
1140 %defattr(-,root,root)
1141 %{libsubdir}/32/libstdc++.so.*-gdb.py
1144 %files -n sanitizer-sources
1145 %defattr(-,root,root,-)
1146 /src/libsanitizer.tar.bz