2 # spec file for package gcc
4 # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 # Copyright (c) 2015-2020 Tizen
7 # All modifications and additions to the file contributed by third parties
8 # remain the property of their copyright owners, unless otherwise agreed
9 # upon. The license for this file, and modifications and additions to the
10 # file, is the same license as for the pristine package itself (unless the
11 # license for the pristine package is not an Open Source License, in which
12 # case the license is the MIT License). An "Open Source License" is a
13 # license that conforms to the Open Source Definition (Version 1.9)
14 # published by the Open Source Initiative.
16 # Please submit bugfixes or comments via http://bugs.tizen.org/
18 # we use %%{?macro: ... } as it is more compact
21 %define gcc_run_tests 1
24 %if 0%{?dump_configure}
25 %define gcc_dump_configure 1
28 # Enable this when testing on device to:
29 # 1. Enable macro to turn on testsuite building ('gcc_run_tests 1')
30 # 2. Keep 'obj/' folder in build stage as we do not want to rebuild all gcc
31 # again on device after invoking rpmbuild --short-circuit -bc ...
32 # 3. Skip configure and make commands and go directly to 'make check'
33 %if 0%{?run_tests_on_device}
34 %define gcc_run_tests 1
35 %define gcc_keep_build_dir 1
36 %define gcc_skip_configure 1
37 %define gcc_skip_make 1
40 # Exit right after 'make ..' step to keep all object files produced by gcc build
41 %if 0%{?exit_on_make_finish}
42 %define gcc_exit_on_make_finish 1
45 # Bootstrap build constrains for ASan config
46 %if 0%{?asanbootstrap}
47 %ifarch %arm aarch64 # or #if 0#{?qemu_user_space_build}
48 %{error:"'asanbootstrap' supposed to be used with i586/x86_64 arch"}
49 # The #error macro primitive cannot stop the build because macros are context
50 # free, lazily expanded whereever they are needed, not only during build.
51 # Use non-existing define for now to abort the build.
54 # We'll get 2 libasan runtime conflict: preloaded one and another from build dir.
56 %{error:"'asanbootstrap' could not be used with sanitized environment."}
57 %{error:"Use 'asanbootstrap' without defined 'asan'"}
62 %define quadmath_arch %ix86 x86_64 ia64
63 %define tsan_arch x86_64 aarch64
64 %define asan_arch x86_64 %ix86 ppc ppc64 %sparc %arm aarch64
65 %define itm_arch x86_64 %ix86 %arm ppc ppc64 ppc64le s390 s390x %sparc aarch64
66 %define atomic_arch x86_64 %ix86 %arm aarch64 ppc ppc64 ppc64le s390 s390x %sparc m68k
67 %define lsan_arch x86_64 aarch64
68 %define hwasan_arch aarch64
69 %define ubsan_arch x86_64 %ix86 ppc ppc64 %arm aarch64
88 %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
90 %define target_cpu %{?cross}%{!?cross:%{ARCH}}
91 %define target_abi %{?cross:%{?armv7l:eabi}%{?armv7hl:eabihf}}%{!?cross:%{?ABI}}
93 %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi}
94 %define libdir %{!?cross:%{_libdir}}%{?cross:%{_prefix}/lib%{?aarch64:64}}
95 %define libsubdir %{libdir}/gcc/%{target_arch}/%{version}
97 Name: gcc%{?cross:-%{cross}}
98 # With generated files in src we could drop the following
101 BuildRequires: gettext-devel
102 BuildRequires: makeinfo
103 ## until here, but at least renaming and patching info files breaks this
104 BuildRequires: gcc-c++
105 BuildRequires: zlib-devel
106 BuildRequires: xz-devel
108 BuildRequires: glibc-devel-32bit
111 %{?cross:BuildRequires: binutils-%{cross}}
112 # here we use %%if because OBS spec parser cannot expand
113 # %%{?macro:...} correctly
114 %if 0%{?gcc_run_tests}
115 BuildRequires: dejagnu
116 BuildRequires: expect
118 %if 0%{?gcc_dump_configure}
119 BuildRequires: configure-dumper
121 URL: http://gcc.gnu.org/
124 Source: gcc-%{version}.tar.bz2
125 Source10: gmp-6.2.1.tar.bz2
126 Source11: mpfr-4.2.0.tar.bz2
127 Source12: mpc-1.3.1.tar.gz
128 Source13: isl-0.22.tar.bz2
129 Source20: gcc.manifest
130 Group: Development/Building
131 Summary: The GNU C Compiler and Support Files
133 %{?cross:ExcludeArch: %{cross}}
135 Core package for the GNU Compiler Collection, including the C language
139 Summary: The GNU C++ Compiler
141 Group: Development/Languages
143 This package contains the GNU compiler for C++.
145 %package -n libstdc++
146 Summary: The standard C++ shared library
147 License: GPL-3.0-with-GCC-exception
148 Group: Development/Building
149 %description -n libstdc++
150 The standard C++ library, needed for dynamically linked C++ programs.
151 %post -n libstdc++ -p /sbin/ldconfig
152 %postun -n libstdc++ -p /sbin/ldconfig
154 %package -n libstdc++-devel
155 Summary: Include Files and Libraries mandatory for Development
156 License: GPL-3.0-with-GCC-exception
157 Group: Development/Building
158 %description -n libstdc++-devel
159 This package contains all the headers and libraries of the standard C++
160 library. It is needed for compiling C++ code.
163 Summary: C compiler runtime library
164 License: GPL-3.0-with-GCC-exception
165 Group: Development/Building
166 %description -n libgcc
167 Libgcc is needed for dynamically linked C programs.
168 %post -n libgcc -p /sbin/ldconfig
169 %postun -n libgcc -p /sbin/ldconfig
172 Summary: The GNU compiler collection OpenMP runtime library
173 License: GPL-3.0-with-GCC-exception
174 Group: Development/Building
175 %description -n libgomp
176 This is the OpenMP runtime library needed by OpenMP enabled programs
177 that were built with the -fopenmp compiler option and by programs that
178 were auto-parallelized via the -ftree-parallelize-loops compiler
180 %post -n libgomp -p /sbin/ldconfig
181 %postun -n libgomp -p /sbin/ldconfig
184 Summary: GNU Objective C Compiler
186 Group: Development/Languages
188 This package contains the GNU Objective C compiler. Objective C is an
189 object oriented language, created by Next Inc. and used in their
190 Nextstep OS. The source code is available in the gcc package.
193 Summary: Library for the GNU Objective C Compiler
194 License: GPL-3.0-with-GCC-exception
195 Group: Development/Building
196 %description -n libobjc
197 The library for the GNU Objective C compiler.
198 %post -n libobjc -p /sbin/ldconfig
199 %postun -n libobjc -p /sbin/ldconfig
202 Summary: GNU C Compiler plugin for GDB
203 License: GPL-3.0-with-GCC-exception
204 Group: Development/Building
205 %description -n libcc1
206 The GCC plugin for GDB
207 %post -n libcc1 -p /sbin/ldconfig
208 %postun -n libcc1 -p /sbin/ldconfig
211 Summary: GNU Objective C++ Compiler
213 Group: Development/Languages
215 This package contains the GNU Objective C++ compiler. Objective C++ is an
216 object oriented language, created by Next Inc. and used in their
217 Nextstep OS. The source code is available in the gcc package.
220 Summary: The GCC Preprocessor
222 Group: Development/Languages
224 This Package contains just the preprocessor that is used by the X11
228 Summary: GNU Ada95 Compiler Based on GCC (GNAT)
230 Group: Development/Languages
232 This package contains an Ada95 compiler and associated development
233 tools based on the GNU GCC technology. Ada95 is the object oriented
234 successor of the Ada83 language. To build this package from source you
235 must have installed a binary version to bootstrap the compiler.
238 Summary: GNU Ada Runtime Libraries
239 License: GPL-3.0-with-GCC-exception
240 Group: Development/Languages
241 %description -n libada
242 This package contains the shared libraries required to run programs
243 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
244 shared libraries. It also contains the shared libraries for the
245 Implementation of the Ada Semantic Interface Specification (ASIS), the
246 implementation of Distributed Systems Programming (GLADE) and the Posix
247 1003.5 Binding (Florist).
248 %post -n libada -p /sbin/ldconfig
249 %postun -n libada -p /sbin/ldconfig
252 Summary: The GNU Fortran Compiler and Support Files
254 Group: Development/Languages
256 This is the Fortran compiler of the GNU Compiler Collection (GCC).
258 %package -n libgfortran
259 Summary: The GNU Fortran Compiler Runtime Library
260 License: GPL-3.0-with-GCC-exception
261 Group: Development/Languages
262 %description -n libgfortran
263 The runtime library needed to run programs compiled with the Fortran compiler
264 of the GNU Compiler Collection (GCC).
265 %post -n libgfortran -p /sbin/ldconfig
266 %postun -n libgfortran -p /sbin/ldconfig
268 %package -n libquadmath
269 Summary: The GNU Fortran Compiler Quadmath Runtime Library
271 Group: Development/Languages
272 %description -n libquadmath
273 The runtime library needed to run programs compiled with the Fortran compiler
274 of the GNU Compiler Collection (GCC) and quadruple precision floating point
276 %post -n libquadmath -p /sbin/ldconfig
277 %postun -n libquadmath -p /sbin/ldconfig
280 Summary: The GNU Compiler Transactional Memory Runtime Library
281 License: GPL-3.0-with-GCC-exception
282 Group: Development/Languages
283 %description -n libitm
284 The runtime library needed to run programs compiled with the
285 -fgnu-tm option of the GNU Compiler Collection (GCC).
286 %post -n libitm -p /sbin/ldconfig
287 %postun -n libitm -p /sbin/ldconfig
290 Summary: The GNU Compiler Address Sanitizer Runtime Library
292 Group: Development/Languages
293 %description -n libasan
294 The runtime library needed to run programs compiled with the
295 -fsanitize=address option of the GNU Compiler Collection (GCC).
296 %post -n libasan -p /sbin/ldconfig
297 %postun -n libasan -p /sbin/ldconfig
299 %package -n libhwasan
300 Summary: The GNU Compiler Hardware-assisted Address Sanitizer Runtime Library
302 Group: Development/Languages
303 %description -n libhwasan
304 The runtime library needed to run programs compiled with the
305 -fsanitize=address option of the GNU Compiler Collection (GCC).
306 %post -n libhwasan -p /sbin/ldconfig
307 %postun -n libhwasan -p /sbin/ldconfig
310 Summary: The GNU Compiler Thread Sanitizer Runtime Library
312 Group: Development/Languages
313 %description -n libtsan
314 The runtime library needed to run programs compiled with the
315 -fsanitize=thread option of the GNU Compiler Collection (GCC).
316 %post -n libtsan -p /sbin/ldconfig
317 %postun -n libtsan -p /sbin/ldconfig
319 %package -n libatomic
320 Summary: The GNU Compiler Atomic Operations Runtime Library
321 License: GPL-3.0-with-GCC-exception
322 Group: Development/Languages
323 %description -n libatomic
324 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
325 %post -n libatomic -p /sbin/ldconfig
326 %postun -n libatomic -p /sbin/ldconfig
329 Summary: The GNU Compiler Leak Sanitizer Runtime Library
331 Group: Development/Languages
332 %description -n liblsan
333 The runtime library needed to run programs compiled with the
334 -fsanitize=leak option of the GNU Compiler Collection (GCC).
335 %post -n liblsan -p /sbin/ldconfig
336 %postun -n liblsan -p /sbin/ldconfig
339 Summary: The GNU Compiler Undefined Sanitizer Runtime Library
341 Group: Development/Languages
342 %description -n libubsan
343 The runtime library needed to run programs compiled with the
344 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
345 %post -n libubsan -p /sbin/ldconfig
346 %postun -n libubsan -p /sbin/ldconfig
349 Summary: The GNU Compiler Vtable Verifier Runtime Library
351 Group: Development/Languages
352 %description -n libvtv
353 The runtime library needed to run programs compiled with the
354 -fvtable-verify option of the GNU Compiler Collection (GCC).
355 %post -n libvtv -p /sbin/ldconfig
356 %postun -n libvtv -p /sbin/ldconfig
359 Summary: Java Runtime Library for gcc
360 License: GPL-2.0-with-classpath-exception
361 Group: Development/Building
362 %description -n libgcj
363 This library is needed if you want to use the GNU Java compiler, gcj.
364 Source code for this package is in gcc.
365 %post -n libgcj -p /sbin/ldconfig
366 %postun -n libgcj -p /sbin/ldconfig
369 Summary: The GNU Java Compiler
371 Group: Development/Languages
373 The Java compiler from the GCC-tools-suite.
375 %package -n libgcj_bc
376 Summary: Fake library for BC-ABI compatibility.
377 License: GPL-2.0-with-classpath-exception
378 Group: Development/Languages
379 %description -n libgcj_bc
380 A fake library that is used at link time only. It ensures that
381 binaries built with the BC-ABI link against a constant SONAME.
382 This way, BC-ABI binaries continue to work if the SONAME underlying
385 %package -n libgcj-jar
386 Summary: Java runtime library (jar files).
387 License: GPL-2.0-with-classpath-exception
388 Group: Development/Languages
389 %description -n libgcj-jar
390 These are the jar files that go along with the gcj front end to gcc.
392 %package -n libgcj-devel
393 Summary: Include Files and Libraries mandatory for Development.
394 License: GPL-2.0-with-classpath-exception
395 Group: Development/Languages
396 %description -n libgcj-devel
397 This package contains all necessary include files and libraries needed
398 to develop applications that require these.
401 Summary: Java Bytecode Interpreter for gcc
402 License: GPL-2.0-with-classpath-exception
403 Group: Development/Languages
404 %description -n gcc-gij
405 This package contains the java bytecode interpreter gij and related tools.
408 Summary: Foreign Function Interface library
409 License: BSD-3-Clause
410 Group: Development/Building
411 %description -n libffi
412 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.
413 %post -n libffi -p /sbin/ldconfig
414 %postun -n libffi -p /sbin/ldconfig
416 %package -n libffi-devel
417 Summary: Foreign Function Interface library development files
418 License: BSD 3-Clause
419 Group: Development/Building
420 %description -n libffi-devel
421 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.
424 Summary: GNU Go Compiler
426 Group: Development/Languages
428 This package contains a Go compiler and associated development
429 files based on the GNU GCC technology.
432 Summary: GNU Go compiler runtime library
433 License: BSD-3-Clause
434 Group: Development/Languages
435 %description -n libgo
436 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.
437 %post -n libgo -p /sbin/ldconfig
438 %postun -n libgo -p /sbin/ldconfig
442 Summary: Testsuite results
443 License: Public Domain
444 Group: Development/Languages
445 %description testresults
446 Results from running the gcc and target library testsuites.
449 %package -n gcc-32bit
450 Summary: The GNU C Compiler 32bit support
451 Group: Development/Building
452 %description -n gcc-32bit
453 This package contains 32bit support for the GNU Compiler Collection.
455 %package -n libstdc++-devel-32bit
456 Summary: Include Files and Libraries mandatory for Development
457 License: GPL-3.0-with-GCC-exception
458 Group: Development/Building
459 %description -n libstdc++-devel-32bit
460 This package contains all the headers and libraries of the standard C++
461 library. It is needed for compiling C++ code.
463 %package -n libgcc-32bit
464 Summary: C compiler runtime library
465 License: GPL-3.0-with-GCC-exception
466 Group: Development/Building
467 %description -n libgcc-32bit
468 Libgcc is needed for dynamically linked C programs.
469 %post -n libgcc-32bit -p /sbin/ldconfig
470 %postun -n libgcc-32bit -p /sbin/ldconfig
472 %package -n libgomp-32bit
473 Summary: The GNU compiler collection OpenMP runtime library
474 License: GPL-3.0-with-GCC-exception
475 Group: Development/Building
476 %description -n libgomp-32bit
477 This is the OpenMP runtime library needed by OpenMP enabled programs
478 that were built with the -fopenmp compiler option and by programs that
479 were auto-parallelized via the -ftree-parallelize-loops compiler
481 %post -n libgomp-32bit -p /sbin/ldconfig
482 %postun -n libgomp-32bit -p /sbin/ldconfig
484 %package -n libstdc++-32bit
485 Summary: The standard C++ shared library
486 License: GPL-3.0-with-GCC-exception
487 Group: Development/Building
488 %description -n libstdc++-32bit
489 The standard C++ library, needed for dynamically linked C++ programs.
490 %post -n libstdc++-32bit -p /sbin/ldconfig
491 %postun -n libstdc++-32bit -p /sbin/ldconfig
494 Summary: GNU Objective C Compiler
496 Group: Development/Languages
497 %description objc-32bit
498 This package contains the GNU Objective C compiler. Objective C is an
499 object oriented language, created by Next Inc. and used in their
500 Nextstep OS. The source code is available in the gcc package.
502 %package -n libobjc-32bit
503 Summary: Library for the GNU Objective C Compiler
504 License: GPL-3.0-with-GCC-exception
505 Group: Development/Building
506 %description -n libobjc-32bit
507 The library for the GNU Objective C compiler.
508 %post -n libobjc-32bit -p /sbin/ldconfig
509 %postun -n libobjc-32bit -p /sbin/ldconfig
512 Summary: GNU Ada95 Compiler Based on GCC (GNAT)
514 Group: Development/Languages
515 %description ada-32bit
516 This package contains an Ada95 compiler and associated development
517 tools based on the GNU GCC technology. Ada95 is the object oriented
518 successor of the Ada83 language. To build this package from source you
519 must have installed a binary version to bootstrap the compiler.
521 %package -n libada-32bit
522 Summary: GNU Ada Runtime Libraries
523 License: GPL-3.0-with-GCC-exception
524 Group: Development/Languages
525 %description -n libada-32bit
526 This package contains the shared libraries required to run programs
527 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
528 shared libraries. It also contains the shared libraries for the
529 Implementation of the Ada Semantic Interface Specification (ASIS), the
530 implementation of Distributed Systems Programming (GLADE) and the Posix
531 1003.5 Binding (Florist).
532 %post -n libada-32bit -p /sbin/ldconfig
533 %postun -n libada-32bit -p /sbin/ldconfig
535 %package fortran-32bit
536 Summary: The GNU Fortran Compiler and Support Files
538 Group: Development/Languages
539 %description fortran-32bit
540 This is the Fortran compiler of the GNU Compiler Collection (GCC).
542 %package -n libgfortran-32bit
543 Summary: The GNU Fortran Compiler Runtime Library
544 License: GPL-3.0-with-GCC-exception
545 Group: Development/Languages
546 %description -n libgfortran-32bit
547 The runtime library needed to run programs compiled with the Fortran compiler
548 of the GNU Compiler Collection (GCC).
549 %post -n libgfortran-32bit -p /sbin/ldconfig
550 %postun -n libgfortran-32bit -p /sbin/ldconfig
552 %package -n libquadmath-32bit
553 Summary: The GNU Fortran Compiler Quadmath Runtime Library
555 Group: Development/Languages
556 %description -n libquadmath-32bit
557 The runtime library needed to run programs compiled with the Fortran compiler
558 of the GNU Compiler Collection (GCC) and quadruple precision floating point
560 %post -n libquadmath-32bit -p /sbin/ldconfig
561 %postun -n libquadmath-32bit -p /sbin/ldconfig
563 %package -n libitm-32bit
564 Summary: The GNU Compiler Transactional Memory Runtime Library
565 License: GPL-3.0-with-GCC-exception
566 Group: Development/Languages
567 %description -n libitm-32bit
568 The runtime library needed to run programs compiled with the
569 -fgnu-tm option of the GNU Compiler Collection (GCC).
570 %post -n libitm-32bit -p /sbin/ldconfig
571 %postun -n libitm-32bit -p /sbin/ldconfig
573 %package -n libasan-32bit
574 Summary: The GNU Compiler Address Sanitizer Runtime Library
576 Group: Development/Languages
577 %description -n libasan-32bit
578 The runtime library needed to run programs compiled with the
579 -fsanitize=address option of the GNU Compiler Collection (GCC).
580 %post -n libasan-32bit -p /sbin/ldconfig
581 %postun -n libasan-32bit -p /sbin/ldconfig
583 %package -n liblsan-32bit
584 Summary: The GNU Compiler Address Sanitizer Runtime Library
586 Group: Development/Languages
587 %description -n liblsan-32bit
588 The runtime library needed to run programs compiled with the
589 -fsanitize=leak option of the GNU Compiler Collection (GCC).
590 %post -n liblsan-32bit -p /sbin/ldconfig
591 %postun -n liblsan-32bit -p /sbin/ldconfig
593 %package -n libtsan-32bit
594 Summary: The GNU Compiler Thread Sanitizer Runtime Library
596 Group: Development/Languages
597 %description -n libtsan-32bit
598 The runtime library needed to run programs compiled with the
599 -fsanitize=thread option of the GNU Compiler Collection (GCC).
600 %post -n libtsan-32bit -p /sbin/ldconfig
601 %postun -n libtsan-32bit -p /sbin/ldconfig
603 %package -n libatomic-32bit
604 Summary: The GNU Compiler Atomic Operations Runtime Library
605 License: GPL-3.0-with-GCC-exception
606 Group: Development/Languages
607 %description -n libatomic-32bit
608 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
609 %post -n libatomic-32bit -p /sbin/ldconfig
610 %postun -n libatomic-32bit -p /sbin/ldconfig
612 %package -n libubsan-32bit
613 Summary: The GNU Compiler Undefined Sanitizer Runtime Library
615 Group: Development/Languages
616 %description -n libubsan-32bit
617 The runtime library needed to run programs compiled with the
618 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
619 %post -n libubsan-32bit -p /sbin/ldconfig
620 %postun -n libubsan-32bit -p /sbin/ldconfig
622 %package -n libvtv-32bit
623 Summary: The GNU Compiler Vtable Verifier Runtime Library
625 Group: Development/Languages
626 %description -n libvtv-32bit
627 The runtime library needed to run programs compiled with the
628 -fvtable-verify option of the GNU Compiler Collection (GCC).
629 %post -n libvtv-32bit -p /sbin/ldconfig
630 %postun -n libvtv-32bit -p /sbin/ldconfig
632 %package -n libffi-32bit
633 Summary: Foreign Function Interface library
634 License: BSD-3-Clause
635 Group: Development/Building
636 %description -n libffi-32bit
637 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.
638 %post -n libffi-32bit -p /sbin/ldconfig
639 %postun -n libffi-32bit -p /sbin/ldconfig
641 %package -n libffi-devel-32bit
642 Summary: Foreign Function Interface library development files
643 License: BSD 3-Clause
644 Group: Development/Building
645 %description -n libffi-devel-32bit
646 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.
649 Summary: GNU Go Compiler
651 Group: Development/Languages
652 %description go-32bit
653 This package contains a Go compiler and associated development
654 files based on the GNU GCC technology.
656 %package -n libgo-32bit
657 Summary: GNU Go compiler runtime library
658 License: BSD-3-Clause
659 Group: Development/Languages
660 %description -n libgo-32bit
661 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.
662 %post -n libgo-32bit -p /sbin/ldconfig
663 %postun -n libgo-32bit -p /sbin/ldconfig
665 %package plugin-devel
666 Summary: GNU GCC Plugin development files
668 Group: Development/Languages
669 %description plugin-devel
670 This package contains GCC Plugin development files needed for compiler
673 %package -n sanitizer-sources
674 Summary: Sanitizer family tools sources
676 Group: Development/Tools
679 %description -n sanitizer-sources
680 Sanitizer family tools sources for external tools.
683 %package devel-static
684 Summary: GNU GCC static libraries
686 Group: Development/Languages
687 %description devel-static
688 This package contains static libraries from GCC
691 %{?gcc_dump_configure:
692 %package configure-dump
693 Summary: GNU GCC configure dump
695 Group: Development/Languages
696 %description configure-dump
697 This package contains dump of configure variables of GCC
701 %setup -q -n gcc-%{version}
707 ln -sf mpfr-4.2.0 mpfr
713 %global gcc_datestamp `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/DATESTAMP`
719 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -marm -Wa,-mimplicit-it=arm -fasynchronous-unwind-tables"
722 %{!?gcc_keep_build_dir:
727 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'
728 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D__USE_FORTIFY_LEVEL=0"`
729 RPM_OPT_FLAGS=${RPM_OPT_FLAGS/-fstack-protector-strong/}
730 RPM_OPT_FLAGS=${RPM_OPT_FLAGS/-fstack-protector/}
733 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
734 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(sse\|fpmath\)[^ ]*//g'`
736 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ */ /g'`
738 # -Wall is stripped off now, so -Wformat will not turn on implicitly for
739 # "-Wformat-.." option group, causing additional build warnings and testsuite
740 # FAIL ("test for excess errors" type).
741 # Insert "-Wformat" if we find "-Wformat-..."
742 if [ ! -z "$(echo $RPM_OPT_FLAGS | grep -o "\B\-Wformat\-")" ]; then
743 if [ -z "$(echo $RPM_OPT_FLAGS | grep -Po "\B\-Wformat(\s|\Z)")" ]; then
744 RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e "s/-Wformat-/-Wformat -Wformat-/")
748 %{?asan: RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS -DASAN_INIT_FIRST) }
749 %{?asan_shadow_scale: RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS -Wp,-DASAN_SHADOW_SCALE=%{asan_shadow_scale})}
751 %ifarch armv7l armv7hl aarch64
752 %undefine gcc_profiledbootstrap
756 ## Support DA build with armv8 cpu in 32bit mode: prevent Werror on sqrt function
757 # Extract current march
758 cur_arch=$(echo ${RPM_OPT_FLAGS} | sed -e 's/.*-march=\([^[:space:]]\+\).*/\1/')
759 # And apply it to libatomic to prevent conflict
760 (echo ${RPM_OPT_FLAGS} | grep '\-march=armv8') && \
761 sed -e "/@ARCH_ARM_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS/s/-march=[^[:space:]]\+/-march=${cur_arch}/" -i libatomic/Makefile.in
766 %{!?gcc_skip_configure:
767 %{?gcc_dump_configure:patch_configure.pl ..} # Add debug prints into configure
768 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
769 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
771 --prefix=%{_prefix} \
772 --infodir=%{_infodir} \
773 --mandir=%{_mandir} \
775 --libexecdir=%{libdir} \
776 --enable-languages=c,c++,fortran \
777 --enable-checking=release \
779 %{!?gcc_profiledbootstrap:--disable-bootstrap} \
784 --with-slibdir=%{libdir} \
787 --enable-__cxa_atexit \
788 --enable-libstdcxx-allocator=new \
789 --enable-version-specific-runtime-libs \
790 --enable-linker-build-id \
791 --without-system-libunwind \
792 --enable-threads=posix \
798 --enable-libgfortran \
799 %{?asanbootstrap:--enable-bootstrap --with-build-config=bootstrap-asan} \
801 --with-arch=armv7-a \
802 --with-tune=cortex-a8 \
803 --disable-sjlj-exceptions \
806 --with-arch=armv7-a+fp \
807 --with-tune=cortex-a8 \
809 --disable-sjlj-exceptions \
813 --with-arch=armv8-a \
814 --disable-sjlj-exceptions \
817 --with-arch-32=i586 \
818 --with-tune=generic \
822 --with-arch-32=i586 \
823 --with-tune=generic \
830 --with-arch=armv7-a \
831 --with-tune=cortex-a8 \
832 --disable-sjlj-exceptions \
835 --with-arch=armv7-a+fp \
836 --with-tune=cortex-a8 \
838 --disable-sjlj-exceptions \
842 --with-arch=armv8-a \
843 --disable-sjlj-exceptions \
846 --disable-libgfortran \
847 --disable-libquadmath \
849 --disable-libatomic \
850 --disable-libstdc++-v3 \
851 --disable-libsanitizer \
854 --with-bugurl="http://bugs.tizen.org/" \
855 --with-pkgversion="Tizen GCC %{version} %{gcc_datestamp} %{release}" \
856 --target=%{target_arch} \
857 --host=%{host_arch} \
862 # During native compiler build with qemu-accel enabled we have to provide
863 # path to accelerated lto_plugin.so to prevent
864 # error loading plugin: /home/abuild/rpmbuild/BUILD/gcc-12.2.0/obj/./gcc/liblto_plugin.so: wrong ELF class: ELFCLASS32
865 # So we have to update:
869 # - RAW_CXX_FOR_TARGET
870 # And provide path to liblto_plugin inside /emul via -B option
871 # Changing configure.ac and adding a dependency from qemu-accel there is not
872 # reasonable, so here we patch a Makefile after configure is competed
874 [[ -e '/emul' ]] && \
875 sed -e '/^\(G\?CC_FOR_TARGET\)=\|^\(\(RAW_\)\?CXX_FOR_TARGET\)=/s#\(xg\(cc\|++\)\)#\1 -B/emul%{libsubdir}/#' -i Makefile
879 make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} %{!?cross:%{?gcc_profiledbootstrap:profiledbootstrap}} %{?cross:all-host}
880 %{?gcc_dump_configure:
881 dump_configure.pl .. . \
883 --project-version %{version} \
884 --out_db gcc-%{version}-%{release}-%_project-%_repository.db
888 %{?gcc_exit_on_make_finish:
894 # asan needs a whole shadow address space
895 ulimit -v unlimited || true
896 make -k check %{?_smp_mflags} || true
898 ../contrib/test_summary | tee ../testresults/test_summary.txt
899 for tool in $(find -name '*.sum' -exec basename {} \; | sort -u | sed -e 's/.sum//'); do
900 ../contrib/dg-extract-results.sh -t $tool $(find -name '*.sum') | tee -a ../testresults/test_summary.txt
907 make install%{?cross:-host} DESTDIR=$RPM_BUILD_ROOT
909 %{?gcc_dump_configure:
910 install -D -m 0644 gcc-%{version}-%{release}-%_project-%_repository.db %{buildroot}%{_datadir}/gcc-%{version}-%{release}-%_project-%_repository.db
914 find . \( -name "*.sum" -o -name "*.log" -a \! -name "config.log" \) -exec tar -rf testresults.tar {} \;
915 mkdir -p ../testresults && tar -xf testresults.tar -C ../testresults
916 find ../testresults/ -type f -exec chmod 644 {} \;
920 rm -rf %{buildroot}/%{_datadir}/locale
922 #remove everything we don't need
923 rm -rf %{buildroot}/%{libsubdir}/install-tools
924 find %{buildroot}/ -name "*.la" -delete
927 ln -s gcc %{buildroot}%{_bindir}/cc
928 mv %{buildroot}%{libsubdir}/libstdc++.so*-gdb.py %{buildroot}%{_datadir}/gcc-%{version}/python/libstdcxx/
930 # legacy preprocessor
931 mkdir -p %{buildroot}/lib
932 ln -s %{_bindir}/cpp %{buildroot}/lib/cpp
934 # 32-bit libgcc in multilib configuration
936 mv %{buildroot}%{_prefix}/lib/libgcc_s.so* %{buildroot}%{libsubdir}/32/
939 # move libraries to libdir
940 for lib in asan atomic gfortran gomp cc1 itm lsan quadmath stdc++ supc++ tsan ubsan
942 [ -e %{buildroot}%{libsubdir}/lib$lib.a ] && mv %{buildroot}%{libsubdir}/lib$lib.a %{buildroot}%{libdir}/
943 [ -e %{buildroot}%{libsubdir}/lib$lib.so ] && mv %{buildroot}%{libsubdir}/lib$lib.so* %{buildroot}%{libdir}/
948 rm -rf %{buildroot}/%{libsubdir}/include-fixed
949 rm -rf %{buildroot}/%{libsubdir}/include
954 tar -czf libsanitizer.tar.bz libsanitizer
955 mkdir -p %{buildroot}/src
956 mv -v libsanitizer.tar.bz %{buildroot}/src
960 %manifest gcc.manifest
961 %defattr(-,root,root)
974 %{_bindir}/gcc-ranlib
976 %{_bindir}/%{target_arch}-gcc
977 %{_bindir}/%{target_arch}-gcc-%{version}
978 %{_bindir}/%{target_arch}-gcc-ar
979 %{_bindir}/%{target_arch}-gcc-nm
980 %{_bindir}/%{target_arch}-gcc-ranlib
981 %{libsubdir}/collect2
983 %{libsubdir}/lto-wrapper
984 %{libsubdir}/liblto_plugin.so*
985 %{libsubdir}/g++-mapper-server
986 %{libsubdir}/include-fixed/*
987 %{libsubdir}/include/*.h
992 %{libsubdir}/include/sanitizer/*
994 %exclude %{libdir}/libasan.so
997 %exclude %{libdir}/liblsan.so
1000 %exclude %{libdir}/libtsan.so
1004 %defattr(-,root,root)
1005 %{libsubdir}/cc1plus
1008 %{_bindir}/%{target_arch}-g++
1009 %{_bindir}/%{target_arch}-c++
1012 %manifest gcc.manifest
1013 %license COPYING3 COPYING.RUNTIME
1014 %defattr(-,root,root)
1015 %{libdir}/libstdc++.so.*
1017 %files -n libstdc++-devel
1018 %defattr(-,root,root)
1019 %{libdir}/libstdc++.so
1020 %{libdir}/libstdc++.a
1021 %{libdir}/libsupc++.a
1022 %{libsubdir}/include/c++/*
1023 %{libsubdir}/libstdc++fs.a
1024 %{_datadir}/gcc-%{version}/python/libstdcxx/*
1026 %{libsubdir}/32/libstdc++.a
1027 %{libsubdir}/32/libsupc++.a
1028 %{libsubdir}/32/libstdc++fs.a
1032 %manifest gcc.manifest
1033 %license COPYING3 COPYING.RUNTIME
1034 %defattr(-,root,root)
1035 %{libdir}/libgcc_s.so.*
1036 %{libsubdir}/libgcc.a
1037 %{libsubdir}/libgcc_eh.a
1038 %{libsubdir}/libgcov.a
1041 %manifest gcc.manifest
1042 %license COPYING3 COPYING.RUNTIME
1043 %defattr(-,root,root)
1044 %{libdir}/libgomp.so.*
1047 %manifest gcc.manifest
1048 %defattr(-,root,root)
1049 %{libdir}/libcc1.so.*
1053 %manifest gcc.manifest
1054 %license libsanitizer/LICENSE.TXT
1055 %defattr(-,root,root)
1056 %{libdir}/libasan.so*
1059 %ifarch %hwasan_arch
1061 %manifest gcc.manifest
1062 %license libsanitizer/LICENSE.TXT
1063 %defattr(-,root,root)
1064 %{libsubdir}/libhwasan.so*
1069 %manifest gcc.manifest
1070 %license libsanitizer/LICENSE.TXT
1071 %defattr(-,root,root)
1072 %{libdir}/liblsan.so*
1077 %manifest gcc.manifest
1078 %license libsanitizer/LICENSE.TXT
1079 %defattr(-,root,root)
1080 %{libdir}/libtsan.so*
1083 %ifarch %atomic_arch
1085 %manifest gcc.manifest
1086 %license COPYING3 COPYING.RUNTIME
1087 %defattr(-,root,root)
1088 %{libdir}/libatomic.so.*
1093 %manifest gcc.manifest
1094 %license COPYING3 COPYING.RUNTIME
1095 %defattr(-,root,root)
1096 %{libdir}/libitm.so.*
1101 %manifest gcc.manifest
1102 %license libsanitizer/LICENSE.TXT
1103 %defattr(-,root,root)
1104 %{libdir}/libubsan.so.*
1108 %defattr(-,root,root)
1109 %dir %{libsubdir}/finclude
1111 %{_bindir}/%{target_arch}-gfortran
1113 %{libsubdir}/finclude/*
1114 %{libdir}/libgfortran.a
1115 %{libdir}/libgfortran.so
1116 %{libsubdir}/libgfortran.spec
1117 %{libsubdir}/libcaf_single.a
1118 %ifarch %quadmath_arch
1119 %{libdir}/libquadmath.a
1120 %{libdir}/libquadmath.so
1123 %files -n libgfortran
1124 %defattr(-,root,root)
1125 %{libdir}/libgfortran.so.*
1127 %ifarch %quadmath_arch
1128 %files -n libquadmath
1129 %manifest gcc.manifest
1130 %license COPYING.LIB
1131 %defattr(-,root,root)
1132 %{libdir}/libquadmath.so.*
1133 %{libdir}/libquadmath.a
1137 %defattr(-,root,root)
1143 %defattr(-,root,root)
1144 %{libsubdir}/plugin/*
1148 %defattr(-,root,root)
1150 %{libsubdir}/32/*.so
1152 %{libsubdir}/32/*.spec
1155 %files -n libasan-32bit
1156 %manifest gcc.manifest
1157 %license libsanitizer/LICENSE.TXT
1158 %defattr(-,root,root)
1159 %{libsubdir}/32/libasan.so.*
1162 %ifarch %atomic_arch
1163 %files -n libatomic-32bit
1164 %manifest gcc.manifest
1165 %license COPYING3 COPYING.RUNTIME
1166 %defattr(-,root,root)
1167 %{libsubdir}/32/libatomic.so.*
1170 %files -n libgcc-32bit
1171 %manifest gcc.manifest
1172 %license COPYING3 COPYING.RUNTIME
1173 %defattr(-,root,root)
1174 %{libsubdir}/32/libgcc_s.so.*
1175 %{libsubdir}/32/libgcc.a
1176 %{libsubdir}/32/libgcc_eh.a
1177 %{libsubdir}/32/libgcov.a
1179 %files -n libgomp-32bit
1180 %manifest gcc.manifest
1181 %license COPYING3 COPYING.RUNTIME
1182 %defattr(-,root,root)
1183 %{libsubdir}/32/libgomp.so.*
1186 %files -n libitm-32bit
1187 %license COPYING3 COPYING.RUNTIME
1188 %defattr(-,root,root)
1189 %{libsubdir}/32/libitm.so.*
1192 %files -n libgfortran-32bit
1193 %defattr(-,root,root)
1194 %dir %{libsubdir}/32/finclude
1195 %{libsubdir}/32/libgfortran.so.*
1196 %{libsubdir}/32/finclude/*
1198 %ifarch %quadmath_arch
1199 %files -n libquadmath-32bit
1200 %license COPYING.LIB
1201 %defattr(-,root,root)
1202 %{libsubdir}/32/libquadmath.so.*
1203 %{libsubdir}/32/libquadmath.a
1207 %files -n libubsan-32bit
1208 %manifest gcc.manifest
1209 %license libsanitizer/LICENSE.TXT
1210 %defattr(-,root,root)
1211 %{libsubdir}/32/libubsan.so.*
1214 %files -n libstdc++-32bit
1215 %manifest gcc.manifest
1216 %license COPYING3 COPYING.RUNTIME
1217 %defattr(-,root,root)
1218 %{libsubdir}/32/libstdc++.so.*
1219 %exclude %{libsubdir}/32/libstdc++.so.*-gdb.py
1221 %files -n libstdc++-devel-32bit
1222 %defattr(-,root,root)
1223 %{libsubdir}/32/libstdc++.so.*-gdb.py
1226 %files -n sanitizer-sources
1227 %defattr(-,root,root,-)
1228 /src/libsanitizer.tar.bz
1233 %manifest gcc.manifest
1234 %license COPYING.LIB
1235 %defattr(-,root,root)
1243 %ifarch %hwasan_arch
1244 %{libsubdir}/libhwasan.a
1250 %{libdir}/libubsan.a
1255 %{libdir}/libatomic.a
1256 %{libsubdir}/libcaf_single.a
1258 %{libsubdir}/32/libgomp.a
1260 %{libsubdir}/32/libitm.a
1263 %{libsubdir}/32/libasan.a
1266 %{libsubdir}/32/libubsan.a
1268 %{libsubdir}/32/libatomic.a
1269 %{libsubdir}/32/libcaf_single.a
1275 %defattr(-,root,root)
1276 %doc testresults/test_summary.txt
1280 %{?gcc_dump_configure:
1281 %files configure-dump
1282 %manifest gcc.manifest
1283 %{_datadir}/gcc-%{version}-%{release}-%_project-%_repository.db