fd960c56be6234e8c36114054212990db5b40059
[platform/upstream/linaro-gcc.git] / packaging / linaro-gcc.spec
1 #
2 # spec file for package gcc6
3 #
4 # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 # Copyright (c) 2015 Tizen
6 #
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.
15
16 # Please submit bugfixes or comments via http://bugs.tizen.org/
17 #
18 # we use %%{?macro: ... } as it is more compact
19 %if 0%{?run_tests}
20 %define gcc_run_tests 1
21 %endif
22
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
32
33 %ifarch armv7l
34 %define ARCH armv7l
35 %define ABI eabi
36 %endif
37 %ifarch armv7hl
38 %define ARCH armv7hl
39 %define ABI eabihf
40 %endif
41 %ifarch %ix86
42 %define ARCH i586
43 %endif
44 %ifarch x86_64
45 %define ARCH x86_64
46 %endif
47 %ifarch aarch64
48 %define ARCH aarch64
49 %endif
50 %define host_arch %{ARCH}-tizen-linux-gnu%{?ABI}
51
52 %define target_cpu %{?cross}%{!?cross:%{ARCH}}
53 %define target_abi %{?cross:%{?armv7l:eabi}%{?armv7hl:eabihf}}%{!?cross:%{?ABI}}
54
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}
58
59 Name:         gcc%{?cross:-%{cross}}
60 # With generated files in src we could drop the following
61 BuildRequires: bison
62 BuildRequires: flex
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
68 %ifarch x86_64
69 BuildRequires: glibc-devel-32bit
70 %endif
71 BuildRequires: perl
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
77 BuildRequires: expect
78 BuildRequires: gdb
79 %endif
80 URL:           http://gcc.gnu.org/
81 Version:       6.2.1
82 Release:       0
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
91 License:       GPL-3.0+
92 %{?cross:ExcludeArch: %{cross}}
93 %description
94 Core package for the GNU Compiler Collection, including the C language
95 frontend.
96
97 %package c++
98 Summary:       The GNU C++ Compiler
99 License:       GPL-3.0+
100 Group:         Development/Languages
101 %description c++
102 This package contains the GNU compiler for C++.
103
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
112
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.
120
121 %package -n libgcc
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
129
130 %package -n libgomp
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
138 option.
139 %post -n libgomp -p /sbin/ldconfig
140 %postun -n libgomp -p /sbin/ldconfig
141
142 %package objc
143 Summary:       GNU Objective C Compiler
144 License:       GPL-3.0+
145 Group:         Development/Languages
146 %description objc
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.
150
151 %package -n libobjc
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
159
160 %package -n libcc1
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
168
169 %package obj-c++
170 Summary:       GNU Objective C++ Compiler
171 License:       GPL-3.0+
172 Group:         Development/Languages
173 %description obj-c++
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.
177
178 %package -n cpp
179 Summary:       The GCC Preprocessor
180 License:       GPL-3.0+
181 Group:         Development/Languages
182 %description -n cpp
183 This Package contains just the preprocessor that is used by the X11
184 packages.
185
186 %package ada
187 Summary:       GNU Ada95 Compiler Based on GCC (GNAT)
188 License:       GPL-3.0+
189 Group:         Development/Languages
190 %description ada
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.
195
196 %package -n libada
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
209
210 %package fortran
211 Summary:       The GNU Fortran Compiler and Support Files
212 License:       GPL-3.0+
213 Group:         Development/Languages
214 %description fortran
215 This is the Fortran compiler of the GNU Compiler Collection (GCC).
216
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
226
227 %package -n libquadmath
228 Summary:       The GNU Fortran Compiler Quadmath Runtime Library
229 License:       LGPL-2.1
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
234 operations.
235 %post -n libquadmath -p /sbin/ldconfig
236 %postun -n libquadmath -p /sbin/ldconfig
237
238 %package -n libitm
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
247
248 %package -n libasan
249 Summary:       The GNU Compiler Address Sanitizer Runtime Library
250 License:       MIT
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
257
258 %package -n libtsan
259 Summary:       The GNU Compiler Thread Sanitizer Runtime Library
260 License:       MIT
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
267
268 %package -n libesan
269 Summary:       The GNU Compiler Efficciency Sanitier Runtime Library
270 License:       MIT
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
277
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
286
287 %package -n libcilkrts
288 Summary:       The GNU Compiler Cilk+ Runtime Library
289 License:       MIT
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
296
297 %package -n liblsan
298 Summary:       The GNU Compiler Leak Sanitizer Runtime Library
299 License:       MIT
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
306
307 %package -n libubsan
308 Summary:       The GNU Compiler Undefined Sanitizer Runtime Library
309 License:       MIT
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
316
317 %package -n libvtv
318 Summary:       The GNU Compiler Vtable Verifier Runtime Library
319 License:       MIT
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
326
327 %package -n libgcj
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
336
337 %package java
338 Summary:       The GNU Java Compiler
339 License:       GPL-3.0+
340 Group:         Development/Languages
341 %description java
342 The Java compiler from the GCC-tools-suite.
343
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
352 libgcj.so changes.
353
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.
360
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.
368
369 %package -n gcc-gij
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.
375
376 %package -n libffi
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
384
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.
391
392 %package go
393 Summary:       GNU Go Compiler
394 License:       GPL-3.0+
395 Group:         Development/Languages
396 %description go
397 This package contains a Go compiler and associated development
398 files based on the GNU GCC technology.
399
400 %package -n libgo
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
408
409 %package testresults
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.
415
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.
421
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.
429
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
438
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
447 option.
448 %post -n libgomp-32bit -p /sbin/ldconfig
449 %postun -n libgomp-32bit -p /sbin/ldconfig
450
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
459
460 %package objc-32bit
461 Summary:       GNU Objective C Compiler
462 License:       GPL-3.0+
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.
468
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
477
478 %package ada-32bit
479 Summary:       GNU Ada95 Compiler Based on GCC (GNAT)
480 License:       GPL-3.0+
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.
487
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
501
502 %package fortran-32bit
503 Summary:       The GNU Fortran Compiler and Support Files
504 License:       GPL-3.0+
505 Group:         Development/Languages
506 %description fortran-32bit
507 This is the Fortran compiler of the GNU Compiler Collection (GCC).
508
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
518
519 %package -n libquadmath-32bit
520 Summary:       The GNU Fortran Compiler Quadmath Runtime Library
521 License:       LGPL-2.1
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
526 operations.
527 %post -n libquadmath-32bit -p /sbin/ldconfig
528 %postun -n libquadmath-32bit -p /sbin/ldconfig
529
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
539
540 %package -n libasan-32bit
541 Summary:       The GNU Compiler Address Sanitizer Runtime Library
542 License:       MIT
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
549
550 %package -n liblsan-32bit
551 Summary:       The GNU Compiler Address Sanitizer Runtime Library
552 License:       MIT
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
559
560 %package -n libtsan-32bit
561 Summary:       The GNU Compiler Thread Sanitizer Runtime Library
562 License:       MIT
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
569
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
578
579 %package -n libcilkrts-32bit
580 Summary:       The GNU Compiler Cilk+ Runtime Library
581 License:       MIT
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
588
589 %package -n libubsan-32bit
590 Summary:       The GNU Compiler Undefined Sanitizer Runtime Library
591 License:       MIT
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
598
599 %package -n libvtv-32bit
600 Summary:       The GNU Compiler Vtable Verifier Runtime Library
601 License:       MIT
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
608
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
617
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.
624
625 %package go-32bit
626 Summary:       GNU Go Compiler
627 License:       GPL-3.0+
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.
632
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
641
642 %package plugin-devel
643 Summary:       GNU GCC Plugin development files
644 License:       GPL-3.0+
645 Group:         Development/Languages
646 %description plugin-devel
647 This package contains GCC Plugin development files needed for compiler
648 plugins build.
649
650 %package -n sanitizer-sources
651 Summary:    Sanitizer family tools sources
652 License:       MIT
653 Group:      Development/Tools
654 BuildArch:  noarch
655
656 %description -n sanitizer-sources
657 Sanitizer family tools sources for external tools.
658
659 %prep
660
661 %setup -q -n gcc-%{version}
662 cp %{SOURCE20} .
663
664 tar xf %{SOURCE10}
665 ln -sf gmp-6.1.1 gmp
666 tar xf %{SOURCE11}
667 ln -sf mpfr-3.1.5 mpfr
668 tar xf %{SOURCE12}
669 ln -sf mpc-1.0.3 mpc
670 tar xf %{SOURCE13}
671 ln -sf isl-0.17.1 isl
672
673 echo "" > gcc/DEV-PHASE
674
675 %global gcc_release `sed -e 's/^.*-//g' %{_builddir}/gcc-%{version}/gcc/LINARO-VERSION`
676
677 %build
678 %{?asan:
679 %gcc_unforce_options
680 %ifarch armv7l
681 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -marm -Wa,-mimplicit-it=arm -fno-omit-frame-pointer"
682 %endif
683 }
684 %{?esan:%gcc_unforce_options}
685 rm -rf obj
686 mkdir obj
687 cd obj
688
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"`
691 %{?cross:
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'`
694 }
695 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS|sed -e 's/  */ /g'`
696 %{?asan: RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS -DASAN_INIT_FIRST) }
697
698 %ifarch armv7l armv7hl aarch64
699 %undefine gcc_profiledbootstrap
700 %endif
701
702 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" XCFLAGS="$RPM_OPT_FLAGS" \
703 TCFLAGS="$RPM_OPT_FLAGS" GCJFLAGS="$RPM_OPT_FLAGS" \
704 ../configure \
705         --prefix=%{_prefix} \
706         --infodir=%{_infodir} \
707         --mandir=%{_mandir} \
708         --libdir=%{libdir} \
709         --libexecdir=%{libdir} \
710         --enable-languages=c,c++,fortran \
711         --enable-checking=release \
712         --disable-libssp \
713         %{!?gcc_profiledbootstrap:--disable-bootstrap} \
714         --disable-libvtv \
715         --enable-plugin \
716         --disable-libcc1 \
717         --disable-libgcj \
718         --with-slibdir=%{libdir} \
719         --with-system-zlib \
720         --with-sysroot=/ \
721         --enable-__cxa_atexit \
722         --enable-libstdcxx-allocator=new \
723         --enable-version-specific-runtime-libs \
724         --enable-linker-build-id \
725         --without-system-libunwind \
726         --enable-threads=posix \
727         --disable-multilib \
728         --enable-lto \
729 %{!?cross: \
730         --enable-libcc1 \
731         --enable-libgfortran \
732         %{?asanbootstrap:--enable-bootstrap --with-build-config=bootstrap-asan} \
733 %ifarch armv7l
734         --with-arch=armv7-a \
735         --with-tune=cortex-a8 \
736         --disable-sjlj-exceptions \
737 %endif
738 %ifarch armv7hl
739         --with-arch=armv7-a \
740         --with-tune=cortex-a8 \
741         --disable-sjlj-exceptions \
742         --with-float=hard \
743 %endif
744 %ifarch aarch64
745         --with-arch=armv8-a \
746         --disable-sjlj-exceptions \
747 %endif
748 %ifarch %ix86
749         --with-arch-32=i586 \
750         --with-tune=generic \
751         --disable-libmpx \
752 %endif
753 %ifarch x86_64
754         --with-arch-32=i586 \
755         --with-tune=generic \
756         --enable-multilib \
757         --disable-libmpx \
758 %endif
759 } \
760 %{?cross: \
761 %{?armv7l: \
762         --with-arch=armv7-a \
763         --with-tune=cortex-a8 \
764         --disable-sjlj-exceptions \
765 } \
766 %{?armv7hl: \
767         --with-arch=armv7-a \
768         --with-tune=cortex-a8 \
769         --disable-sjlj-exceptions \
770         --with-float=hard \
771 } \
772 %{?aarch64: \
773         --with-arch=armv8-a \
774         --disable-sjlj-exceptions \
775 } \
776         --disable-libgcc \
777         --disable-libgfortran \
778         --disable-libquadmath \
779         --disable-libgomp \
780         --disable-libatomic \
781         --disable-libstdc++-v3 \
782         --disable-libsanitizer \
783         --disable-libitm \
784 } \
785         --with-bugurl="http://bugs.tizen.org/" \
786         --with-pkgversion="Tizen/Linaro GCC %{version} %{gcc_release}" \
787         --target=%{target_arch} \
788         --host=%{host_arch} \
789         --build=%{host_arch}
790
791 make BOOT_CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags} %{!?cross:%{?gcc_profiledbootstrap:profiledbootstrap}}
792 %{?gcc_run_tests:
793   echo "Run testsuite"
794   # asan needs a whole shadow address space
795   ulimit -v unlimited || true
796   make -k check %{?_smp_mflags} || true
797   mkdir ../testresults
798   ../contrib/test_summary | tee ../testresults/test_summary.txt
799 }
800
801 %install
802 cd obj
803
804 make install DESTDIR=$RPM_BUILD_ROOT
805
806 %{?gcc_run_tests:
807   cp `find . -name "*.sum"` ../testresults/
808   cp `find . -name "*.log"  \! -name "config.log" | grep -v 'acats.\?/tests' ` ../testresults/
809   chmod 644 ../testresults/*
810 }
811
812 %{remove_docs}
813 rm -rf %{buildroot}/%{_datadir}/locale
814
815 #remove everything we don't need
816 rm -rf %{buildroot}/%{libsubdir}/install-tools
817 find %{buildroot}/ -name "*.la" -delete
818
819 %{!?cross:
820 ln -s gcc %{buildroot}%{_bindir}/cc
821 mv %{buildroot}%{libsubdir}/libstdc++.so*-gdb.py %{buildroot}%{_datadir}/gcc-%{version}/python/libstdcxx/
822
823 # expose plugins for ar (required for lto builds)
824 mkdir -p %{buildroot}%{_prefix}/lib/bfd-plugins
825 ln -sf %{libsubdir}/liblto_plugin.so %{buildroot}%{_prefix}/lib/bfd-plugins/liblto_plugin.so
826
827 # legacy preprocessor
828 mkdir -p %{buildroot}/lib
829 ln -s %{_bindir}/cpp %{buildroot}/lib/cpp
830
831 # 32-bit libgcc in multilib configuration
832 %ifarch x86_64
833 mv %{buildroot}%{_prefix}/lib/libgcc_s.so* %{buildroot}%{libsubdir}/32/
834 %endif
835
836 # move libraries to libdir
837 for lib in asan atomic cilkrts gfortran gomp cc1 itm lsan quadmath stdc++ supc++ tsan ubsan esan
838 do
839   [ -e %{buildroot}%{libsubdir}/lib$lib.a ] && mv %{buildroot}%{libsubdir}/lib$lib.a %{buildroot}%{libdir}/
840   [ -e %{buildroot}%{libsubdir}/lib$lib.so ] && mv %{buildroot}%{libsubdir}/lib$lib.so* %{buildroot}%{libdir}/
841 done
842 }
843
844 %{?cross:
845 rm -rf %{buildroot}/%{libsubdir}/include-fixed
846 rm -rf %{buildroot}/%{libsubdir}/include
847 }
848
849 %{!?cross:
850 cd ../
851 tar -czf libsanitizer.tar.bz libsanitizer
852 mkdir -p %{buildroot}/src
853 mv -v libsanitizer.tar.bz %{buildroot}/src
854 }
855
856 %files
857 %manifest gcc.manifest
858 %defattr(-,root,root)
859 %{?cross:
860 %{_bindir}/*
861 %{libsubdir}/*
862 }
863 %{!?cross:
864 %{_bindir}/gcc
865 %{_bindir}/cc
866 %{_bindir}/gcov
867 %{_bindir}/gcov-tool
868 %{_bindir}/gcc-ar
869 %{_bindir}/gcc-nm
870 %{_bindir}/gcc-ranlib
871 %{_bindir}/%{target_arch}-gcc
872 %{_bindir}/%{target_arch}-gcc-%{version}
873 %{_bindir}/%{target_arch}-gcc-ar
874 %{_bindir}/%{target_arch}-gcc-nm
875 %{_bindir}/%{target_arch}-gcc-ranlib
876 %{libsubdir}/collect2
877 %{libsubdir}/lto1
878 %{libsubdir}/lto-wrapper
879 %{libsubdir}/liblto_plugin.so*
880 %{_prefix}/lib/bfd-plugins/liblto_plugin.so
881 %{libsubdir}/include-fixed/*
882 %{libsubdir}/include/*.h
883 %{libsubdir}/*.a
884 %{libsubdir}/*.so
885 %{libsubdir}/*.o
886 %{libsubdir}/*.spec
887 %{libdir}/*.so
888 %{libdir}/*.a
889 %ifarch %cilkrts_arch
890 %{libsubdir}/include/cilk/*
891 %endif
892 %{libsubdir}/include/sanitizer/*
893 %ifarch %asan_arch
894 %exclude %{libdir}/libasan.so
895 %endif
896 %ifarch %lsan_arch
897 %exclude %{libdir}/liblsan.so
898 %endif
899 %ifarch %tsan_arch
900 %exclude %{libdir}/libtsan.so
901 %endif
902 %ifarch %esan_arch
903 %exclude %{libdir}/libesan.so
904 %endif
905
906 %files c++
907 %defattr(-,root,root)
908 %{libsubdir}/cc1plus
909 %{_bindir}/g++
910 %{_bindir}/c++
911 %{_bindir}/%{target_arch}-g++
912 %{_bindir}/%{target_arch}-c++
913
914 %files -n libstdc++
915 %manifest gcc.manifest
916 %license COPYING3 COPYING.RUNTIME
917 %defattr(-,root,root)
918 %{libdir}/libstdc++.so.*
919
920 %files -n libstdc++-devel
921 %defattr(-,root,root)
922 %{libdir}/libstdc++.so
923 %{libdir}/libstdc++.a
924 %{libdir}/libsupc++.a
925 %{libsubdir}/include/c++/*
926 %{_datadir}/gcc-%{version}/python/libstdcxx/*
927
928 %files -n libgcc
929 %manifest gcc.manifest
930 %license COPYING3 COPYING.RUNTIME
931 %defattr(-,root,root)
932 %{libdir}/libgcc_s.so.*
933
934 %files -n libgomp
935 %manifest gcc.manifest
936 %license COPYING3 COPYING.RUNTIME
937 %defattr(-,root,root)
938 %{libdir}/libgomp.so.*
939
940 %files -n libcc1
941 %manifest gcc.manifest
942 %defattr(-,root,root)
943 %{libdir}/libcc1.so.*
944
945 %ifarch %asan_arch
946 %files -n libasan
947 %manifest gcc.manifest
948 %license libsanitizer/LICENSE.TXT
949 %defattr(-,root,root)
950 %{libdir}/libasan.so*
951 %endif
952
953 %ifarch %lsan_arch
954 %files -n liblsan
955 %manifest gcc.manifest
956 %license libsanitizer/LICENSE.TXT
957 %defattr(-,root,root)
958 %{libdir}/liblsan.so*
959 %endif
960
961 %ifarch %tsan_arch
962 %files -n libtsan
963 %manifest gcc.manifest
964 %license libsanitizer/LICENSE.TXT
965 %defattr(-,root,root)
966 %{libdir}/libtsan.so*
967 %endif
968
969 %ifarch %esan_arch
970 %files -n libesan
971 %manifest gcc.manifest
972 %license libsanitizer/LICENSE.TXT
973 %defattr(-,root,root)
974 %{libdir}/libesan.so*
975 %endif
976
977 %ifarch %atomic_arch
978 %files -n libatomic
979 %manifest gcc.manifest
980 %license COPYING3 COPYING.RUNTIME
981 %defattr(-,root,root)
982 %{libdir}/libatomic.so.*
983 %endif
984
985 %ifarch %itm_arch
986 %files -n libitm
987 %manifest gcc.manifest
988 %license COPYING3 COPYING.RUNTIME
989 %defattr(-,root,root)
990 %{libdir}/libitm.so.*
991 %endif
992
993 %ifarch %cilkrts_arch
994 %files -n libcilkrts
995 %manifest gcc.manifest
996 %defattr(-,root,root)
997 %{libdir}/libcilkrts.so.*
998 %endif
999
1000 %ifarch %ubsan_arch
1001 %files -n libubsan
1002 %manifest gcc.manifest
1003 %license libsanitizer/LICENSE.TXT
1004 %defattr(-,root,root)
1005 %{libdir}/libubsan.so.*
1006 %endif
1007
1008 %files fortran
1009 %defattr(-,root,root)
1010 %dir %{libsubdir}/finclude
1011 %{_bindir}/gfortran
1012 %{_bindir}/%{target_arch}-gfortran
1013 %{libsubdir}/f951
1014 %{libsubdir}/finclude/*
1015 %{libdir}/libgfortran.a
1016 %{libdir}/libgfortran.so
1017 %{libsubdir}/libgfortran.spec
1018 %{libsubdir}/libcaf_single.a
1019 %ifarch %quadmath_arch
1020 %{libdir}/libquadmath.a
1021 %{libdir}/libquadmath.so
1022 %endif
1023
1024 %files -n libgfortran
1025 %defattr(-,root,root)
1026 %{libdir}/libgfortran.so.*
1027
1028 %ifarch %quadmath_arch
1029 %files -n libquadmath
1030 %manifest gcc.manifest
1031 %license COPYING.LIB
1032 %defattr(-,root,root)
1033 %{libdir}/libquadmath.so.*
1034 %endif
1035
1036 %files -n cpp
1037 %defattr(-,root,root)
1038 %{_bindir}/cpp
1039 %{libsubdir}/cc1
1040 /lib/cpp
1041
1042 %files plugin-devel
1043 %defattr(-,root,root)
1044 %{libsubdir}/plugin/*
1045
1046 %{?gcc_run_tests:
1047 %files testresults
1048 %defattr(-,root,root)
1049 %doc testresults/test_summary.txt
1050 %doc testresults/*.sum
1051 %doc testresults/*.log
1052 }
1053 %ifarch x86_64
1054 %files -n gcc-32bit
1055 %defattr(-,root,root)
1056 %{libsubdir}/32/crt*
1057 %{libsubdir}/32/*.a
1058 %{libsubdir}/32/*.so
1059 %{libsubdir}/32/*.o
1060 %{libsubdir}/32/*.spec
1061
1062 %ifarch %asan_arch
1063 %files -n libasan-32bit
1064 %manifest gcc.manifest
1065 %license libsanitizer/LICENSE.TXT
1066 %defattr(-,root,root)
1067 %{libsubdir}/32/libasan.so.*
1068 %endif
1069
1070 %ifarch %lsan_arch
1071 %files -n liblsan-32bit
1072 %manifest gcc.manifest
1073 %license libsanitizer/LICENSE.TXT
1074 %defattr(-,root,root)
1075 %{libsubdir}/32/liblsan.so.*
1076 %endif
1077
1078 %ifarch %atomic_arch
1079 %files -n libatomic-32bit
1080 %manifest gcc.manifest
1081 %license COPYING3 COPYING.RUNTIME
1082 %defattr(-,root,root)
1083 %{libsubdir}/32/libatomic.so.*
1084 %endif
1085
1086 %ifarch %cilkrts_arch
1087 %files -n libcilkrts-32bit
1088 %defattr(-,root,root)
1089 %{libsubdir}/32/libcilkrts.so.*
1090 %endif
1091
1092 %files -n libgcc-32bit
1093 %manifest gcc.manifest
1094 %license COPYING3 COPYING.RUNTIME
1095 %defattr(-,root,root)
1096 %{libsubdir}/32/libgcc_s.so.*
1097
1098 %files -n libgomp-32bit
1099 %manifest gcc.manifest
1100 %license COPYING3 COPYING.RUNTIME
1101 %defattr(-,root,root)
1102 %{libsubdir}/32/libgomp.so.*
1103
1104 %ifarch %itm_arch
1105 %files -n libitm-32bit
1106 %license COPYING3 COPYING.RUNTIME
1107 %defattr(-,root,root)
1108 %{libsubdir}/32/libitm.so.*
1109 %endif
1110
1111 %files -n libgfortran-32bit
1112 %defattr(-,root,root)
1113 %dir %{libsubdir}/32/finclude
1114 %{libsubdir}/32/libgfortran.so.*
1115 %{libsubdir}/32/finclude/*
1116
1117 %ifarch %quadmath_arch
1118 %files -n libquadmath-32bit
1119 %license COPYING.LIB
1120 %defattr(-,root,root)
1121 %{libsubdir}/32/libquadmath.so.*
1122 %endif
1123
1124 %ifarch %ubsan_arch
1125 %files -n libubsan-32bit
1126 %manifest gcc.manifest
1127 %license libsanitizer/LICENSE.TXT
1128 %defattr(-,root,root)
1129 %{libsubdir}/32/libubsan.so.*
1130 %endif
1131
1132 %files -n libstdc++-32bit
1133 %manifest gcc.manifest
1134 %license COPYING3 COPYING.RUNTIME
1135 %defattr(-,root,root)
1136 %{libsubdir}/32/libstdc++.so.*
1137 %exclude %{libsubdir}/32/libstdc++.so.*-gdb.py
1138
1139 %files -n libstdc++-devel-32bit
1140 %defattr(-,root,root)
1141 %{libsubdir}/32/libstdc++.so.*-gdb.py
1142 %endif
1143
1144 %files -n sanitizer-sources
1145 %defattr(-,root,root,-)
1146 /src/libsanitizer.tar.bz
1147
1148 }
1149
1150 %changelog