3f9dea00408d77096d1549d4179740b87bf9244c
[platform/upstream/gcc.git] / packaging / gcc-aarch64.spec
1 %define cross aarch64
2 %define aarch64 1
3
4 #
5 # spec file for package gcc
6 #
7 # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
8 # Copyright (c) 2015 Tizen
9 #
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.
18
19 # Please submit bugfixes or comments via http://bugs.tizen.org/
20 #
21 # we use %%{?macro: ... } as it is more compact
22 %if 0%{?run_tests}
23 %define gcc_run_tests 1
24 %endif
25
26 # Enable this when testing on device to:
27 # 1. Enable macro to turn on testsuite building ('gcc_run_tests 1')
28 # 2. Keep 'obj/' folder in build stage as we do not want to rebuild all gcc
29 # again on device after invoking rpmbuild --short-circuit -bc ...
30 # 3. Skip configure and make commands and go directly to 'make check'
31 %if 0%{?run_tests_on_device}
32 %define gcc_run_tests 1
33 %define gcc_keep_build_dir 1
34 %define gcc_skip_configure 1
35 %define gcc_skip_make 1
36 %endif
37
38 # Exit right after 'make ..' step to keep all object files produced by gcc build
39 %if 0%{?exit_on_make_finish}
40 %define gcc_exit_on_make_finish 1
41 %endif
42
43 # Bootstrap build constrains for ASan config
44 %if 0%{?asanbootstrap}
45   %ifarch %arm aarch64 # or #if 0#{?qemu_user_space_build}
46     %{error:"'asanbootstrap' supposed to be used with i586/x86_64 arch"}
47     # The #error macro primitive cannot stop the build because macros are context
48     # free, lazily expanded whereever they are needed, not only during build.
49     # Use non-existing define for now to abort the build.
50     %abort_build
51   %endif
52   # We'll get 2 libasan runtime conflict: preloaded one and another from build dir.
53   %if 0%{?asan}
54     %{error:"'asanbootstrap' could not be used with sanitized environment."}
55     %{error:"Use 'asanbootstrap' without defined 'asan'"}
56     %abort_build
57   %endif
58 %endif
59
60 %define quadmath_arch %ix86 x86_64 ia64
61 %define tsan_arch x86_64 aarch64
62 %define asan_arch x86_64 %ix86 ppc ppc64 %sparc %arm aarch64
63 %define itm_arch x86_64 %ix86 %arm ppc ppc64 ppc64le s390 s390x %sparc aarch64
64 %define atomic_arch x86_64 %ix86 %arm aarch64 ppc ppc64 ppc64le s390 s390x %sparc m68k
65 %define lsan_arch x86_64 %ix86 %arm aarch64
66 %define ubsan_arch x86_64 %ix86 ppc ppc64 %arm aarch64
67 %define cilkrts_arch x86_64 %ix86
68
69 %ifarch armv7l
70 %define ARCH armv7l
71 %define ABI eabi
72 %endif
73 %ifarch armv7hl
74 %define ARCH armv7hl
75 %define ABI eabihf
76 %endif
77 %ifarch %ix86
78 %define ARCH i586
79 %endif
80 %ifarch x86_64
81 %define ARCH x86_64
82 %endif
83 %ifarch aarch64
84 %define ARCH aarch64
85 %endif
86 %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
87
88 %define target_cpu %{?cross}%{!?cross:%{ARCH}}
89 %define target_abi %{?cross:%{?armv7l:eabi}%{?armv7hl:eabihf}}%{!?cross:%{?ABI}}
90
91 %define target_arch %{target_cpu}-tizen-linux-gnu%{?target_abi}
92 %define libdir %{!?cross:%{_libdir}}%{?cross:%{_prefix}/lib%{?aarch64:64}}
93 %define libsubdir %{libdir}/gcc/%{target_arch}/%{version}
94
95 Name:         gcc%{?cross:-%{cross}}
96 # With generated files in src we could drop the following
97 BuildRequires: bison
98 BuildRequires: flex
99 BuildRequires: gettext-devel
100 BuildRequires: makeinfo
101 ## until here, but at least renaming and patching info files breaks this
102 BuildRequires: gcc-c++
103 BuildRequires: zlib-devel
104 %ifarch x86_64
105 BuildRequires: glibc-devel-32bit
106 %endif
107 BuildRequires: perl
108 %{?cross:BuildRequires: binutils-%{cross}}
109 # here we use %%if because OBS spec parser cannot expand
110 # %%{?macro:...} correctly
111 %if 0%{?gcc_run_tests}
112 BuildRequires: dejagnu
113 BuildRequires: expect
114 BuildRequires: gdb
115 %endif
116 URL:           http://gcc.gnu.org/
117 Version:       9.2.0
118 Release:       0
119 Source:        gcc-%{version}.tar.bz2
120 Source10:      gmp-6.1.1.tar.bz2
121 Source11:      mpfr-3.1.5.tar.bz2
122 Source12:      mpc-1.0.3.tar.gz
123 Source13:      isl-0.17.1.tar.bz2
124 Source20:      gcc.manifest
125 Group:         Development/Building
126 Summary:       The GNU C Compiler and Support Files
127 License:       GPL-3.0+
128 %{?cross:ExcludeArch: %{cross}}
129 %description
130 Core package for the GNU Compiler Collection, including the C language
131 frontend.
132
133 %package c++
134 Summary:       The GNU C++ Compiler
135 License:       GPL-3.0+
136 Group:         Development/Languages
137 %description c++
138 This package contains the GNU compiler for C++.
139
140 %package -n libstdc++
141 Summary:       The standard C++ shared library
142 License:       GPL-3.0-with-GCC-exception
143 Group:         Development/Building
144 %description -n libstdc++
145 The standard C++ library, needed for dynamically linked C++ programs.
146 %post -n libstdc++ -p /sbin/ldconfig
147 %postun -n libstdc++ -p /sbin/ldconfig
148
149 %package -n libstdc++-devel
150 Summary:       Include Files and Libraries mandatory for Development
151 License:       GPL-3.0-with-GCC-exception
152 Group:         Development/Building
153 %description -n libstdc++-devel
154 This package contains all the headers and libraries of the standard C++
155 library. It is needed for compiling C++ code.
156
157 %package -n libgcc
158 Summary:       C compiler runtime library
159 License:       GPL-3.0-with-GCC-exception
160 Group:         Development/Building
161 %description -n libgcc
162 Libgcc is needed for dynamically linked C programs.
163 %post -n libgcc -p /sbin/ldconfig
164 %postun -n libgcc -p /sbin/ldconfig
165
166 %package -n libgomp
167 Summary:       The GNU compiler collection OpenMP runtime library
168 License:       GPL-3.0-with-GCC-exception
169 Group:         Development/Building
170 %description -n libgomp
171 This is the OpenMP runtime library needed by OpenMP enabled programs
172 that were built with the -fopenmp compiler option and by programs that
173 were auto-parallelized via the -ftree-parallelize-loops compiler
174 option.
175 %post -n libgomp -p /sbin/ldconfig
176 %postun -n libgomp -p /sbin/ldconfig
177
178 %package objc
179 Summary:       GNU Objective C Compiler
180 License:       GPL-3.0+
181 Group:         Development/Languages
182 %description objc
183 This package contains the GNU Objective C compiler. Objective C is an
184 object oriented language, created by Next Inc. and used in their
185 Nextstep OS. The source code is available in the gcc package.
186
187 %package -n libobjc
188 Summary:       Library for the GNU Objective C Compiler
189 License:       GPL-3.0-with-GCC-exception
190 Group:         Development/Building
191 %description -n libobjc
192 The library for the GNU Objective C compiler.
193 %post -n libobjc -p /sbin/ldconfig
194 %postun -n libobjc -p /sbin/ldconfig
195
196 %package -n libcc1
197 Summary:       GNU C Compiler plugin for GDB
198 License:       GPL-3.0-with-GCC-exception
199 Group:         Development/Building
200 %description -n libcc1
201 The GCC plugin for GDB
202 %post -n libcc1 -p /sbin/ldconfig
203 %postun -n libcc1 -p /sbin/ldconfig
204
205 %package obj-c++
206 Summary:       GNU Objective C++ Compiler
207 License:       GPL-3.0+
208 Group:         Development/Languages
209 %description obj-c++
210 This package contains the GNU Objective C++ compiler. Objective C++ is an
211 object oriented language, created by Next Inc. and used in their
212 Nextstep OS. The source code is available in the gcc package.
213
214 %package -n cpp
215 Summary:       The GCC Preprocessor
216 License:       GPL-3.0+
217 Group:         Development/Languages
218 %description -n cpp
219 This Package contains just the preprocessor that is used by the X11
220 packages.
221
222 %package ada
223 Summary:       GNU Ada95 Compiler Based on GCC (GNAT)
224 License:       GPL-3.0+
225 Group:         Development/Languages
226 %description ada
227 This package contains an Ada95 compiler and associated development
228 tools based on the GNU GCC technology. Ada95 is the object oriented
229 successor of the Ada83 language. To build this package from source you
230 must have installed a binary version to bootstrap the compiler.
231
232 %package -n libada
233 Summary:      GNU Ada Runtime Libraries
234 License:      GPL-3.0-with-GCC-exception
235 Group:        Development/Languages
236 %description -n libada
237 This package contains the shared libraries required to run programs
238 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
239 shared libraries. It also contains the shared libraries for the
240 Implementation of the Ada Semantic Interface Specification (ASIS), the
241 implementation of Distributed Systems Programming (GLADE) and the Posix
242 1003.5 Binding (Florist).
243 %post -n libada -p /sbin/ldconfig
244 %postun -n libada -p /sbin/ldconfig
245
246 %package fortran
247 Summary:       The GNU Fortran Compiler and Support Files
248 License:       GPL-3.0+
249 Group:         Development/Languages
250 %description fortran
251 This is the Fortran compiler of the GNU Compiler Collection (GCC).
252
253 %package -n libgfortran
254 Summary:       The GNU Fortran Compiler Runtime Library
255 License:       GPL-3.0-with-GCC-exception
256 Group:         Development/Languages
257 %description -n libgfortran
258 The runtime library needed to run programs compiled with the Fortran compiler
259 of the GNU Compiler Collection (GCC).
260 %post -n libgfortran -p /sbin/ldconfig
261 %postun -n libgfortran -p /sbin/ldconfig
262
263 %package -n libquadmath
264 Summary:       The GNU Fortran Compiler Quadmath Runtime Library
265 License:       LGPL-2.1
266 Group:         Development/Languages
267 %description -n libquadmath
268 The runtime library needed to run programs compiled with the Fortran compiler
269 of the GNU Compiler Collection (GCC) and quadruple precision floating point
270 operations.
271 %post -n libquadmath -p /sbin/ldconfig
272 %postun -n libquadmath -p /sbin/ldconfig
273
274 %package -n libitm
275 Summary:       The GNU Compiler Transactional Memory Runtime Library
276 License:       GPL-3.0-with-GCC-exception
277 Group:         Development/Languages
278 %description -n libitm
279 The runtime library needed to run programs compiled with the
280 -fgnu-tm option of the GNU Compiler Collection (GCC).
281 %post -n libitm -p /sbin/ldconfig
282 %postun -n libitm -p /sbin/ldconfig
283
284 %package -n libasan
285 Summary:       The GNU Compiler Address Sanitizer Runtime Library
286 License:       MIT
287 Group:         Development/Languages
288 %description -n libasan
289 The runtime library needed to run programs compiled with the
290 -fsanitize=address option of the GNU Compiler Collection (GCC).
291 %post -n libasan -p /sbin/ldconfig
292 %postun -n libasan -p /sbin/ldconfig
293
294 %package -n libtsan
295 Summary:       The GNU Compiler Thread Sanitizer Runtime Library
296 License:       MIT
297 Group:         Development/Languages
298 %description -n libtsan
299 The runtime library needed to run programs compiled with the
300 -fsanitize=thread option of the GNU Compiler Collection (GCC).
301 %post -n libtsan -p /sbin/ldconfig
302 %postun -n libtsan -p /sbin/ldconfig
303
304 %package -n libatomic
305 Summary:       The GNU Compiler Atomic Operations Runtime Library
306 License:       GPL-3.0-with-GCC-exception
307 Group:         Development/Languages
308 %description -n libatomic
309 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
310 %post -n libatomic -p /sbin/ldconfig
311 %postun -n libatomic -p /sbin/ldconfig
312
313 %package -n libcilkrts
314 Summary:       The GNU Compiler Cilk+ Runtime Library
315 License:       MIT
316 Group:         Development/Languages
317 %description -n libcilkrts
318 The runtime library needed to run programs compiled with the
319 -fcilkplus option of the GNU Compiler Collection (GCC).
320 %post -n libcilkrts -p /sbin/ldconfig
321 %postun -n libcilkrts -p /sbin/ldconfig
322
323 %package -n liblsan
324 Summary:       The GNU Compiler Leak Sanitizer Runtime Library
325 License:       MIT
326 Group:         Development/Languages
327 %description -n liblsan
328 The runtime library needed to run programs compiled with the
329 -fsanitize=leak option of the GNU Compiler Collection (GCC).
330 %post -n liblsan -p /sbin/ldconfig
331 %postun -n liblsan -p /sbin/ldconfig
332
333 %package -n libubsan
334 Summary:       The GNU Compiler Undefined Sanitizer Runtime Library
335 License:       MIT
336 Group:         Development/Languages
337 %description -n libubsan
338 The runtime library needed to run programs compiled with the
339 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
340 %post -n libubsan -p /sbin/ldconfig
341 %postun -n libubsan -p /sbin/ldconfig
342
343 %package -n libvtv
344 Summary:       The GNU Compiler Vtable Verifier Runtime Library
345 License:       MIT
346 Group:         Development/Languages
347 %description -n libvtv
348 The runtime library needed to run programs compiled with the
349 -fvtable-verify option of the GNU Compiler Collection (GCC).
350 %post -n libvtv -p /sbin/ldconfig
351 %postun -n libvtv -p /sbin/ldconfig
352
353 %package -n libgcj
354 Summary:       Java Runtime Library for gcc
355 License:       GPL-2.0-with-classpath-exception
356 Group:         Development/Building
357 %description -n libgcj
358 This library is needed if you want to use the GNU Java compiler, gcj.
359 Source code for this package is in gcc.
360 %post -n libgcj -p /sbin/ldconfig
361 %postun -n libgcj -p /sbin/ldconfig
362
363 %package java
364 Summary:       The GNU Java Compiler
365 License:       GPL-3.0+
366 Group:         Development/Languages
367 %description java
368 The Java compiler from the GCC-tools-suite.
369
370 %package -n libgcj_bc
371 Summary:       Fake library for BC-ABI compatibility.
372 License:       GPL-2.0-with-classpath-exception
373 Group:         Development/Languages
374 %description -n libgcj_bc
375 A fake library that is used at link time only. It ensures that
376 binaries built with the BC-ABI link against a constant SONAME.
377 This way, BC-ABI binaries continue to work if the SONAME underlying
378 libgcj.so changes.
379
380 %package -n libgcj-jar
381 Summary:       Java runtime library (jar files).
382 License:       GPL-2.0-with-classpath-exception
383 Group:         Development/Languages
384 %description -n libgcj-jar
385 These are the jar files that go along with the gcj front end to gcc.
386
387 %package -n libgcj-devel
388 Summary:       Include Files and Libraries mandatory for Development.
389 License:       GPL-2.0-with-classpath-exception
390 Group:         Development/Languages
391 %description -n libgcj-devel
392 This package contains all necessary include files and libraries needed
393 to develop applications that require these.
394
395 %package -n gcc-gij
396 Summary:       Java Bytecode Interpreter for gcc
397 License:       GPL-2.0-with-classpath-exception
398 Group:         Development/Languages
399 %description -n gcc-gij
400 This package contains the java bytecode interpreter gij and related tools.
401
402 %package -n libffi
403 Summary:       Foreign Function Interface library
404 License:       BSD-3-Clause
405 Group:         Development/Building
406 %description -n libffi
407 A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
408 %post -n libffi -p /sbin/ldconfig
409 %postun -n libffi -p /sbin/ldconfig
410
411 %package -n libffi-devel
412 Summary:       Foreign Function Interface library development files
413 License:       BSD 3-Clause
414 Group:         Development/Building
415 %description -n libffi-devel
416 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.
417
418 %package go
419 Summary:       GNU Go Compiler
420 License:       GPL-3.0+
421 Group:         Development/Languages
422 %description go
423 This package contains a Go compiler and associated development
424 files based on the GNU GCC technology.
425
426 %package -n libgo
427 Summary:       GNU Go compiler runtime library
428 License:       BSD-3-Clause
429 Group:         Development/Languages
430 %description -n libgo
431 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.
432 %post -n libgo -p /sbin/ldconfig
433 %postun -n libgo -p /sbin/ldconfig
434
435 %package testresults
436 Summary:       Testsuite results
437 License:       SUSE-Public-Domain
438 Group:         Development/Languages
439 %description testresults
440 Results from running the gcc and target library testsuites.
441
442 %package -n gcc-32bit
443 Summary:       The GNU C Compiler 32bit support
444 Group:         Development/Building
445 %description -n gcc-32bit
446 This package contains 32bit support for the GNU Compiler Collection.
447
448 %package -n libstdc++-devel-32bit
449 Summary:       Include Files and Libraries mandatory for Development
450 License:       GPL-3.0-with-GCC-exception
451 Group:         Development/Building
452 %description -n libstdc++-devel-32bit
453 This package contains all the headers and libraries of the standard C++
454 library. It is needed for compiling C++ code.
455
456 %package -n libgcc-32bit
457 Summary:       C compiler runtime library
458 License:       GPL-3.0-with-GCC-exception
459 Group:         Development/Building
460 %description -n libgcc-32bit
461 Libgcc is needed for dynamically linked C programs.
462 %post -n libgcc-32bit -p /sbin/ldconfig
463 %postun -n libgcc-32bit -p /sbin/ldconfig
464
465 %package -n libgomp-32bit
466 Summary:       The GNU compiler collection OpenMP runtime library
467 License:       GPL-3.0-with-GCC-exception
468 Group:         Development/Building
469 %description -n libgomp-32bit
470 This is the OpenMP runtime library needed by OpenMP enabled programs
471 that were built with the -fopenmp compiler option and by programs that
472 were auto-parallelized via the -ftree-parallelize-loops compiler
473 option.
474 %post -n libgomp-32bit -p /sbin/ldconfig
475 %postun -n libgomp-32bit -p /sbin/ldconfig
476
477 %package -n libstdc++-32bit
478 Summary:       The standard C++ shared library
479 License:       GPL-3.0-with-GCC-exception
480 Group:         Development/Building
481 %description -n libstdc++-32bit
482 The standard C++ library, needed for dynamically linked C++ programs.
483 %post -n libstdc++-32bit -p /sbin/ldconfig
484 %postun -n libstdc++-32bit -p /sbin/ldconfig
485
486 %package objc-32bit
487 Summary:       GNU Objective C Compiler
488 License:       GPL-3.0+
489 Group:         Development/Languages
490 %description objc-32bit
491 This package contains the GNU Objective C compiler. Objective C is an
492 object oriented language, created by Next Inc. and used in their
493 Nextstep OS. The source code is available in the gcc package.
494
495 %package -n libobjc-32bit
496 Summary:       Library for the GNU Objective C Compiler
497 License:       GPL-3.0-with-GCC-exception
498 Group:         Development/Building
499 %description -n libobjc-32bit
500 The library for the GNU Objective C compiler.
501 %post -n libobjc-32bit -p /sbin/ldconfig
502 %postun -n libobjc-32bit -p /sbin/ldconfig
503
504 %package ada-32bit
505 Summary:       GNU Ada95 Compiler Based on GCC (GNAT)
506 License:       GPL-3.0+
507 Group:         Development/Languages
508 %description ada-32bit
509 This package contains an Ada95 compiler and associated development
510 tools based on the GNU GCC technology. Ada95 is the object oriented
511 successor of the Ada83 language. To build this package from source you
512 must have installed a binary version to bootstrap the compiler.
513
514 %package -n libada-32bit
515 Summary:       GNU Ada Runtime Libraries
516 License:       GPL-3.0-with-GCC-exception
517 Group:         Development/Languages
518 %description -n libada-32bit
519 This package contains the shared libraries required to run programs
520 compiled with the GNU Ada compiler (GNAT) if they are compiled to use
521 shared libraries. It also contains the shared libraries for the
522 Implementation of the Ada Semantic Interface Specification (ASIS), the
523 implementation of Distributed Systems Programming (GLADE) and the Posix
524 1003.5 Binding (Florist).
525 %post -n libada-32bit -p /sbin/ldconfig
526 %postun -n libada-32bit -p /sbin/ldconfig
527
528 %package fortran-32bit
529 Summary:       The GNU Fortran Compiler and Support Files
530 License:       GPL-3.0+
531 Group:         Development/Languages
532 %description fortran-32bit
533 This is the Fortran compiler of the GNU Compiler Collection (GCC).
534
535 %package -n libgfortran-32bit
536 Summary:       The GNU Fortran Compiler Runtime Library
537 License:       GPL-3.0-with-GCC-exception
538 Group:         Development/Languages
539 %description -n libgfortran-32bit
540 The runtime library needed to run programs compiled with the Fortran compiler
541 of the GNU Compiler Collection (GCC).
542 %post -n libgfortran-32bit -p /sbin/ldconfig
543 %postun -n libgfortran-32bit -p /sbin/ldconfig
544
545 %package -n libquadmath-32bit
546 Summary:       The GNU Fortran Compiler Quadmath Runtime Library
547 License:       LGPL-2.1
548 Group:         Development/Languages
549 %description -n libquadmath-32bit
550 The runtime library needed to run programs compiled with the Fortran compiler
551 of the GNU Compiler Collection (GCC) and quadruple precision floating point
552 operations.
553 %post -n libquadmath-32bit -p /sbin/ldconfig
554 %postun -n libquadmath-32bit -p /sbin/ldconfig
555
556 %package -n libitm-32bit
557 Summary:       The GNU Compiler Transactional Memory Runtime Library
558 License:       GPL-3.0-with-GCC-exception
559 Group:         Development/Languages
560 %description -n libitm-32bit
561 The runtime library needed to run programs compiled with the
562 -fgnu-tm option of the GNU Compiler Collection (GCC).
563 %post -n libitm-32bit -p /sbin/ldconfig
564 %postun -n libitm-32bit -p /sbin/ldconfig
565
566 %package -n libasan-32bit
567 Summary:       The GNU Compiler Address Sanitizer Runtime Library
568 License:       MIT
569 Group:         Development/Languages
570 %description -n libasan-32bit
571 The runtime library needed to run programs compiled with the
572 -fsanitize=address option of the GNU Compiler Collection (GCC).
573 %post -n libasan-32bit -p /sbin/ldconfig
574 %postun -n libasan-32bit -p /sbin/ldconfig
575
576 %package -n liblsan-32bit
577 Summary:       The GNU Compiler Address Sanitizer Runtime Library
578 License:       MIT
579 Group:         Development/Languages
580 %description -n liblsan-32bit
581 The runtime library needed to run programs compiled with the
582 -fsanitize=leak option of the GNU Compiler Collection (GCC).
583 %post -n liblsan-32bit -p /sbin/ldconfig
584 %postun -n liblsan-32bit -p /sbin/ldconfig
585
586 %package -n libtsan-32bit
587 Summary:       The GNU Compiler Thread Sanitizer Runtime Library
588 License:       MIT
589 Group:         Development/Languages
590 %description -n libtsan-32bit
591 The runtime library needed to run programs compiled with the
592 -fsanitize=thread option of the GNU Compiler Collection (GCC).
593 %post -n libtsan-32bit -p /sbin/ldconfig
594 %postun -n libtsan-32bit -p /sbin/ldconfig
595
596 %package -n libatomic-32bit
597 Summary:       The GNU Compiler Atomic Operations Runtime Library
598 License:       GPL-3.0-with-GCC-exception
599 Group:         Development/Languages
600 %description -n libatomic-32bit
601 The runtime library for atomic operations of the GNU Compiler Collection (GCC).
602 %post -n libatomic-32bit -p /sbin/ldconfig
603 %postun -n libatomic-32bit -p /sbin/ldconfig
604
605 %package -n libcilkrts-32bit
606 Summary:       The GNU Compiler Cilk+ Runtime Library
607 License:       MIT
608 Group:         Development/Languages
609 %description -n libcilkrts-32bit
610 The runtime library needed to run programs compiled with the
611 -fcilkplus option of the GNU Compiler Collection (GCC).
612 %post -n libcilkrts-32bit -p /sbin/ldconfig
613 %postun -n libcilkrts-32bit -p /sbin/ldconfig
614
615 %package -n libubsan-32bit
616 Summary:       The GNU Compiler Undefined Sanitizer Runtime Library
617 License:       MIT
618 Group:         Development/Languages
619 %description -n libubsan-32bit
620 The runtime library needed to run programs compiled with the
621 -fsanitize=undefined option of the GNU Compiler Collection (GCC).
622 %post -n libubsan-32bit -p /sbin/ldconfig
623 %postun -n libubsan-32bit -p /sbin/ldconfig
624
625 %package -n libvtv-32bit
626 Summary:       The GNU Compiler Vtable Verifier Runtime Library
627 License:       MIT
628 Group:         Development/Languages
629 %description -n libvtv-32bit
630 The runtime library needed to run programs compiled with the
631 -fvtable-verify option of the GNU Compiler Collection (GCC).
632 %post -n libvtv-32bit -p /sbin/ldconfig
633 %postun -n libvtv-32bit -p /sbin/ldconfig
634
635 %package -n libffi-32bit
636 Summary:       Foreign Function Interface library
637 License:       BSD-3-Clause
638 Group:         Development/Building
639 %description -n libffi-32bit
640 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.
641 %post -n libffi-32bit -p /sbin/ldconfig
642 %postun -n libffi-32bit -p /sbin/ldconfig
643
644 %package -n libffi-devel-32bit
645 Summary:       Foreign Function Interface library development files
646 License:       BSD 3-Clause
647 Group:         Development/Building
648 %description -n libffi-devel-32bit
649 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.
650
651 %package go-32bit
652 Summary:       GNU Go Compiler
653 License:       GPL-3.0+
654 Group:         Development/Languages
655 %description go-32bit
656 This package contains a Go compiler and associated development
657 files based on the GNU GCC technology.
658
659 %package -n libgo-32bit
660 Summary:       GNU Go compiler runtime library
661 License:       BSD-3-Clause
662 Group:         Development/Languages
663 %description -n libgo-32bit
664 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.
665 %post -n libgo-32bit -p /sbin/ldconfig
666 %postun -n libgo-32bit -p /sbin/ldconfig
667
668 %package plugin-devel
669 Summary:       GNU GCC Plugin development files
670 License:       GPL-3.0+
671 Group:         Development/Languages
672 %description plugin-devel
673 This package contains GCC Plugin development files needed for compiler
674 plugins build.
675
676 %package -n sanitizer-sources
677 Summary:    Sanitizer family tools sources
678 License:       MIT
679 Group:      Development/Tools
680 BuildArch:  noarch
681
682 %description -n sanitizer-sources
683 Sanitizer family tools sources for external tools.
684
685 %prep
686
687 %setup -q -n gcc-%{version}
688 cp %{SOURCE20} .
689
690 tar xf %{SOURCE10}
691 ln -sf gmp-6.1.1 gmp
692 tar xf %{SOURCE11}
693 ln -sf mpfr-3.1.5 mpfr
694 tar xf %{SOURCE12}
695 ln -sf mpc-1.0.3 mpc
696 tar xf %{SOURCE13}
697 ln -sf isl-0.17.1 isl
698
699 echo "" > gcc/DEV-PHASE
700
701 %global gcc_release `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/BASE-VER`
702
703 %build
704 %{?asan:
705 %gcc_unforce_options
706 %ifarch armv7l
707 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -mthumb -mthumb-fp -Wa,-mimplicit-it=thumb -fno-omit-frame-pointer"
708 %endif
709 }
710 %{!?gcc_keep_build_dir:
711 rm -rf obj
712 mkdir obj
713 }
714 cd obj
715
716 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'
717 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D__USE_FORTIFY_LEVEL=0"`
718 %{?cross:
719 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(arch\|tune\|cpu\)=[^ ]*//g'`
720 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/-m\(sse\|fpmath\)[^ ]*//g'`
721 }
722 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/  */ /g'`
723
724 # -Wall is stripped off now, so -Wformat will not turn on implicitly for
725 # "-Wformat-.." option group, causing additional build warnings and testsuite
726 # FAIL ("test for excess errors" type).
727 # Insert "-Wformat" if we find "-Wformat-..."
728 if [ ! -z "$(echo $RPM_OPT_FLAGS | grep -o "\B\-Wformat\-")" ]; then
729     if [ -z "$(echo $RPM_OPT_FLAGS | grep -Po "\B\-Wformat(\s|\Z)")" ]; then
730         RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e "s/-Wformat-/-Wformat -Wformat-/")
731     fi
732 fi
733
734 %{?asan: RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS -DASAN_INIT_FIRST) }
735 %{?asan_shadow_scale: RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS -Wp,-DASAN_SHADOW_SCALE=%{asan_shadow_scale})}
736
737 %ifarch armv7l armv7hl aarch64
738 %undefine gcc_profiledbootstrap
739 %endif
740
741 %{!?gcc_skip_configure:
742 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
743 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
744 ../configure \
745         --prefix=%{_prefix} \
746         --infodir=%{_infodir} \
747         --mandir=%{_mandir} \
748         --libdir=%{libdir} \
749         --libexecdir=%{libdir} \
750         --enable-languages=c,c++,fortran \
751         --enable-checking=release \
752         --disable-libssp \
753         %{!?gcc_profiledbootstrap:--disable-bootstrap} \
754         --disable-libvtv \
755         --enable-plugin \
756         --disable-libcc1 \
757         --disable-libgcj \
758         --with-slibdir=%{libdir} \
759         --with-system-zlib \
760         --with-sysroot=/ \
761         --enable-__cxa_atexit \
762         --enable-libstdcxx-allocator=new \
763         --enable-version-specific-runtime-libs \
764         --enable-linker-build-id \
765         --without-system-libunwind \
766         --enable-threads=posix \
767         --disable-multilib \
768         --enable-lto \
769 %{!?cross: \
770         --enable-libcc1 \
771         --enable-libgfortran \
772         %{?asanbootstrap:--enable-bootstrap --with-build-config=bootstrap-asan} \
773 %ifarch armv7l
774         --with-arch=armv7-a \
775         --with-tune=cortex-a8 \
776         --disable-sjlj-exceptions \
777 %endif
778 %ifarch armv7hl
779         --with-arch=armv7-a \
780         --with-tune=cortex-a8 \
781         --disable-sjlj-exceptions \
782         --with-float=hard \
783 %endif
784 %ifarch aarch64
785         --with-arch=armv8-a \
786         --disable-sjlj-exceptions \
787 %endif
788 %ifarch %ix86
789         --with-arch-32=i586 \
790         --with-tune=generic \
791         --disable-libmpx \
792 %endif
793 %ifarch x86_64
794         --with-arch-32=i586 \
795         --with-tune=generic \
796         --enable-multilib \
797         --disable-libmpx \
798 %endif
799 } \
800 %{?cross: \
801 %{?armv7l: \
802         --with-arch=armv7-a \
803         --with-tune=cortex-a8 \
804         --disable-sjlj-exceptions \
805 } \
806 %{?armv7hl: \
807         --with-arch=armv7-a \
808         --with-tune=cortex-a8 \
809         --disable-sjlj-exceptions \
810         --with-float=hard \
811 } \
812 %{?aarch64: \
813         --with-arch=armv8-a \
814         --disable-sjlj-exceptions \
815 } \
816         --disable-libgcc \
817         --disable-libgfortran \
818         --disable-libquadmath \
819         --disable-libgomp \
820         --disable-libatomic \
821         --disable-libstdc++-v3 \
822         --disable-libsanitizer \
823         --disable-libitm \
824 } \
825         --with-bugurl="http://bugs.tizen.org/" \
826         --with-pkgversion="Tizen GCC %{version} %{gcc_release} %{release}" \
827         --target=%{target_arch} \
828         --host=%{host_arch} \
829         --build=%{host_arch}
830 }
831
832 %{!?gcc_skip_make:
833 make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} %{!?cross:%{?gcc_profiledbootstrap:profiledbootstrap}}
834 }
835
836 %{?gcc_exit_on_make_finish:
837  exit 1
838 }
839
840 %{?gcc_run_tests:
841   echo "Run testsuite"
842   # asan needs a whole shadow address space
843   ulimit -v unlimited || true
844   make -k check %{?_smp_mflags} || true
845   mkdir ../testresults
846   ../contrib/test_summary | tee ../testresults/test_summary.txt
847 }
848
849 %install
850 cd obj
851
852 make install DESTDIR=$RPM_BUILD_ROOT
853
854 %{?gcc_run_tests:
855   cp `find . -name "*.sum"` ../testresults/
856   cp --parents `find . -name "*.log"  \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
857   chmod 644 `find ../testresults/ -type f`
858 }
859
860 %{remove_docs}
861 rm -rf %{buildroot}/%{_datadir}/locale
862
863 #remove everything we don't need
864 rm -rf %{buildroot}/%{libsubdir}/install-tools
865 find %{buildroot}/ -name "*.la" -delete
866
867 %{!?cross:
868 ln -s gcc %{buildroot}%{_bindir}/cc
869 mv %{buildroot}%{libsubdir}/libstdc++.so*-gdb.py %{buildroot}%{_datadir}/gcc-%{version}/python/libstdcxx/
870
871 # expose plugins for ar (required for lto builds)
872 mkdir -p %{buildroot}%{_prefix}/lib/bfd-plugins
873 ln -sf %{libsubdir}/liblto_plugin.so %{buildroot}%{_prefix}/lib/bfd-plugins/liblto_plugin.so
874
875 # legacy preprocessor
876 mkdir -p %{buildroot}/lib
877 ln -s %{_bindir}/cpp %{buildroot}/lib/cpp
878
879 # 32-bit libgcc in multilib configuration
880 %ifarch x86_64
881 mv %{buildroot}%{_prefix}/lib/libgcc_s.so* %{buildroot}%{libsubdir}/32/
882 %endif
883
884 # move libraries to libdir
885 for lib in asan atomic cilkrts gfortran gomp cc1 itm lsan quadmath stdc++ supc++ tsan ubsan
886 do
887   [ -e %{buildroot}%{libsubdir}/lib$lib.a ] && mv %{buildroot}%{libsubdir}/lib$lib.a %{buildroot}%{libdir}/
888   [ -e %{buildroot}%{libsubdir}/lib$lib.so ] && mv %{buildroot}%{libsubdir}/lib$lib.so* %{buildroot}%{libdir}/
889 done
890 }
891
892 %{?cross:
893 rm -rf %{buildroot}/%{libsubdir}/include-fixed
894 rm -rf %{buildroot}/%{libsubdir}/include
895 }
896
897 %{!?cross:
898 cd ../
899 tar -czf libsanitizer.tar.bz libsanitizer
900 mkdir -p %{buildroot}/src
901 mv -v libsanitizer.tar.bz %{buildroot}/src
902 }
903
904 %files
905 %manifest gcc.manifest
906 %defattr(-,root,root)
907 %{?cross:
908 %{_bindir}/*
909 %{libsubdir}/*
910 }
911 %{!?cross:
912 %{_bindir}/gcc
913 %{_bindir}/cc
914 %{_bindir}/gcov
915 %{_bindir}/gcov-tool
916 %{_bindir}/gcc-ar
917 %{_bindir}/gcc-nm
918 %{_bindir}/gcc-ranlib
919 %{_bindir}/%{target_arch}-gcc
920 %{_bindir}/%{target_arch}-gcc-%{version}
921 %{_bindir}/%{target_arch}-gcc-ar
922 %{_bindir}/%{target_arch}-gcc-nm
923 %{_bindir}/%{target_arch}-gcc-ranlib
924 %{libsubdir}/collect2
925 %{libsubdir}/lto1
926 %{libsubdir}/lto-wrapper
927 %{libsubdir}/liblto_plugin.so*
928 %{_prefix}/lib/bfd-plugins/liblto_plugin.so
929 %{libsubdir}/include-fixed/*
930 %{libsubdir}/include/*.h
931 %{libsubdir}/*.a
932 %{libsubdir}/*.so
933 %{libsubdir}/*.o
934 %{libsubdir}/*.spec
935 %{libdir}/*.so
936 %{libdir}/*.a
937 %ifarch %cilkrts_arch
938 %{libsubdir}/include/cilk/*
939 %endif
940 %{libsubdir}/include/sanitizer/*
941 %ifarch %asan_arch
942 %exclude %{libdir}/libasan.so
943 %endif
944 %ifarch %lsan_arch
945 %exclude %{libdir}/liblsan.so
946 %endif
947 %ifarch %tsan_arch
948 %exclude %{libdir}/libtsan.so
949 %endif
950
951 %files c++
952 %defattr(-,root,root)
953 %{libsubdir}/cc1plus
954 %{_bindir}/g++
955 %{_bindir}/c++
956 %{_bindir}/%{target_arch}-g++
957 %{_bindir}/%{target_arch}-c++
958
959 %files -n libstdc++
960 %manifest gcc.manifest
961 %license COPYING3 COPYING.RUNTIME
962 %defattr(-,root,root)
963 %{libdir}/libstdc++.so.*
964
965 %files -n libstdc++-devel
966 %defattr(-,root,root)
967 %{libdir}/libstdc++.so
968 %{libdir}/libstdc++.a
969 %{libdir}/libsupc++.a
970 %{libsubdir}/include/c++/*
971 %{_datadir}/gcc-%{version}/python/libstdcxx/*
972
973 %files -n libgcc
974 %manifest gcc.manifest
975 %license COPYING3 COPYING.RUNTIME
976 %defattr(-,root,root)
977 %{libdir}/libgcc_s.so.*
978
979 %files -n libgomp
980 %manifest gcc.manifest
981 %license COPYING3 COPYING.RUNTIME
982 %defattr(-,root,root)
983 %{libdir}/libgomp.so.*
984
985 %files -n libcc1
986 %manifest gcc.manifest
987 %defattr(-,root,root)
988 %{libdir}/libcc1.so.*
989
990 %ifarch %asan_arch
991 %files -n libasan
992 %manifest gcc.manifest
993 %license libsanitizer/LICENSE.TXT
994 %defattr(-,root,root)
995 %{libdir}/libasan.so*
996 %endif
997
998 %ifarch %lsan_arch
999 %files -n liblsan
1000 %manifest gcc.manifest
1001 %license libsanitizer/LICENSE.TXT
1002 %defattr(-,root,root)
1003 %{libdir}/liblsan.so*
1004 %endif
1005
1006 %ifarch %tsan_arch
1007 %files -n libtsan
1008 %manifest gcc.manifest
1009 %license libsanitizer/LICENSE.TXT
1010 %defattr(-,root,root)
1011 %{libdir}/libtsan.so*
1012 %endif
1013
1014 %ifarch %atomic_arch
1015 %files -n libatomic
1016 %manifest gcc.manifest
1017 %license COPYING3 COPYING.RUNTIME
1018 %defattr(-,root,root)
1019 %{libdir}/libatomic.so.*
1020 %endif
1021
1022 %ifarch %itm_arch
1023 %files -n libitm
1024 %manifest gcc.manifest
1025 %license COPYING3 COPYING.RUNTIME
1026 %defattr(-,root,root)
1027 %{libdir}/libitm.so.*
1028 %endif
1029
1030 %ifarch %cilkrts_arch
1031 %files -n libcilkrts
1032 %manifest gcc.manifest
1033 %defattr(-,root,root)
1034 %{libdir}/libcilkrts.so.*
1035 %endif
1036
1037 %ifarch %ubsan_arch
1038 %files -n libubsan
1039 %manifest gcc.manifest
1040 %license libsanitizer/LICENSE.TXT
1041 %defattr(-,root,root)
1042 %{libdir}/libubsan.so.*
1043 %endif
1044
1045 %files fortran
1046 %defattr(-,root,root)
1047 %dir %{libsubdir}/finclude
1048 %{_bindir}/gfortran
1049 %{_bindir}/%{target_arch}-gfortran
1050 %{libsubdir}/f951
1051 %{libsubdir}/finclude/*
1052 %{libdir}/libgfortran.a
1053 %{libdir}/libgfortran.so
1054 %{libsubdir}/libgfortran.spec
1055 %{libsubdir}/libcaf_single.a
1056 %ifarch %quadmath_arch
1057 %{libdir}/libquadmath.a
1058 %{libdir}/libquadmath.so
1059 %endif
1060
1061 %files -n libgfortran
1062 %defattr(-,root,root)
1063 %{libdir}/libgfortran.so.*
1064
1065 %ifarch %quadmath_arch
1066 %files -n libquadmath
1067 %manifest gcc.manifest
1068 %license COPYING.LIB
1069 %defattr(-,root,root)
1070 %{libdir}/libquadmath.so.*
1071 %endif
1072
1073 %files -n cpp
1074 %defattr(-,root,root)
1075 %{_bindir}/cpp
1076 %{libsubdir}/cc1
1077 /lib/cpp
1078
1079 %files plugin-devel
1080 %defattr(-,root,root)
1081 %{libsubdir}/plugin/*
1082
1083 %{?gcc_run_tests:
1084 %files testresults
1085 %defattr(-,root,root)
1086 %doc testresults/test_summary.txt
1087 %doc testresults/*.sum
1088 %doc testresults/
1089 }
1090 %ifarch x86_64
1091 %files -n gcc-32bit
1092 %defattr(-,root,root)
1093 %{libsubdir}/32/crt*
1094 %{libsubdir}/32/*.a
1095 %{libsubdir}/32/*.so
1096 %{libsubdir}/32/*.o
1097 %{libsubdir}/32/*.spec
1098
1099 %ifarch %asan_arch
1100 %files -n libasan-32bit
1101 %manifest gcc.manifest
1102 %license libsanitizer/LICENSE.TXT
1103 %defattr(-,root,root)
1104 %{libsubdir}/32/libasan.so.*
1105 %endif
1106
1107 %ifarch %lsan_arch
1108 %files -n liblsan-32bit
1109 %manifest gcc.manifest
1110 %license libsanitizer/LICENSE.TXT
1111 %defattr(-,root,root)
1112 %{libsubdir}/32/liblsan.so.*
1113 %endif
1114
1115 %ifarch %atomic_arch
1116 %files -n libatomic-32bit
1117 %manifest gcc.manifest
1118 %license COPYING3 COPYING.RUNTIME
1119 %defattr(-,root,root)
1120 %{libsubdir}/32/libatomic.so.*
1121 %endif
1122
1123 %ifarch %cilkrts_arch
1124 %files -n libcilkrts-32bit
1125 %defattr(-,root,root)
1126 %{libsubdir}/32/libcilkrts.so.*
1127 %endif
1128
1129 %files -n libgcc-32bit
1130 %manifest gcc.manifest
1131 %license COPYING3 COPYING.RUNTIME
1132 %defattr(-,root,root)
1133 %{libsubdir}/32/libgcc_s.so.*
1134
1135 %files -n libgomp-32bit
1136 %manifest gcc.manifest
1137 %license COPYING3 COPYING.RUNTIME
1138 %defattr(-,root,root)
1139 %{libsubdir}/32/libgomp.so.*
1140
1141 %ifarch %itm_arch
1142 %files -n libitm-32bit
1143 %license COPYING3 COPYING.RUNTIME
1144 %defattr(-,root,root)
1145 %{libsubdir}/32/libitm.so.*
1146 %endif
1147
1148 %files -n libgfortran-32bit
1149 %defattr(-,root,root)
1150 %dir %{libsubdir}/32/finclude
1151 %{libsubdir}/32/libgfortran.so.*
1152 %{libsubdir}/32/finclude/*
1153
1154 %ifarch %quadmath_arch
1155 %files -n libquadmath-32bit
1156 %license COPYING.LIB
1157 %defattr(-,root,root)
1158 %{libsubdir}/32/libquadmath.so.*
1159 %endif
1160
1161 %ifarch %ubsan_arch
1162 %files -n libubsan-32bit
1163 %manifest gcc.manifest
1164 %license libsanitizer/LICENSE.TXT
1165 %defattr(-,root,root)
1166 %{libsubdir}/32/libubsan.so.*
1167 %endif
1168
1169 %files -n libstdc++-32bit
1170 %manifest gcc.manifest
1171 %license COPYING3 COPYING.RUNTIME
1172 %defattr(-,root,root)
1173 %{libsubdir}/32/libstdc++.so.*
1174 %exclude %{libsubdir}/32/libstdc++.so.*-gdb.py
1175
1176 %files -n libstdc++-devel-32bit
1177 %defattr(-,root,root)
1178 %{libsubdir}/32/libstdc++.so.*-gdb.py
1179 %endif
1180
1181 %files -n sanitizer-sources
1182 %defattr(-,root,root,-)
1183 /src/libsanitizer.tar.bz
1184
1185 }
1186
1187 %changelog