2 # spec file for package gcc6
4 # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 # Copyright (c) 2015 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
20 %define gcc_run_tests 1
23 %define quadmath_arch %ix86 x86_64 ia64
24 %define tsan_arch x86_64 aarch64
25 %define esan_arch x86_64 armv7l
26 %define asan_arch x86_64 %ix86 ppc ppc64 %sparc %arm aarch64
27 %define itm_arch x86_64 %ix86 %arm ppc ppc64 ppc64le s390 s390x %sparc aarch64
28 %define atomic_arch x86_64 %ix86 %arm aarch64 ppc ppc64 ppc64le s390 s390x %sparc m68k
29 %define lsan_arch x86_64 %ix86 %arm aarch64
30 %define ubsan_arch x86_64 %ix86 ppc ppc64 %arm aarch64
31 %define cilkrts_arch x86_64 %ix86
50 %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
52 %define target_cpu %{?cross}%{!?cross:%{ARCH}}
53 %define target_abi %{?cross:%{?armv7l:eabi}%{?armv7hl:eabihf}}%{!?cross:%{?ABI}}
55 %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi}
56 %define libdir %{!?cross:%{_libdir}}%{?cross:%{_prefix}/lib%{?aarch64:64}}
57 %define libsubdir %{libdir}/gcc/%{target_arch}/%{version}
59 Name: gcc%{?cross:-%{cross}}
60 # With generated files in src we could drop the following
63 BuildRequires: gettext-devel
64 BuildRequires: makeinfo
65 ## until here, but at least renaming and patching info files breaks this
66 BuildRequires: gcc-c++
67 BuildRequires: zlib-devel
69 BuildRequires: glibc-devel-32bit
72 %{?cross:BuildRequires: binutils-%{cross}}
73 # here we use %%if because OBS spec parser cannot expand
74 # %%{?macro:...} correctly
75 %if 0%{?gcc_run_tests}
76 BuildRequires: dejagnu
80 URL: http://gcc.gnu.org/
83 Source: gcc-%{version}.tar.bz2
84 Source10: gmp-6.1.1.tar.bz2
85 Source11: mpfr-3.1.5.tar.bz2
86 Source12: mpc-1.0.3.tar.gz
87 Source13: isl-0.17.1.tar.bz2
88 Source20: gcc.manifest
89 Group: Development/Building
90 Summary: The GNU C Compiler and Support Files
92 %{?cross:ExcludeArch: %{cross}}
94 Core package for the GNU Compiler Collection, including the C language
98 Summary: The GNU C++ Compiler
100 Group: Development/Languages
102 This package contains the GNU compiler for C++.
104 %package -n libstdc++
105 Summary: The standard C++ shared library
106 License: GPL-3.0-with-GCC-exception
107 Group: Development/Building
108 %description -n libstdc++
109 The standard C++ library, needed for dynamically linked C++ programs.
110 %post -n libstdc++ -p /sbin/ldconfig
111 %postun -n libstdc++ -p /sbin/ldconfig
113 %package -n libstdc++-devel
114 Summary: Include Files and Libraries mandatory for Development
115 License: GPL-3.0-with-GCC-exception
116 Group: Development/Building
117 %description -n libstdc++-devel
118 This package contains all the headers and libraries of the standard C++
119 library. It is needed for compiling C++ code.
122 Summary: C compiler runtime library
123 License: GPL-3.0-with-GCC-exception
124 Group: Development/Building
125 %description -n libgcc
126 Libgcc is needed for dynamically linked C programs.
127 %post -n libgcc -p /sbin/ldconfig
128 %postun -n libgcc -p /sbin/ldconfig
131 Summary: The GNU compiler collection OpenMP runtime library
132 License: GPL-3.0-with-GCC-exception
133 Group: Development/Building
134 %description -n libgomp
135 This is the OpenMP runtime library needed by OpenMP enabled programs
136 that were built with the -fopenmp compiler option and by programs that
137 were auto-parallelized via the -ftree-parallelize-loops compiler
139 %post -n libgomp -p /sbin/ldconfig
140 %postun -n libgomp -p /sbin/ldconfig
143 Summary: GNU Objective C Compiler
145 Group: Development/Languages
147 This package contains the GNU Objective C compiler. Objective C is an
148 object oriented language, created by Next Inc. and used in their
149 Nextstep OS. The source code is available in the gcc package.
152 Summary: Library for the GNU Objective C Compiler
153 License: GPL-3.0-with-GCC-exception
154 Group: Development/Building
155 %description -n libobjc
156 The library for the GNU Objective C compiler.
157 %post -n libobjc -p /sbin/ldconfig
158 %postun -n libobjc -p /sbin/ldconfig
161 Summary: GNU C Compiler plugin for GDB
162 License: GPL-3.0-with-GCC-exception
163 Group: Development/Building
164 %description -n libcc1
165 The GCC plugin for GDB
166 %post -n libcc1 -p /sbin/ldconfig
167 %postun -n libcc1 -p /sbin/ldconfig
170 Summary: GNU Objective C++ Compiler
172 Group: Development/Languages
174 This package contains the GNU Objective C++ compiler. Objective C++ is an
175 object oriented language, created by Next Inc. and used in their
176 Nextstep OS. The source code is available in the gcc package.
179 Summary: The GCC Preprocessor
181 Group: Development/Languages
183 This Package contains just the preprocessor that is used by the X11
187 Summary: GNU Ada95 Compiler Based on GCC (GNAT)
189 Group: Development/Languages
191 This package contains an Ada95 compiler and associated development
192 tools based on the GNU GCC technology. Ada95 is the object oriented
193 successor of the Ada83 language. To build this package from source you
194 must have installed a binary version to bootstrap the compiler.
197 Summary: GNU Ada Runtime Libraries
198 License: GPL-3.0-with-GCC-exception
199 Group: Development/Languages
200 %description -n libada
201 This package contains the shared libraries required to run programs
202 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
203 shared libraries. It also contains the shared libraries for the
204 Implementation of the Ada Semantic Interface Specification (ASIS), the
205 implementation of Distributed Systems Programming (GLADE) and the Posix
206 1003.5 Binding (Florist).
207 %post -n libada -p /sbin/ldconfig
208 %postun -n libada -p /sbin/ldconfig
211 Summary: The GNU Fortran Compiler and Support Files
213 Group: Development/Languages
215 This is the Fortran compiler of the GNU Compiler Collection (GCC).
217 %package -n libgfortran
218 Summary: The GNU Fortran Compiler Runtime Library
219 License: GPL-3.0-with-GCC-exception
220 Group: Development/Languages
221 %description -n libgfortran
222 The runtime library needed to run programs compiled with the Fortran compiler
223 of the GNU Compiler Collection (GCC).
224 %post -n libgfortran -p /sbin/ldconfig
225 %postun -n libgfortran -p /sbin/ldconfig
227 %package -n libquadmath
228 Summary: The GNU Fortran Compiler Quadmath Runtime Library
230 Group: Development/Languages
231 %description -n libquadmath
232 The runtime library needed to run programs compiled with the Fortran compiler
233 of the GNU Compiler Collection (GCC) and quadruple precision floating point
235 %post -n libquadmath -p /sbin/ldconfig
236 %postun -n libquadmath -p /sbin/ldconfig
239 Summary: The GNU Compiler Transactional Memory Runtime Library
240 License: GPL-3.0-with-GCC-exception
241 Group: Development/Languages
242 %description -n libitm
243 The runtime library needed to run programs compiled with the
244 -fgnu-tm option of the GNU Compiler Collection (GCC).
245 %post -n libitm -p /sbin/ldconfig
246 %postun -n libitm -p /sbin/ldconfig
249 Summary: The GNU Compiler Address Sanitizer Runtime Library
251 Group: Development/Languages
252 %description -n libasan
253 The runtime library needed to run programs compiled with the
254 -fsanitize=address option of the GNU Compiler Collection (GCC).
255 %post -n libasan -p /sbin/ldconfig
256 %postun -n libasan -p /sbin/ldconfig
259 Summary: The GNU Compiler Thread Sanitizer Runtime Library
261 Group: Development/Languages
262 %description -n libtsan
263 The runtime library needed to run programs compiled with the
264 -fsanitize=thread option of the GNU Compiler Collection (GCC).
265 %post -n libtsan -p /sbin/ldconfig
266 %postun -n libtsan -p /sbin/ldconfig
269 Summary: The GNU Compiler Efficciency Sanitier Runtime Library
271 Group: Development/Languages
272 %description -n libesan
273 The runtime library needed to run programs compiled with the
274 -fsanitize=efficiency-working-set option of the GNU Compiler Collection (GCC).
275 %post -n libesan -p /sbin/ldconfig
276 %postun -n libesan -p /sbin/ldconfig
278 %package -n libatomic
279 Summary: The GNU Compiler Atomic Operations Runtime Library
280 License: GPL-3.0-with-GCC-exception
281 Group: Development/Languages
282 %description -n libatomic
283 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
284 %post -n libatomic -p /sbin/ldconfig
285 %postun -n libatomic -p /sbin/ldconfig
287 %package -n libcilkrts
288 Summary: The GNU Compiler Cilk+ Runtime Library
290 Group: Development/Languages
291 %description -n libcilkrts
292 The runtime library needed to run programs compiled with the
293 -fcilkplus option of the GNU Compiler Collection (GCC).
294 %post -n libcilkrts -p /sbin/ldconfig
295 %postun -n libcilkrts -p /sbin/ldconfig
298 Summary: The GNU Compiler Leak Sanitizer Runtime Library
300 Group: Development/Languages
301 %description -n liblsan
302 The runtime library needed to run programs compiled with the
303 -fsanitize=leak option of the GNU Compiler Collection (GCC).
304 %post -n liblsan -p /sbin/ldconfig
305 %postun -n liblsan -p /sbin/ldconfig
308 Summary: The GNU Compiler Undefined Sanitizer Runtime Library
310 Group: Development/Languages
311 %description -n libubsan
312 The runtime library needed to run programs compiled with the
313 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
314 %post -n libubsan -p /sbin/ldconfig
315 %postun -n libubsan -p /sbin/ldconfig
318 Summary: The GNU Compiler Vtable Verifier Runtime Library
320 Group: Development/Languages
321 %description -n libvtv
322 The runtime library needed to run programs compiled with the
323 -fvtable-verify option of the GNU Compiler Collection (GCC).
324 %post -n libvtv -p /sbin/ldconfig
325 %postun -n libvtv -p /sbin/ldconfig
328 Summary: Java Runtime Library for gcc
329 License: GPL-2.0-with-classpath-exception
330 Group: Development/Building
331 %description -n libgcj
332 This library is needed if you want to use the GNU Java compiler, gcj.
333 Source code for this package is in gcc.
334 %post -n libgcj -p /sbin/ldconfig
335 %postun -n libgcj -p /sbin/ldconfig
338 Summary: The GNU Java Compiler
340 Group: Development/Languages
342 The Java compiler from the GCC-tools-suite.
344 %package -n libgcj_bc
345 Summary: Fake library for BC-ABI compatibility.
346 License: GPL-2.0-with-classpath-exception
347 Group: Development/Languages
348 %description -n libgcj_bc
349 A fake library that is used at link time only. It ensures that
350 binaries built with the BC-ABI link against a constant SONAME.
351 This way, BC-ABI binaries continue to work if the SONAME underlying
354 %package -n libgcj-jar
355 Summary: Java runtime library (jar files).
356 License: GPL-2.0-with-classpath-exception
357 Group: Development/Languages
358 %description -n libgcj-jar
359 These are the jar files that go along with the gcj front end to gcc.
361 %package -n libgcj-devel
362 Summary: Include Files and Libraries mandatory for Development.
363 License: GPL-2.0-with-classpath-exception
364 Group: Development/Languages
365 %description -n libgcj-devel
366 This package contains all necessary include files and libraries needed
367 to develop applications that require these.
370 Summary: Java Bytecode Interpreter for gcc
371 License: GPL-2.0-with-classpath-exception
372 Group: Development/Languages
373 %description -n gcc-gij
374 This package contains the java bytecode interpreter gij and related tools.
377 Summary: Foreign Function Interface library
378 License: BSD-3-Clause
379 Group: Development/Building
380 %description -n libffi
381 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.
382 %post -n libffi -p /sbin/ldconfig
383 %postun -n libffi -p /sbin/ldconfig
385 %package -n libffi-devel
386 Summary: Foreign Function Interface library development files
387 License: BSD 3-Clause
388 Group: Development/Building
389 %description -n libffi-devel
390 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.
393 Summary: GNU Go Compiler
395 Group: Development/Languages
397 This package contains a Go compiler and associated development
398 files based on the GNU GCC technology.
401 Summary: GNU Go compiler runtime library
402 License: BSD-3-Clause
403 Group: Development/Languages
404 %description -n libgo
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.
406 %post -n libgo -p /sbin/ldconfig
407 %postun -n libgo -p /sbin/ldconfig
410 Summary: Testsuite results
411 License: SUSE-Public-Domain
412 Group: Development/Languages
413 %description testresults
414 Results from running the gcc and target library testsuites.
416 %package -n gcc-32bit
417 Summary: The GNU C Compiler 32bit support
418 Group: Development/Building
419 %description -n gcc-32bit
420 This package contains 32bit support for the GNU Compiler Collection.
422 %package -n libstdc++-devel-32bit
423 Summary: Include Files and Libraries mandatory for Development
424 License: GPL-3.0-with-GCC-exception
425 Group: Development/Building
426 %description -n libstdc++-devel-32bit
427 This package contains all the headers and libraries of the standard C++
428 library. It is needed for compiling C++ code.
430 %package -n libgcc-32bit
431 Summary: C compiler runtime library
432 License: GPL-3.0-with-GCC-exception
433 Group: Development/Building
434 %description -n libgcc-32bit
435 Libgcc is needed for dynamically linked C programs.
436 %post -n libgcc-32bit -p /sbin/ldconfig
437 %postun -n libgcc-32bit -p /sbin/ldconfig
439 %package -n libgomp-32bit
440 Summary: The GNU compiler collection OpenMP runtime library
441 License: GPL-3.0-with-GCC-exception
442 Group: Development/Building
443 %description -n libgomp-32bit
444 This is the OpenMP runtime library needed by OpenMP enabled programs
445 that were built with the -fopenmp compiler option and by programs that
446 were auto-parallelized via the -ftree-parallelize-loops compiler
448 %post -n libgomp-32bit -p /sbin/ldconfig
449 %postun -n libgomp-32bit -p /sbin/ldconfig
451 %package -n libstdc++-32bit
452 Summary: The standard C++ shared library
453 License: GPL-3.0-with-GCC-exception
454 Group: Development/Building
455 %description -n libstdc++-32bit
456 The standard C++ library, needed for dynamically linked C++ programs.
457 %post -n libstdc++-32bit -p /sbin/ldconfig
458 %postun -n libstdc++-32bit -p /sbin/ldconfig
461 Summary: GNU Objective C Compiler
463 Group: Development/Languages
464 %description objc-32bit
465 This package contains the GNU Objective C compiler. Objective C is an
466 object oriented language, created by Next Inc. and used in their
467 Nextstep OS. The source code is available in the gcc package.
469 %package -n libobjc-32bit
470 Summary: Library for the GNU Objective C Compiler
471 License: GPL-3.0-with-GCC-exception
472 Group: Development/Building
473 %description -n libobjc-32bit
474 The library for the GNU Objective C compiler.
475 %post -n libobjc-32bit -p /sbin/ldconfig
476 %postun -n libobjc-32bit -p /sbin/ldconfig
479 Summary: GNU Ada95 Compiler Based on GCC (GNAT)
481 Group: Development/Languages
482 %description ada-32bit
483 This package contains an Ada95 compiler and associated development
484 tools based on the GNU GCC technology. Ada95 is the object oriented
485 successor of the Ada83 language. To build this package from source you
486 must have installed a binary version to bootstrap the compiler.
488 %package -n libada-32bit
489 Summary: GNU Ada Runtime Libraries
490 License: GPL-3.0-with-GCC-exception
491 Group: Development/Languages
492 %description -n libada-32bit
493 This package contains the shared libraries required to run programs
494 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
495 shared libraries. It also contains the shared libraries for the
496 Implementation of the Ada Semantic Interface Specification (ASIS), the
497 implementation of Distributed Systems Programming (GLADE) and the Posix
498 1003.5 Binding (Florist).
499 %post -n libada-32bit -p /sbin/ldconfig
500 %postun -n libada-32bit -p /sbin/ldconfig
502 %package fortran-32bit
503 Summary: The GNU Fortran Compiler and Support Files
505 Group: Development/Languages
506 %description fortran-32bit
507 This is the Fortran compiler of the GNU Compiler Collection (GCC).
509 %package -n libgfortran-32bit
510 Summary: The GNU Fortran Compiler Runtime Library
511 License: GPL-3.0-with-GCC-exception
512 Group: Development/Languages
513 %description -n libgfortran-32bit
514 The runtime library needed to run programs compiled with the Fortran compiler
515 of the GNU Compiler Collection (GCC).
516 %post -n libgfortran-32bit -p /sbin/ldconfig
517 %postun -n libgfortran-32bit -p /sbin/ldconfig
519 %package -n libquadmath-32bit
520 Summary: The GNU Fortran Compiler Quadmath Runtime Library
522 Group: Development/Languages
523 %description -n libquadmath-32bit
524 The runtime library needed to run programs compiled with the Fortran compiler
525 of the GNU Compiler Collection (GCC) and quadruple precision floating point
527 %post -n libquadmath-32bit -p /sbin/ldconfig
528 %postun -n libquadmath-32bit -p /sbin/ldconfig
530 %package -n libitm-32bit
531 Summary: The GNU Compiler Transactional Memory Runtime Library
532 License: GPL-3.0-with-GCC-exception
533 Group: Development/Languages
534 %description -n libitm-32bit
535 The runtime library needed to run programs compiled with the
536 -fgnu-tm option of the GNU Compiler Collection (GCC).
537 %post -n libitm-32bit -p /sbin/ldconfig
538 %postun -n libitm-32bit -p /sbin/ldconfig
540 %package -n libasan-32bit
541 Summary: The GNU Compiler Address Sanitizer Runtime Library
543 Group: Development/Languages
544 %description -n libasan-32bit
545 The runtime library needed to run programs compiled with the
546 -fsanitize=address option of the GNU Compiler Collection (GCC).
547 %post -n libasan-32bit -p /sbin/ldconfig
548 %postun -n libasan-32bit -p /sbin/ldconfig
550 %package -n liblsan-32bit
551 Summary: The GNU Compiler Address Sanitizer Runtime Library
553 Group: Development/Languages
554 %description -n liblsan-32bit
555 The runtime library needed to run programs compiled with the
556 -fsanitize=leak option of the GNU Compiler Collection (GCC).
557 %post -n liblsan-32bit -p /sbin/ldconfig
558 %postun -n liblsan-32bit -p /sbin/ldconfig
560 %package -n libtsan-32bit
561 Summary: The GNU Compiler Thread Sanitizer Runtime Library
563 Group: Development/Languages
564 %description -n libtsan-32bit
565 The runtime library needed to run programs compiled with the
566 -fsanitize=thread option of the GNU Compiler Collection (GCC).
567 %post -n libtsan-32bit -p /sbin/ldconfig
568 %postun -n libtsan-32bit -p /sbin/ldconfig
570 %package -n libatomic-32bit
571 Summary: The GNU Compiler Atomic Operations Runtime Library
572 License: GPL-3.0-with-GCC-exception
573 Group: Development/Languages
574 %description -n libatomic-32bit
575 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
576 %post -n libatomic-32bit -p /sbin/ldconfig
577 %postun -n libatomic-32bit -p /sbin/ldconfig
579 %package -n libcilkrts-32bit
580 Summary: The GNU Compiler Cilk+ Runtime Library
582 Group: Development/Languages
583 %description -n libcilkrts-32bit
584 The runtime library needed to run programs compiled with the
585 -fcilkplus option of the GNU Compiler Collection (GCC).
586 %post -n libcilkrts-32bit -p /sbin/ldconfig
587 %postun -n libcilkrts-32bit -p /sbin/ldconfig
589 %package -n libubsan-32bit
590 Summary: The GNU Compiler Undefined Sanitizer Runtime Library
592 Group: Development/Languages
593 %description -n libubsan-32bit
594 The runtime library needed to run programs compiled with the
595 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
596 %post -n libubsan-32bit -p /sbin/ldconfig
597 %postun -n libubsan-32bit -p /sbin/ldconfig
599 %package -n libvtv-32bit
600 Summary: The GNU Compiler Vtable Verifier Runtime Library
602 Group: Development/Languages
603 %description -n libvtv-32bit
604 The runtime library needed to run programs compiled with the
605 -fvtable-verify option of the GNU Compiler Collection (GCC).
606 %post -n libvtv-32bit -p /sbin/ldconfig
607 %postun -n libvtv-32bit -p /sbin/ldconfig
609 %package -n libffi-32bit
610 Summary: Foreign Function Interface library
611 License: BSD-3-Clause
612 Group: Development/Building
613 %description -n libffi-32bit
614 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.
615 %post -n libffi-32bit -p /sbin/ldconfig
616 %postun -n libffi-32bit -p /sbin/ldconfig
618 %package -n libffi-devel-32bit
619 Summary: Foreign Function Interface library development files
620 License: BSD 3-Clause
621 Group: Development/Building
622 %description -n libffi-devel-32bit
623 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.
626 Summary: GNU Go Compiler
628 Group: Development/Languages
629 %description go-32bit
630 This package contains a Go compiler and associated development
631 files based on the GNU GCC technology.
633 %package -n libgo-32bit
634 Summary: GNU Go compiler runtime library
635 License: BSD-3-Clause
636 Group: Development/Languages
637 %description -n libgo-32bit
638 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.
639 %post -n libgo-32bit -p /sbin/ldconfig
640 %postun -n libgo-32bit -p /sbin/ldconfig
642 %package plugin-devel
643 Summary: GNU GCC Plugin development files
645 Group: Development/Languages
646 %description plugin-devel
647 This package contains GCC Plugin development files needed for compiler
650 %package -n sanitizer-sources
651 Summary: Sanitizer family tools sources
653 Group: Development/Tools
656 %description -n sanitizer-sources
657 Sanitizer family tools sources for external tools.
661 %setup -q -n gcc-%{version}
667 ln -sf mpfr-3.1.5 mpfr
671 ln -sf isl-0.17.1 isl
673 echo "" > gcc/DEV-PHASE
675 %global gcc_release `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/LINARO-VERSION`
681 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -marm -Wa,-mimplicit-it=arm -fno-omit-frame-pointer"
684 %{?esan:%gcc_unforce_options}
689 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'
690 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D__USE_FORTIFY_LEVEL=0"`
692 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
693 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(sse\|fpmath\)[^ ]*//g'`
695 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/ */ /g'`
697 # -Wall is stripped off now, so -Wformat will not turn on implicitly for
698 # "-Wformat-.." option group, causing additional build warnings and testsuite
699 # FAIL ("test for excess errors" type).
700 # Insert "-Wformat" if we find "-Wformat-..."
701 if [ ! -z "$(echo $RPM_OPT_FLAGS | grep -o "\B\-Wformat\-")" ]; then
702 if [ -z "$(echo $RPM_OPT_FLAGS | grep -Po "\B\-Wformat(\s|\Z)")" ]; then
703 RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e "s/-Wformat-/-Wformat -Wformat-/")
707 %{?asan: RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS -DASAN_INIT_FIRST) }
709 %ifarch armv7l armv7hl aarch64
710 %undefine gcc_profiledbootstrap
713 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
714 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
716 --prefix=%{_prefix} \
717 --infodir=%{_infodir} \
718 --mandir=%{_mandir} \
720 --libexecdir=%{libdir} \
721 --enable-languages=c,c++,fortran \
722 --enable-checking=release \
724 %{!?gcc_profiledbootstrap:--disable-bootstrap} \
729 --with-slibdir=%{libdir} \
732 --enable-__cxa_atexit \
733 --enable-libstdcxx-allocator=new \
734 --enable-version-specific-runtime-libs \
735 --enable-linker-build-id \
736 --without-system-libunwind \
737 --enable-threads=posix \
742 --enable-libgfortran \
743 %{?asanbootstrap:--enable-bootstrap --with-build-config=bootstrap-asan} \
745 --with-arch=armv7-a \
746 --with-tune=cortex-a8 \
747 --disable-sjlj-exceptions \
750 --with-arch=armv7-a \
751 --with-tune=cortex-a8 \
752 --disable-sjlj-exceptions \
756 --with-arch=armv8-a \
757 --disable-sjlj-exceptions \
760 --with-arch-32=i586 \
761 --with-tune=generic \
765 --with-arch-32=i586 \
766 --with-tune=generic \
773 --with-arch=armv7-a \
774 --with-tune=cortex-a8 \
775 --disable-sjlj-exceptions \
778 --with-arch=armv7-a \
779 --with-tune=cortex-a8 \
780 --disable-sjlj-exceptions \
784 --with-arch=armv8-a \
785 --disable-sjlj-exceptions \
788 --disable-libgfortran \
789 --disable-libquadmath \
791 --disable-libatomic \
792 --disable-libstdc++-v3 \
793 --disable-libsanitizer \
796 --with-bugurl="http://bugs.tizen.org/" \
797 --with-pkgversion="Tizen/Linaro GCC %{version} %{gcc_release}" \
798 --target=%{target_arch} \
799 --host=%{host_arch} \
802 make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} %{!?cross:%{?gcc_profiledbootstrap:profiledbootstrap}}
805 # asan needs a whole shadow address space
806 ulimit -v unlimited || true
807 make -k check %{?_smp_mflags} || true
809 ../contrib/test_summary | tee ../testresults/test_summary.txt
815 make install DESTDIR=$RPM_BUILD_ROOT
818 cp `find . -name "*.sum"` ../testresults/
819 cp `find . -name "*.log" \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
820 chmod 644 ../testresults/*
824 rm -rf %{buildroot}/%{_datadir}/locale
826 #remove everything we don't need
827 rm -rf %{buildroot}/%{libsubdir}/install-tools
828 find %{buildroot}/ -name "*.la" -delete
831 ln -s gcc %{buildroot}%{_bindir}/cc
832 mv %{buildroot}%{libsubdir}/libstdc++.so*-gdb.py %{buildroot}%{_datadir}/gcc-%{version}/python/libstdcxx/
834 # expose plugins for ar (required for lto builds)
835 mkdir -p %{buildroot}%{_prefix}/lib/bfd-plugins
836 ln -sf %{libsubdir}/liblto_plugin.so %{buildroot}%{_prefix}/lib/bfd-plugins/liblto_plugin.so
838 # legacy preprocessor
839 mkdir -p %{buildroot}/lib
840 ln -s %{_bindir}/cpp %{buildroot}/lib/cpp
842 # 32-bit libgcc in multilib configuration
844 mv %{buildroot}%{_prefix}/lib/libgcc_s.so* %{buildroot}%{libsubdir}/32/
847 # move libraries to libdir
848 for lib in asan atomic cilkrts gfortran gomp cc1 itm lsan quadmath stdc++ supc++ tsan ubsan esan
850 [ -e %{buildroot}%{libsubdir}/lib$lib.a ] && mv %{buildroot}%{libsubdir}/lib$lib.a %{buildroot}%{libdir}/
851 [ -e %{buildroot}%{libsubdir}/lib$lib.so ] && mv %{buildroot}%{libsubdir}/lib$lib.so* %{buildroot}%{libdir}/
856 rm -rf %{buildroot}/%{libsubdir}/include-fixed
857 rm -rf %{buildroot}/%{libsubdir}/include
862 tar -czf libsanitizer.tar.bz libsanitizer
863 mkdir -p %{buildroot}/src
864 mv -v libsanitizer.tar.bz %{buildroot}/src
868 %manifest gcc.manifest
869 %defattr(-,root,root)
881 %{_bindir}/gcc-ranlib
882 %{_bindir}/%{target_arch}-gcc
883 %{_bindir}/%{target_arch}-gcc-%{version}
884 %{_bindir}/%{target_arch}-gcc-ar
885 %{_bindir}/%{target_arch}-gcc-nm
886 %{_bindir}/%{target_arch}-gcc-ranlib
887 %{libsubdir}/collect2
889 %{libsubdir}/lto-wrapper
890 %{libsubdir}/liblto_plugin.so*
891 %{_prefix}/lib/bfd-plugins/liblto_plugin.so
892 %{libsubdir}/include-fixed/*
893 %{libsubdir}/include/*.h
900 %ifarch %cilkrts_arch
901 %{libsubdir}/include/cilk/*
903 %{libsubdir}/include/sanitizer/*
905 %exclude %{libdir}/libasan.so
908 %exclude %{libdir}/liblsan.so
911 %exclude %{libdir}/libtsan.so
914 %exclude %{libdir}/libesan.so
918 %defattr(-,root,root)
922 %{_bindir}/%{target_arch}-g++
923 %{_bindir}/%{target_arch}-c++
926 %manifest gcc.manifest
927 %license COPYING3 COPYING.RUNTIME
928 %defattr(-,root,root)
929 %{libdir}/libstdc++.so.*
931 %files -n libstdc++-devel
932 %defattr(-,root,root)
933 %{libdir}/libstdc++.so
934 %{libdir}/libstdc++.a
935 %{libdir}/libsupc++.a
936 %{libsubdir}/include/c++/*
937 %{_datadir}/gcc-%{version}/python/libstdcxx/*
940 %manifest gcc.manifest
941 %license COPYING3 COPYING.RUNTIME
942 %defattr(-,root,root)
943 %{libdir}/libgcc_s.so.*
946 %manifest gcc.manifest
947 %license COPYING3 COPYING.RUNTIME
948 %defattr(-,root,root)
949 %{libdir}/libgomp.so.*
952 %manifest gcc.manifest
953 %defattr(-,root,root)
954 %{libdir}/libcc1.so.*
958 %manifest gcc.manifest
959 %license libsanitizer/LICENSE.TXT
960 %defattr(-,root,root)
961 %{libdir}/libasan.so*
966 %manifest gcc.manifest
967 %license libsanitizer/LICENSE.TXT
968 %defattr(-,root,root)
969 %{libdir}/liblsan.so*
974 %manifest gcc.manifest
975 %license libsanitizer/LICENSE.TXT
976 %defattr(-,root,root)
977 %{libdir}/libtsan.so*
982 %manifest gcc.manifest
983 %license libsanitizer/LICENSE.TXT
984 %defattr(-,root,root)
985 %{libdir}/libesan.so*
990 %manifest gcc.manifest
991 %license COPYING3 COPYING.RUNTIME
992 %defattr(-,root,root)
993 %{libdir}/libatomic.so.*
998 %manifest gcc.manifest
999 %license COPYING3 COPYING.RUNTIME
1000 %defattr(-,root,root)
1001 %{libdir}/libitm.so.*
1004 %ifarch %cilkrts_arch
1005 %files -n libcilkrts
1006 %manifest gcc.manifest
1007 %defattr(-,root,root)
1008 %{libdir}/libcilkrts.so.*
1013 %manifest gcc.manifest
1014 %license libsanitizer/LICENSE.TXT
1015 %defattr(-,root,root)
1016 %{libdir}/libubsan.so.*
1020 %defattr(-,root,root)
1021 %dir %{libsubdir}/finclude
1023 %{_bindir}/%{target_arch}-gfortran
1025 %{libsubdir}/finclude/*
1026 %{libdir}/libgfortran.a
1027 %{libdir}/libgfortran.so
1028 %{libsubdir}/libgfortran.spec
1029 %{libsubdir}/libcaf_single.a
1030 %ifarch %quadmath_arch
1031 %{libdir}/libquadmath.a
1032 %{libdir}/libquadmath.so
1035 %files -n libgfortran
1036 %defattr(-,root,root)
1037 %{libdir}/libgfortran.so.*
1039 %ifarch %quadmath_arch
1040 %files -n libquadmath
1041 %manifest gcc.manifest
1042 %license COPYING.LIB
1043 %defattr(-,root,root)
1044 %{libdir}/libquadmath.so.*
1048 %defattr(-,root,root)
1054 %defattr(-,root,root)
1055 %{libsubdir}/plugin/*
1059 %defattr(-,root,root)
1060 %doc testresults/test_summary.txt
1061 %doc testresults/*.sum
1062 %doc testresults/*.log
1066 %defattr(-,root,root)
1067 %{libsubdir}/32/crt*
1069 %{libsubdir}/32/*.so
1071 %{libsubdir}/32/*.spec
1074 %files -n libasan-32bit
1075 %manifest gcc.manifest
1076 %license libsanitizer/LICENSE.TXT
1077 %defattr(-,root,root)
1078 %{libsubdir}/32/libasan.so.*
1082 %files -n liblsan-32bit
1083 %manifest gcc.manifest
1084 %license libsanitizer/LICENSE.TXT
1085 %defattr(-,root,root)
1086 %{libsubdir}/32/liblsan.so.*
1089 %ifarch %atomic_arch
1090 %files -n libatomic-32bit
1091 %manifest gcc.manifest
1092 %license COPYING3 COPYING.RUNTIME
1093 %defattr(-,root,root)
1094 %{libsubdir}/32/libatomic.so.*
1097 %ifarch %cilkrts_arch
1098 %files -n libcilkrts-32bit
1099 %defattr(-,root,root)
1100 %{libsubdir}/32/libcilkrts.so.*
1103 %files -n libgcc-32bit
1104 %manifest gcc.manifest
1105 %license COPYING3 COPYING.RUNTIME
1106 %defattr(-,root,root)
1107 %{libsubdir}/32/libgcc_s.so.*
1109 %files -n libgomp-32bit
1110 %manifest gcc.manifest
1111 %license COPYING3 COPYING.RUNTIME
1112 %defattr(-,root,root)
1113 %{libsubdir}/32/libgomp.so.*
1116 %files -n libitm-32bit
1117 %license COPYING3 COPYING.RUNTIME
1118 %defattr(-,root,root)
1119 %{libsubdir}/32/libitm.so.*
1122 %files -n libgfortran-32bit
1123 %defattr(-,root,root)
1124 %dir %{libsubdir}/32/finclude
1125 %{libsubdir}/32/libgfortran.so.*
1126 %{libsubdir}/32/finclude/*
1128 %ifarch %quadmath_arch
1129 %files -n libquadmath-32bit
1130 %license COPYING.LIB
1131 %defattr(-,root,root)
1132 %{libsubdir}/32/libquadmath.so.*
1136 %files -n libubsan-32bit
1137 %manifest gcc.manifest
1138 %license libsanitizer/LICENSE.TXT
1139 %defattr(-,root,root)
1140 %{libsubdir}/32/libubsan.so.*
1143 %files -n libstdc++-32bit
1144 %manifest gcc.manifest
1145 %license COPYING3 COPYING.RUNTIME
1146 %defattr(-,root,root)
1147 %{libsubdir}/32/libstdc++.so.*
1148 %exclude %{libsubdir}/32/libstdc++.so.*-gdb.py
1150 %files -n libstdc++-devel-32bit
1151 %defattr(-,root,root)
1152 %{libsubdir}/32/libstdc++.so.*-gdb.py
1155 %files -n sanitizer-sources
1156 %defattr(-,root,root,-)
1157 /src/libsanitizer.tar.bz