5 # spec file for package gcc
7 # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
8 # Copyright (c) 2015-2020 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
24 %define gcc_run_tests 1
27 %if 0%{?dump_configure}
28 %define gcc_dump_configure 1
31 # Enable this when testing on device to:
32 # 1. Enable macro to turn on testsuite building ('gcc_run_tests 1')
33 # 2. Keep 'obj/' folder in build stage as we do not want to rebuild all gcc
34 # again on device after invoking rpmbuild --short-circuit -bc ...
35 # 3. Skip configure and make commands and go directly to 'make check'
36 %if 0%{?run_tests_on_device}
37 %define gcc_run_tests 1
38 %define gcc_keep_build_dir 1
39 %define gcc_skip_configure 1
40 %define gcc_skip_make 1
43 # Exit right after 'make ..' step to keep all object files produced by gcc build
44 %if 0%{?exit_on_make_finish}
45 %define gcc_exit_on_make_finish 1
48 # Bootstrap build constrains for ASan config
49 %if 0%{?asanbootstrap}
50 %ifarch %arm aarch64 # or #if 0#{?qemu_user_space_build}
51 %{error:"'asanbootstrap' supposed to be used with i586/x86_64 arch"}
52 # The #error macro primitive cannot stop the build because macros are context
53 # free, lazily expanded whereever they are needed, not only during build.
54 # Use non-existing define for now to abort the build.
57 # We'll get 2 libasan runtime conflict: preloaded one and another from build dir.
59 %{error:"'asanbootstrap' could not be used with sanitized environment."}
60 %{error:"Use 'asanbootstrap' without defined 'asan'"}
65 %define quadmath_arch %ix86 x86_64 ia64
66 %define tsan_arch x86_64 aarch64
67 %define asan_arch x86_64 %ix86 ppc ppc64 %sparc %arm aarch64 riscv64
68 %define itm_arch x86_64 %ix86 %arm ppc ppc64 ppc64le s390 s390x %sparc aarch64 riscv64
69 %define atomic_arch x86_64 %ix86 %arm aarch64 ppc ppc64 ppc64le s390 s390x %sparc m68k riscv64
70 %define lsan_arch x86_64 aarch64
71 %define hwasan_arch aarch64 x86_64
72 %define ubsan_arch x86_64 %ix86 ppc ppc64 %arm aarch64 riscv64
94 %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
96 %define target_cpu %{?cross}%{!?cross:%{ARCH}}
97 %define target_abi %{?cross:%{?armv7l:eabi}%{?armv7hl:eabihf}}%{!?cross:%{?ABI}}
99 %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi}
100 %define libdir %{!?cross:%{_libdir}}%{?cross:%{_prefix}/lib%{?aarch64:64}%{?riscv64:64}}
101 %define libsubdir %{libdir}/gcc/%{target_arch}/%{version}
103 Name: gcc%{?cross:-%{cross}}
104 # With generated files in src we could drop the following
107 BuildRequires: gettext-devel
108 BuildRequires: makeinfo
109 ## until here, but at least renaming and patching info files breaks this
110 BuildRequires: gcc-c++
111 BuildRequires: zlib-devel
112 BuildRequires: xz-devel
114 BuildRequires: glibc-devel-32bit
117 %{?cross:BuildRequires: binutils-%{cross}}
118 # here we use %%if because OBS spec parser cannot expand
119 # %%{?macro:...} correctly
120 %if 0%{?gcc_run_tests}
121 BuildRequires: dejagnu
122 BuildRequires: expect
124 %if 0%{?gcc_dump_configure}
125 BuildRequires: configure-dumper
127 URL: http://gcc.gnu.org/
130 Source: gcc-%{version}.tar.bz2
131 Source10: gmp-6.2.1.tar.bz2
132 Source11: mpfr-4.2.0.tar.bz2
133 Source12: mpc-1.3.1.tar.gz
134 Source13: isl-0.22.tar.bz2
135 Source20: gcc.manifest
136 Group: Development/Building
137 Summary: The GNU C Compiler and Support Files
139 %{?cross:ExcludeArch: %{cross}}
141 Core package for the GNU Compiler Collection, including the C language
145 Summary: The GNU C++ Compiler
147 Group: Development/Languages
149 This package contains the GNU compiler for C++.
151 %package -n libstdc++
152 Summary: The standard C++ shared library
153 License: GPL-3.0-with-GCC-exception
154 Group: Development/Building
155 %description -n libstdc++
156 The standard C++ library, needed for dynamically linked C++ programs.
157 %post -n libstdc++ -p /sbin/ldconfig
158 %postun -n libstdc++ -p /sbin/ldconfig
160 %package -n libstdc++-devel
161 Summary: Include Files and Libraries mandatory for Development
162 License: GPL-3.0-with-GCC-exception
163 Group: Development/Building
164 %description -n libstdc++-devel
165 This package contains all the headers and libraries of the standard C++
166 library. It is needed for compiling C++ code.
169 Summary: C compiler runtime library
170 License: GPL-3.0-with-GCC-exception
171 Group: Development/Building
172 %description -n libgcc
173 Libgcc is needed for dynamically linked C programs.
174 %post -n libgcc -p /sbin/ldconfig
175 %postun -n libgcc -p /sbin/ldconfig
178 Summary: The GNU compiler collection OpenMP runtime library
179 License: GPL-3.0-with-GCC-exception
180 Group: Development/Building
181 %description -n libgomp
182 This is the OpenMP runtime library needed by OpenMP enabled programs
183 that were built with the -fopenmp compiler option and by programs that
184 were auto-parallelized via the -ftree-parallelize-loops compiler
186 %post -n libgomp -p /sbin/ldconfig
187 %postun -n libgomp -p /sbin/ldconfig
190 Summary: GNU Objective C Compiler
192 Group: Development/Languages
194 This package contains the GNU Objective C compiler. Objective C is an
195 object oriented language, created by Next Inc. and used in their
196 Nextstep OS. The source code is available in the gcc package.
199 Summary: Library for the GNU Objective C Compiler
200 License: GPL-3.0-with-GCC-exception
201 Group: Development/Building
202 %description -n libobjc
203 The library for the GNU Objective C compiler.
204 %post -n libobjc -p /sbin/ldconfig
205 %postun -n libobjc -p /sbin/ldconfig
208 Summary: GNU C Compiler plugin for GDB
209 License: GPL-3.0-with-GCC-exception
210 Group: Development/Building
211 %description -n libcc1
212 The GCC plugin for GDB
213 %post -n libcc1 -p /sbin/ldconfig
214 %postun -n libcc1 -p /sbin/ldconfig
217 Summary: GNU Objective C++ Compiler
219 Group: Development/Languages
221 This package contains the GNU Objective C++ compiler. Objective C++ is an
222 object oriented language, created by Next Inc. and used in their
223 Nextstep OS. The source code is available in the gcc package.
226 Summary: The GCC Preprocessor
228 Group: Development/Languages
230 This Package contains just the preprocessor that is used by the X11
234 Summary: GNU Ada95 Compiler Based on GCC (GNAT)
236 Group: Development/Languages
238 This package contains an Ada95 compiler and associated development
239 tools based on the GNU GCC technology. Ada95 is the object oriented
240 successor of the Ada83 language. To build this package from source you
241 must have installed a binary version to bootstrap the compiler.
244 Summary: GNU Ada Runtime Libraries
245 License: GPL-3.0-with-GCC-exception
246 Group: Development/Languages
247 %description -n libada
248 This package contains the shared libraries required to run programs
249 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
250 shared libraries. It also contains the shared libraries for the
251 Implementation of the Ada Semantic Interface Specification (ASIS), the
252 implementation of Distributed Systems Programming (GLADE) and the Posix
253 1003.5 Binding (Florist).
254 %post -n libada -p /sbin/ldconfig
255 %postun -n libada -p /sbin/ldconfig
258 Summary: The GNU Fortran Compiler and Support Files
260 Group: Development/Languages
262 This is the Fortran compiler of the GNU Compiler Collection (GCC).
264 %package -n libgfortran
265 Summary: The GNU Fortran Compiler Runtime Library
266 License: GPL-3.0-with-GCC-exception
267 Group: Development/Languages
268 %description -n libgfortran
269 The runtime library needed to run programs compiled with the Fortran compiler
270 of the GNU Compiler Collection (GCC).
271 %post -n libgfortran -p /sbin/ldconfig
272 %postun -n libgfortran -p /sbin/ldconfig
274 %package -n libquadmath
275 Summary: The GNU Fortran Compiler Quadmath Runtime Library
277 Group: Development/Languages
278 %description -n libquadmath
279 The runtime library needed to run programs compiled with the Fortran compiler
280 of the GNU Compiler Collection (GCC) and quadruple precision floating point
282 %post -n libquadmath -p /sbin/ldconfig
283 %postun -n libquadmath -p /sbin/ldconfig
286 Summary: The GNU Compiler Transactional Memory Runtime Library
287 License: GPL-3.0-with-GCC-exception
288 Group: Development/Languages
289 %description -n libitm
290 The runtime library needed to run programs compiled with the
291 -fgnu-tm option of the GNU Compiler Collection (GCC).
292 %post -n libitm -p /sbin/ldconfig
293 %postun -n libitm -p /sbin/ldconfig
296 Summary: The GNU Compiler Address Sanitizer Runtime Library
298 Group: Development/Languages
299 %description -n libasan
300 The runtime library needed to run programs compiled with the
301 -fsanitize=address option of the GNU Compiler Collection (GCC).
302 %post -n libasan -p /sbin/ldconfig
303 %postun -n libasan -p /sbin/ldconfig
305 %package -n libhwasan
306 Summary: The GNU Compiler Hardware-assisted Address Sanitizer Runtime Library
308 Group: Development/Languages
309 %description -n libhwasan
310 The runtime library needed to run programs compiled with the
311 -fsanitize=address option of the GNU Compiler Collection (GCC).
312 %post -n libhwasan -p /sbin/ldconfig
313 %postun -n libhwasan -p /sbin/ldconfig
316 Summary: The GNU Compiler Thread Sanitizer Runtime Library
318 Group: Development/Languages
319 %description -n libtsan
320 The runtime library needed to run programs compiled with the
321 -fsanitize=thread option of the GNU Compiler Collection (GCC).
322 %post -n libtsan -p /sbin/ldconfig
323 %postun -n libtsan -p /sbin/ldconfig
325 %package -n libatomic
326 Summary: The GNU Compiler Atomic Operations Runtime Library
327 License: GPL-3.0-with-GCC-exception
328 Group: Development/Languages
329 %description -n libatomic
330 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
331 %post -n libatomic -p /sbin/ldconfig
332 %postun -n libatomic -p /sbin/ldconfig
335 Summary: The GNU Compiler Leak Sanitizer Runtime Library
337 Group: Development/Languages
338 %description -n liblsan
339 The runtime library needed to run programs compiled with the
340 -fsanitize=leak option of the GNU Compiler Collection (GCC).
341 %post -n liblsan -p /sbin/ldconfig
342 %postun -n liblsan -p /sbin/ldconfig
345 Summary: The GNU Compiler Undefined Sanitizer Runtime Library
347 Group: Development/Languages
348 %description -n libubsan
349 The runtime library needed to run programs compiled with the
350 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
351 %post -n libubsan -p /sbin/ldconfig
352 %postun -n libubsan -p /sbin/ldconfig
355 Summary: The GNU Compiler Vtable Verifier Runtime Library
357 Group: Development/Languages
358 %description -n libvtv
359 The runtime library needed to run programs compiled with the
360 -fvtable-verify option of the GNU Compiler Collection (GCC).
361 %post -n libvtv -p /sbin/ldconfig
362 %postun -n libvtv -p /sbin/ldconfig
365 Summary: Java Runtime Library for gcc
366 License: GPL-2.0-with-classpath-exception
367 Group: Development/Building
368 %description -n libgcj
369 This library is needed if you want to use the GNU Java compiler, gcj.
370 Source code for this package is in gcc.
371 %post -n libgcj -p /sbin/ldconfig
372 %postun -n libgcj -p /sbin/ldconfig
375 Summary: The GNU Java Compiler
377 Group: Development/Languages
379 The Java compiler from the GCC-tools-suite.
381 %package -n libgcj_bc
382 Summary: Fake library for BC-ABI compatibility.
383 License: GPL-2.0-with-classpath-exception
384 Group: Development/Languages
385 %description -n libgcj_bc
386 A fake library that is used at link time only. It ensures that
387 binaries built with the BC-ABI link against a constant SONAME.
388 This way, BC-ABI binaries continue to work if the SONAME underlying
391 %package -n libgcj-jar
392 Summary: Java runtime library (jar files).
393 License: GPL-2.0-with-classpath-exception
394 Group: Development/Languages
395 %description -n libgcj-jar
396 These are the jar files that go along with the gcj front end to gcc.
398 %package -n libgcj-devel
399 Summary: Include Files and Libraries mandatory for Development.
400 License: GPL-2.0-with-classpath-exception
401 Group: Development/Languages
402 %description -n libgcj-devel
403 This package contains all necessary include files and libraries needed
404 to develop applications that require these.
407 Summary: Java Bytecode Interpreter for gcc
408 License: GPL-2.0-with-classpath-exception
409 Group: Development/Languages
410 %description -n gcc-gij
411 This package contains the java bytecode interpreter gij and related tools.
414 Summary: Foreign Function Interface library
415 License: BSD-3-Clause
416 Group: Development/Building
417 %description -n libffi
418 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.
419 %post -n libffi -p /sbin/ldconfig
420 %postun -n libffi -p /sbin/ldconfig
422 %package -n libffi-devel
423 Summary: Foreign Function Interface library development files
424 License: BSD 3-Clause
425 Group: Development/Building
426 %description -n libffi-devel
427 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.
430 Summary: GNU Go Compiler
432 Group: Development/Languages
434 This package contains a Go compiler and associated development
435 files based on the GNU GCC technology.
438 Summary: GNU Go compiler runtime library
439 License: BSD-3-Clause
440 Group: Development/Languages
441 %description -n libgo
442 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.
443 %post -n libgo -p /sbin/ldconfig
444 %postun -n libgo -p /sbin/ldconfig
448 Summary: Testsuite results
449 License: Public Domain
450 Group: Development/Languages
451 %description testresults
452 Results from running the gcc and target library testsuites.
455 %package -n gcc-32bit
456 Summary: The GNU C Compiler 32bit support
457 Group: Development/Building
458 %description -n gcc-32bit
459 This package contains 32bit support for the GNU Compiler Collection.
461 %package -n libstdc++-devel-32bit
462 Summary: Include Files and Libraries mandatory for Development
463 License: GPL-3.0-with-GCC-exception
464 Group: Development/Building
465 %description -n libstdc++-devel-32bit
466 This package contains all the headers and libraries of the standard C++
467 library. It is needed for compiling C++ code.
469 %package -n libgcc-32bit
470 Summary: C compiler runtime library
471 License: GPL-3.0-with-GCC-exception
472 Group: Development/Building
473 %description -n libgcc-32bit
474 Libgcc is needed for dynamically linked C programs.
475 %post -n libgcc-32bit -p /sbin/ldconfig
476 %postun -n libgcc-32bit -p /sbin/ldconfig
478 %package -n libgomp-32bit
479 Summary: The GNU compiler collection OpenMP runtime library
480 License: GPL-3.0-with-GCC-exception
481 Group: Development/Building
482 %description -n libgomp-32bit
483 This is the OpenMP runtime library needed by OpenMP enabled programs
484 that were built with the -fopenmp compiler option and by programs that
485 were auto-parallelized via the -ftree-parallelize-loops compiler
487 %post -n libgomp-32bit -p /sbin/ldconfig
488 %postun -n libgomp-32bit -p /sbin/ldconfig
490 %package -n libstdc++-32bit
491 Summary: The standard C++ shared library
492 License: GPL-3.0-with-GCC-exception
493 Group: Development/Building
494 %description -n libstdc++-32bit
495 The standard C++ library, needed for dynamically linked C++ programs.
496 %post -n libstdc++-32bit -p /sbin/ldconfig
497 %postun -n libstdc++-32bit -p /sbin/ldconfig
500 Summary: GNU Objective C Compiler
502 Group: Development/Languages
503 %description objc-32bit
504 This package contains the GNU Objective C compiler. Objective C is an
505 object oriented language, created by Next Inc. and used in their
506 Nextstep OS. The source code is available in the gcc package.
508 %package -n libobjc-32bit
509 Summary: Library for the GNU Objective C Compiler
510 License: GPL-3.0-with-GCC-exception
511 Group: Development/Building
512 %description -n libobjc-32bit
513 The library for the GNU Objective C compiler.
514 %post -n libobjc-32bit -p /sbin/ldconfig
515 %postun -n libobjc-32bit -p /sbin/ldconfig
518 Summary: GNU Ada95 Compiler Based on GCC (GNAT)
520 Group: Development/Languages
521 %description ada-32bit
522 This package contains an Ada95 compiler and associated development
523 tools based on the GNU GCC technology. Ada95 is the object oriented
524 successor of the Ada83 language. To build this package from source you
525 must have installed a binary version to bootstrap the compiler.
527 %package -n libada-32bit
528 Summary: GNU Ada Runtime Libraries
529 License: GPL-3.0-with-GCC-exception
530 Group: Development/Languages
531 %description -n libada-32bit
532 This package contains the shared libraries required to run programs
533 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
534 shared libraries. It also contains the shared libraries for the
535 Implementation of the Ada Semantic Interface Specification (ASIS), the
536 implementation of Distributed Systems Programming (GLADE) and the Posix
537 1003.5 Binding (Florist).
538 %post -n libada-32bit -p /sbin/ldconfig
539 %postun -n libada-32bit -p /sbin/ldconfig
541 %package fortran-32bit
542 Summary: The GNU Fortran Compiler and Support Files
544 Group: Development/Languages
545 %description fortran-32bit
546 This is the Fortran compiler of the GNU Compiler Collection (GCC).
548 %package -n libgfortran-32bit
549 Summary: The GNU Fortran Compiler Runtime Library
550 License: GPL-3.0-with-GCC-exception
551 Group: Development/Languages
552 %description -n libgfortran-32bit
553 The runtime library needed to run programs compiled with the Fortran compiler
554 of the GNU Compiler Collection (GCC).
555 %post -n libgfortran-32bit -p /sbin/ldconfig
556 %postun -n libgfortran-32bit -p /sbin/ldconfig
558 %package -n libquadmath-32bit
559 Summary: The GNU Fortran Compiler Quadmath Runtime Library
561 Group: Development/Languages
562 %description -n libquadmath-32bit
563 The runtime library needed to run programs compiled with the Fortran compiler
564 of the GNU Compiler Collection (GCC) and quadruple precision floating point
566 %post -n libquadmath-32bit -p /sbin/ldconfig
567 %postun -n libquadmath-32bit -p /sbin/ldconfig
569 %package -n libitm-32bit
570 Summary: The GNU Compiler Transactional Memory Runtime Library
571 License: GPL-3.0-with-GCC-exception
572 Group: Development/Languages
573 %description -n libitm-32bit
574 The runtime library needed to run programs compiled with the
575 -fgnu-tm option of the GNU Compiler Collection (GCC).
576 %post -n libitm-32bit -p /sbin/ldconfig
577 %postun -n libitm-32bit -p /sbin/ldconfig
579 %package -n libasan-32bit
580 Summary: The GNU Compiler Address Sanitizer Runtime Library
582 Group: Development/Languages
583 %description -n libasan-32bit
584 The runtime library needed to run programs compiled with the
585 -fsanitize=address option of the GNU Compiler Collection (GCC).
586 %post -n libasan-32bit -p /sbin/ldconfig
587 %postun -n libasan-32bit -p /sbin/ldconfig
589 %package -n liblsan-32bit
590 Summary: The GNU Compiler Address Sanitizer Runtime Library
592 Group: Development/Languages
593 %description -n liblsan-32bit
594 The runtime library needed to run programs compiled with the
595 -fsanitize=leak option of the GNU Compiler Collection (GCC).
596 %post -n liblsan-32bit -p /sbin/ldconfig
597 %postun -n liblsan-32bit -p /sbin/ldconfig
599 %package -n libtsan-32bit
600 Summary: The GNU Compiler Thread Sanitizer Runtime Library
602 Group: Development/Languages
603 %description -n libtsan-32bit
604 The runtime library needed to run programs compiled with the
605 -fsanitize=thread option of the GNU Compiler Collection (GCC).
606 %post -n libtsan-32bit -p /sbin/ldconfig
607 %postun -n libtsan-32bit -p /sbin/ldconfig
609 %package -n libatomic-32bit
610 Summary: The GNU Compiler Atomic Operations Runtime Library
611 License: GPL-3.0-with-GCC-exception
612 Group: Development/Languages
613 %description -n libatomic-32bit
614 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
615 %post -n libatomic-32bit -p /sbin/ldconfig
616 %postun -n libatomic-32bit -p /sbin/ldconfig
618 %package -n libubsan-32bit
619 Summary: The GNU Compiler Undefined Sanitizer Runtime Library
621 Group: Development/Languages
622 %description -n libubsan-32bit
623 The runtime library needed to run programs compiled with the
624 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
625 %post -n libubsan-32bit -p /sbin/ldconfig
626 %postun -n libubsan-32bit -p /sbin/ldconfig
628 %package -n libvtv-32bit
629 Summary: The GNU Compiler Vtable Verifier Runtime Library
631 Group: Development/Languages
632 %description -n libvtv-32bit
633 The runtime library needed to run programs compiled with the
634 -fvtable-verify option of the GNU Compiler Collection (GCC).
635 %post -n libvtv-32bit -p /sbin/ldconfig
636 %postun -n libvtv-32bit -p /sbin/ldconfig
638 %package -n libffi-32bit
639 Summary: Foreign Function Interface library
640 License: BSD-3-Clause
641 Group: Development/Building
642 %description -n libffi-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 libffi-32bit -p /sbin/ldconfig
645 %postun -n libffi-32bit -p /sbin/ldconfig
647 %package -n libffi-devel-32bit
648 Summary: Foreign Function Interface library development files
649 License: BSD 3-Clause
650 Group: Development/Building
651 %description -n libffi-devel-32bit
652 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.
655 Summary: GNU Go Compiler
657 Group: Development/Languages
658 %description go-32bit
659 This package contains a Go compiler and associated development
660 files based on the GNU GCC technology.
662 %package -n libgo-32bit
663 Summary: GNU Go compiler runtime library
664 License: BSD-3-Clause
665 Group: Development/Languages
666 %description -n libgo-32bit
667 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.
668 %post -n libgo-32bit -p /sbin/ldconfig
669 %postun -n libgo-32bit -p /sbin/ldconfig
671 %package plugin-devel
672 Summary: GNU GCC Plugin development files
674 Group: Development/Languages
675 %description plugin-devel
676 This package contains GCC Plugin development files needed for compiler
679 %package -n sanitizer-sources
680 Summary: Sanitizer family tools sources
682 Group: Development/Tools
685 %description -n sanitizer-sources
686 Sanitizer family tools sources for external tools.
689 %package devel-static
690 Summary: GNU GCC static libraries
692 Group: Development/Languages
693 %description devel-static
694 This package contains static libraries from GCC
697 %{?gcc_dump_configure:
698 %package configure-dump
699 Summary: GNU GCC configure dump
701 Group: Development/Languages
702 %description configure-dump
703 This package contains dump of configure variables of GCC
707 %setup -q -n gcc-%{version}
713 ln -sf mpfr-4.2.0 mpfr
722 %global gcc_datestamp `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/DATESTAMP`
728 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -marm -Wa,-mimplicit-it=arm -fasynchronous-unwind-tables"
731 %{!?gcc_keep_build_dir:
736 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/-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'
737 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D__USE_FORTIFY_LEVEL=0"`
738 RPM_OPT_FLAGS=${RPM_OPT_FLAGS/-fstack-protector-strong/}
739 RPM_OPT_FLAGS=${RPM_OPT_FLAGS/-fstack-protector/}
742 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
743 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(sse\|fpmath\)[^ ]*//g'`
745 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ */ /g'`
747 # -Wall is stripped off now, so -Wformat will not turn on implicitly for
748 # "-Wformat-.." option group, causing additional build warnings and testsuite
749 # FAIL ("test for excess errors" type).
750 # Insert "-Wformat" if we find "-Wformat-..."
751 if [ ! -z "$(echo $RPM_OPT_FLAGS | grep -o "\B\-Wformat\-")" ]; then
752 if [ -z "$(echo $RPM_OPT_FLAGS | grep -Po "\B\-Wformat(\s|\Z)")" ]; then
753 RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e "s/-Wformat-/-Wformat -Wformat-/")
757 %{?asan: RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS -DASAN_INIT_FIRST) }
758 %{?asan_shadow_scale: RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS -Wp,-DASAN_SHADOW_SCALE=%{asan_shadow_scale})}
760 %ifarch armv7l armv7hl aarch64
761 %undefine gcc_profiledbootstrap
765 ## Support DA build with armv8 cpu in 32bit mode: prevent Werror on sqrt function
766 # Extract current march
767 cur_arch=$(echo ${RPM_OPT_FLAGS} | sed -e 's/.*-march=\([^[:space:]]\+\).*/\1/')
768 # And apply it to libatomic to prevent conflict
769 (echo ${RPM_OPT_FLAGS} | grep '\-march=armv8') && \
770 sed -e "/@ARCH_ARM_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS/s/-march=[^[:space:]]\+/-march=${cur_arch}/" -i libatomic/Makefile.in
775 %{!?gcc_skip_configure:
776 %{?gcc_dump_configure:patch_configure.pl ..} # Add debug prints into configure
777 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
778 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
780 --prefix=%{_prefix} \
781 --infodir=%{_infodir} \
782 --mandir=%{_mandir} \
784 --libexecdir=%{libdir} \
785 --enable-languages=c,c++,fortran \
786 --enable-checking=release \
788 %{!?gcc_profiledbootstrap:--disable-bootstrap} \
793 --with-slibdir=%{libdir} \
796 --enable-__cxa_atexit \
797 --enable-libstdcxx-allocator=new \
798 --enable-version-specific-runtime-libs \
799 --enable-linker-build-id \
800 --without-system-libunwind \
801 --enable-threads=posix \
807 --enable-libgfortran \
808 %{?asanbootstrap:--enable-bootstrap --with-build-config=bootstrap-asan} \
810 --with-arch=armv7-a \
811 --with-tune=cortex-a8 \
812 --disable-sjlj-exceptions \
815 --with-arch=armv7-a+fp \
816 --with-tune=cortex-a8 \
818 --disable-sjlj-exceptions \
822 --with-arch=armv8-a \
823 --disable-sjlj-exceptions \
830 --with-arch-32=i586 \
831 --with-tune=generic \
835 --with-arch-32=i586 \
836 --with-tune=generic \
843 --with-arch=armv7-a \
844 --with-tune=cortex-a8 \
845 --disable-sjlj-exceptions \
848 --with-arch=armv7-a+fp \
849 --with-tune=cortex-a8 \
851 --disable-sjlj-exceptions \
855 --with-arch=armv8-a \
856 --disable-sjlj-exceptions \
863 --disable-libgfortran \
864 --disable-libquadmath \
866 --disable-libatomic \
867 --disable-libstdc++-v3 \
868 --disable-libsanitizer \
871 --with-bugurl="http://bugs.tizen.org/" \
872 --with-pkgversion="Tizen GCC %{version} %{gcc_datestamp} %{release}" \
873 --target=%{target_arch} \
874 --host=%{host_arch} \
879 # During native compiler build with qemu-accel enabled we have to provide
880 # path to accelerated lto_plugin.so to prevent
881 # error loading plugin: /home/abuild/rpmbuild/BUILD/gcc-12.2.0/obj/./gcc/liblto_plugin.so: wrong ELF class: ELFCLASS32
882 # So we have to update:
886 # - RAW_CXX_FOR_TARGET
887 # And provide path to liblto_plugin inside /emul via -B option
888 # Changing configure.ac and adding a dependency from qemu-accel there is not
889 # reasonable, so here we patch a Makefile after configure is competed
891 [[ -e '/emul' ]] && \
892 sed -e '/^\(G\?CC_FOR_TARGET\)=\|^\(\(RAW_\)\?CXX_FOR_TARGET\)=/s#\(xg\(cc\|++\)\)#\1 -B/emul%{libsubdir}/#' -i Makefile
896 make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} %{!?cross:%{?gcc_profiledbootstrap:profiledbootstrap}} %{?cross:all-host}
897 %{?gcc_dump_configure:
898 dump_configure.pl .. . \
900 --project-version %{version} \
901 --out_db gcc-%{version}-%{release}-%_project-%_repository.db
905 %{?gcc_exit_on_make_finish:
911 # asan needs a whole shadow address space
912 ulimit -v unlimited || true
913 make -k check %{?_smp_mflags} || true
915 ../contrib/test_summary | tee ../testresults/test_summary.txt
916 for tool in $(find -name '*.sum' -exec basename {} \; | sort -u | sed -e 's/.sum//'); do
917 ../contrib/dg-extract-results.sh -t $tool $(find -name '*.sum') | tee -a ../testresults/test_summary.txt
924 make install%{?cross:-host} DESTDIR=$RPM_BUILD_ROOT
926 %{?gcc_dump_configure:
927 install -D -m 0644 gcc-%{version}-%{release}-%_project-%_repository.db %{buildroot}%{_datadir}/gcc-%{version}-%{release}-%_project-%_repository.db
931 find . \( -name "*.sum" -o -name "*.log" -a \! -name "config.log" \) -exec tar -rf testresults.tar {} \;
932 mkdir -p ../testresults && tar -xf testresults.tar -C ../testresults
933 find ../testresults/ -type f -exec chmod 644 {} \;
937 rm -rf %{buildroot}/%{_datadir}/locale
939 #remove everything we don't need
940 rm -rf %{buildroot}/%{libsubdir}/install-tools
941 find %{buildroot}/ -name "*.la" -delete
944 ln -s gcc %{buildroot}%{_bindir}/cc
945 mv %{buildroot}%{libsubdir}/libstdc++.so*-gdb.py %{buildroot}%{_datadir}/gcc-%{version}/python/libstdcxx/
947 # legacy preprocessor
948 mkdir -p %{buildroot}/lib
949 ln -s %{_bindir}/cpp %{buildroot}/lib/cpp
951 # 32-bit libgcc in multilib configuration
953 mv %{buildroot}%{_prefix}/lib/libgcc_s.so* %{buildroot}%{libsubdir}/32/
956 # move libraries to libdir
957 for lib in asan atomic gfortran gomp cc1 itm lsan quadmath stdc++ supc++ tsan ubsan
959 [ -e %{buildroot}%{libsubdir}/lib$lib.a ] && mv %{buildroot}%{libsubdir}/lib$lib.a %{buildroot}%{libdir}/
960 [ -e %{buildroot}%{libsubdir}/lib$lib.so ] && mv %{buildroot}%{libsubdir}/lib$lib.so* %{buildroot}%{libdir}/
965 rm -rf %{buildroot}/%{libsubdir}/include-fixed
966 rm -rf %{buildroot}/%{libsubdir}/include
971 tar -czf libsanitizer.tar.bz libsanitizer
972 mkdir -p %{buildroot}/src
973 mv -v libsanitizer.tar.bz %{buildroot}/src
977 %manifest gcc.manifest
978 %defattr(-,root,root)
991 %{_bindir}/gcc-ranlib
993 %{_bindir}/%{target_arch}-gcc
994 %{_bindir}/%{target_arch}-gcc-%{version}
995 %{_bindir}/%{target_arch}-gcc-ar
996 %{_bindir}/%{target_arch}-gcc-nm
997 %{_bindir}/%{target_arch}-gcc-ranlib
998 %{libsubdir}/collect2
1000 %{libsubdir}/lto-wrapper
1001 %{libsubdir}/liblto_plugin.so*
1002 %{libsubdir}/g++-mapper-server
1003 %{libsubdir}/include-fixed/*
1004 %{libsubdir}/include/*.h
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 %license COPYING3 COPYING.RUNTIME
1031 %defattr(-,root,root)
1032 %{libdir}/libstdc++.so.*
1034 %files -n libstdc++-devel
1035 %defattr(-,root,root)
1036 %{libdir}/libstdc++.so
1037 %{libdir}/libstdc++.a
1038 %{libdir}/libsupc++.a
1039 %{libsubdir}/include/c++/*
1040 %{libsubdir}/libstdc++fs.a
1041 %{libsubdir}/libstdc++exp.a
1042 %{_datadir}/gcc-%{version}/python/libstdcxx/*
1044 %{libsubdir}/32/libstdc++.a
1045 %{libsubdir}/32/libsupc++.a
1046 %{libsubdir}/32/libstdc++fs.a
1047 %{libsubdir}/32/libstdc++exp.a
1051 %manifest gcc.manifest
1052 %license COPYING3 COPYING.RUNTIME
1053 %defattr(-,root,root)
1054 %{libdir}/libgcc_s.so.*
1055 %{libsubdir}/libgcc.a
1056 %{libsubdir}/libgcc_eh.a
1057 %{libsubdir}/libgcov.a
1060 %manifest gcc.manifest
1061 %license COPYING3 COPYING.RUNTIME
1062 %defattr(-,root,root)
1063 %{libdir}/libgomp.so.*
1066 %manifest gcc.manifest
1067 %defattr(-,root,root)
1068 %{libdir}/libcc1.so.*
1072 %manifest gcc.manifest
1073 %license libsanitizer/LICENSE.TXT
1074 %defattr(-,root,root)
1075 %{libdir}/libasan.so*
1078 %ifarch %hwasan_arch
1080 %manifest gcc.manifest
1081 %license libsanitizer/LICENSE.TXT
1082 %defattr(-,root,root)
1083 %{libsubdir}/libhwasan.so*
1088 %manifest gcc.manifest
1089 %license libsanitizer/LICENSE.TXT
1090 %defattr(-,root,root)
1091 %{libdir}/liblsan.so*
1096 %manifest gcc.manifest
1097 %license libsanitizer/LICENSE.TXT
1098 %defattr(-,root,root)
1099 %{libdir}/libtsan.so*
1102 %ifarch %atomic_arch
1104 %manifest gcc.manifest
1105 %license COPYING3 COPYING.RUNTIME
1106 %defattr(-,root,root)
1107 %{libdir}/libatomic.so.*
1112 %manifest gcc.manifest
1113 %license COPYING3 COPYING.RUNTIME
1114 %defattr(-,root,root)
1115 %{libdir}/libitm.so.*
1120 %manifest gcc.manifest
1121 %license libsanitizer/LICENSE.TXT
1122 %defattr(-,root,root)
1123 %{libdir}/libubsan.so.*
1127 %defattr(-,root,root)
1128 %dir %{libsubdir}/finclude
1130 %{_bindir}/%{target_arch}-gfortran
1132 %{libsubdir}/finclude/*
1133 %{libdir}/libgfortran.a
1134 %{libdir}/libgfortran.so
1135 %{libsubdir}/libgfortran.spec
1136 %{libsubdir}/libcaf_single.a
1137 %ifarch %quadmath_arch
1138 %{libdir}/libquadmath.a
1139 %{libdir}/libquadmath.so
1142 %files -n libgfortran
1143 %defattr(-,root,root)
1144 %{libdir}/libgfortran.so.*
1146 %ifarch %quadmath_arch
1147 %files -n libquadmath
1148 %manifest gcc.manifest
1149 %license COPYING.LIB
1150 %defattr(-,root,root)
1151 %{libdir}/libquadmath.so.*
1152 %{libdir}/libquadmath.a
1156 %defattr(-,root,root)
1162 %defattr(-,root,root)
1163 %{libsubdir}/plugin/*
1167 %defattr(-,root,root)
1169 %{libsubdir}/32/*.so
1171 %{libsubdir}/32/*.spec
1174 %files -n libasan-32bit
1175 %manifest gcc.manifest
1176 %license libsanitizer/LICENSE.TXT
1177 %defattr(-,root,root)
1178 %{libsubdir}/32/libasan.so.*
1181 %ifarch %atomic_arch
1182 %files -n libatomic-32bit
1183 %manifest gcc.manifest
1184 %license COPYING3 COPYING.RUNTIME
1185 %defattr(-,root,root)
1186 %{libsubdir}/32/libatomic.so.*
1189 %files -n libgcc-32bit
1190 %manifest gcc.manifest
1191 %license COPYING3 COPYING.RUNTIME
1192 %defattr(-,root,root)
1193 %{libsubdir}/32/libgcc_s.so.*
1194 %{libsubdir}/32/libgcc.a
1195 %{libsubdir}/32/libgcc_eh.a
1196 %{libsubdir}/32/libgcov.a
1198 %files -n libgomp-32bit
1199 %manifest gcc.manifest
1200 %license COPYING3 COPYING.RUNTIME
1201 %defattr(-,root,root)
1202 %{libsubdir}/32/libgomp.so.*
1205 %files -n libitm-32bit
1206 %license COPYING3 COPYING.RUNTIME
1207 %defattr(-,root,root)
1208 %{libsubdir}/32/libitm.so.*
1211 %files -n libgfortran-32bit
1212 %defattr(-,root,root)
1213 %dir %{libsubdir}/32/finclude
1214 %{libsubdir}/32/libgfortran.so.*
1215 %{libsubdir}/32/finclude/*
1217 %ifarch %quadmath_arch
1218 %files -n libquadmath-32bit
1219 %license COPYING.LIB
1220 %defattr(-,root,root)
1221 %{libsubdir}/32/libquadmath.so.*
1222 %{libsubdir}/32/libquadmath.a
1226 %files -n libubsan-32bit
1227 %manifest gcc.manifest
1228 %license libsanitizer/LICENSE.TXT
1229 %defattr(-,root,root)
1230 %{libsubdir}/32/libubsan.so.*
1233 %files -n libstdc++-32bit
1234 %manifest gcc.manifest
1235 %license COPYING3 COPYING.RUNTIME
1236 %defattr(-,root,root)
1237 %{libsubdir}/32/libstdc++.so.*
1238 %exclude %{libsubdir}/32/libstdc++.so.*-gdb.py
1240 %files -n libstdc++-devel-32bit
1241 %defattr(-,root,root)
1242 %{libsubdir}/32/libstdc++.so.*-gdb.py
1245 %files -n sanitizer-sources
1246 %defattr(-,root,root,-)
1247 /src/libsanitizer.tar.bz
1252 %manifest gcc.manifest
1253 %license COPYING.LIB
1254 %defattr(-,root,root)
1262 %ifarch %hwasan_arch
1263 %{libsubdir}/libhwasan.a
1269 %{libdir}/libubsan.a
1274 %{libdir}/libatomic.a
1275 %{libsubdir}/libcaf_single.a
1277 %{libsubdir}/32/libgomp.a
1279 %{libsubdir}/32/libitm.a
1282 %{libsubdir}/32/libasan.a
1285 %{libsubdir}/32/libubsan.a
1287 %{libsubdir}/32/libatomic.a
1288 %{libsubdir}/32/libcaf_single.a
1294 %defattr(-,root,root)
1295 %doc testresults/test_summary.txt
1299 %{?gcc_dump_configure:
1300 %files configure-dump
1301 %manifest gcc.manifest
1302 %{_datadir}/gcc-%{version}-%{release}-%_project-%_repository.db