]> git.ipfire.org Git - ipfire-3.x.git/blob - gcc/gcc.nm
gcc: Remove unused cloog configuration
[ipfire-3.x.git] / gcc / gcc.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 # Configure build to compile with graphite
7 build_graphite = 1
8
9 name = gcc
10 version = 5.3.0
11 release = 1
12
13 maintainer = Michael Tremer <michael.tremer@ipfire.org>
14 groups = Development/Compilers
15 url = http://gcc.gnu.org/
16 license = GPLv3+ and GPLv2+ with exceptions
17 summary = Various compilers (C, C++, Objective-C, Java, ...).
18
19 description
20 The gcc package contains the GNU Compiler Collection. \
21 You'll need this package in order to compile C code.
22 end
23
24 # This is the at least required version of binutils.
25 binutils_version = 2.24
26
27 source_dl = http://ftp.gnu.org/gnu/gcc/%{thisapp}/
28 source_dl += ftp://gcc.gnu.org/pub/gcc/infrastructure/
29 sources = %{thisapp}.tar.gz
30
31 build
32 requires
33 autogen
34 binutils >= %{binutils_version}
35 dejagnu
36 elfutils-devel
37 expect
38 filesystem >= 002
39 flex
40 glibc-devel >= 2.16
41 gmp-devel
42 libffi-devel
43 libmpc-devel >= 0.8.1
44 mpfr-devel
45 perl
46 texinfo
47 zlib-devel
48 end
49
50 # If graphite support is enabled, we require the devel packages for build.
51 if "%{build_graphite}" == "1"
52 requires += isl-devel >= 0.14
53 end
54
55 # Build libquadmath (only on x86).
56 build_libquadmath = 0
57
58 # Build liblsan (only on x86_64).
59 build_liblsan = 0
60
61 # Build libtasn (only on x86_64).
62 build_libtsan = 0
63
64 # Build libubsan
65 build_libubsan = 0
66
67 # Build libcilkrts (only x86)
68 build_libcilkrts = 0
69
70 # A couple of configure arguments depending on the architecture and
71 # configuration.
72 configure_options =
73
74 make_bootstrap = profiledbootstrap
75
76 if "%{DISTRO_ARCH}" == "x86_64"
77 configure_options = --disable-multilib
78
79 build_libquadmath = 1
80 build_liblsan = 1
81 build_libtsan = 1
82 build_libubsan = 1
83 build_libcilkrts = 1
84 end
85
86 if "%{DISTRO_ARCH}" == "i686"
87 configure_options = --with-arch=%{DISTRO_ARCH} --with-tune=generic
88
89 build_libquadmath = 1
90 build_libubsan = 1
91 build_libcilkrts = 1
92 end
93
94 if "%{DISTRO_ARCH}" == "aarch64"
95 build_libubsan = 1
96 end
97
98 if "%{DISTRO_ARCH}" == "armv7hl"
99 make_bootstrap = bootstrap
100
101 configure_options += --disable-sjlj-exceptions
102
103 configure_options += \
104 --with-tune=cortex-a8 \
105 --with-arch=armv7-a \
106 --with-float=hard \
107 --with-fpu=vfpv3-d16 \
108 --with-abi=aapcs-linux
109
110 build_libubsan = 1
111 end
112
113 if "%{DISTRO_ARCH}" == "armv5tel"
114 make_bootstrap = bootstrap
115
116 configure_options += --disable-sjlj-exceptions
117 configure_options += --with-float=soft
118
119 build_libubsan = 1
120 end
121
122 if "%{build_graphite}" == "1"
123 configure_options += \
124 --with-isl
125 end
126
127 # CFLAGS for hardening.
128 HARD_CFLAGS = -DENABLE_ESP -DEFAULT_PIE_SSP -DEFAULT_RELRO -DEFAULT_BIND_NOW
129
130 prepare_cmds
131 mkdir -v %{DIR_SRC}/gcc-build
132
133 # Remove unneeded features that will save some compile time
134 rm -rf lib{gfortran,java,objc} gcc/{fortran,java,objc,objcp}
135
136 # Apply a sed substitution that will suppress the installation of
137 # libiberty.a. The version of libiberty.a provided by Binutils will be used
138 # instead:
139 sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
140
141 # Branding gcc
142 echo "%{DISTRO_NAME} %{version}-%{release}" > gcc/DEV-PHASE
143
144 # Libgomp uses -Werror regardless of --disable-werror, and this will cause a
145 # build failure when -D_FORTIFY_SOURCE=2 causes build time warnings:
146 sed -e "s/-Werror//" -i libgomp/configure
147
148 # The fixincludes script is known to occasionally erroneously attempt to
149 # "fix" the system headers installed so far. As the headers up to this point
150 # are known to not require fixing, issue the following command to prevent
151 # the fixincludes script from running:
152 sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
153
154 sed -i gcc/Makefile.in \
155 -e "s/-fno-exceptions/& -fno-asynchronous-unwind-tables/"
156
157 # we want to be able to control the pie patch logic via something other
158 # than ALL_CFLAGS and ALL_CXXFLAGS...
159 sed -i gcc/Makefile.in \
160 -e '/^ALL_CFLAGS/iHARD_CFLAGS = %{HARD_CFLAGS}' \
161 -e 's|^ALL_CFLAGS = |ALL_CFLAGS = $(HARD_CFLAGS) |' \
162 -e '/^ALL_CXXFLAGS/iHARD_CFLAGS = %{HARD_CFLAGS}' \
163 -e 's|^ALL_CXXFLAGS = |ALL_CXXFLAGS = $(HARD_CFLAGS) |'
164
165 # However, genautomata crashes with a "Bus Error" when compiled
166 # with PIC.
167 sed -i gcc/Makefile.in \
168 -e 's|^build/genautomata$(build_exeext) .*|& -fno-PIC|'
169
170 # Default to -gdwarf-4 -fno-debug-types-section rather than -gdwarf-2
171 sed -i gcc/common.opt \
172 -e '/UInteger Var(dwarf_version)/s/Init(2)/Init(4)/' \
173 -e '/flag_debug_types_section/s/Init(1)/Init(0)/' \
174 -e '/dwarf_record_gcc_switches/s/Init(0)/Init(1)/' \
175 -e 's/\(may be either 2, 3 or 4; the default version is \)2\./\14./'
176
177 #./contrib/gcc_update --touch
178 end
179
180 export CC=gcc
181 export CXX=g++
182
183 build
184 cd %{DIR_SRC}/gcc-build
185
186 # Modify CFLAGS
187 CFLAGS="%{CFLAGS}"
188 CFLAGS=$(echo ${CFLAGS} | sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g')
189 CFLAGS=$(echo ${CFLAGS} | sed -e 's/-Werror=format-security//g')
190 CFLAGS=$(echo ${CFLAGS} | sed -e 's/-m64//g;s/-m32//g;s/-m31//g')
191 CFLAGS=$(echo ${CFLAGS} | sed -e 's/-mfpmath=sse/-mfpmath=sse -msse2/g')
192 CFLAGS=$(echo ${CFLAGS} | sed -e 's/-march=i.86//g')
193 CFLAGS=$(echo ${CFLAGS} | sed -e 's/ -pipe / /g')
194 CFLAGS=$(echo "${CFLAGS}" | sed -e 's/[[:blank:]]\+/ /g')
195 CXXFLAGS=$(echo ${CFLAGS} | sed -e 's/ -Wall//g')
196 CXXFLAGS=$(echo ${CXXFLAGS} | sed -e 's/ -fexceptions / /g')
197 #CXXFLAGS=$(echo ${CXXFLAGS} | sed -e 's/ -Werror=format-security / -Wformat -Werror=format-security /g')
198
199 case "${CFLAGS}" in
200 *-fasynchronous-unwind-tables*)
201 sed -i -e "s/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/" \
202 ../%{thisapp}/Makefile.in
203 ;;
204 esac
205
206 CFLAGS="${CFLAGS}" \
207 CXXFLAGS="${CXXFLAGS}" \
208 XCFLAGS="${CFLAGS}" \
209 TCFLAGS="${CFLAGS}" \
210 ../%{thisapp}/configure \
211 --build=%{DISTRO_BUILDTARGET} \
212 --prefix=/usr \
213 --libdir=%{libdir} \
214 --libexecdir=%{libdir} \
215 --mandir=%{mandir} \
216 --enable-esp \
217 --enable-shared \
218 --enable-threads=posix \
219 --enable-__cxa_atexit \
220 --enable-clocale=gnu \
221 --enable-languages=c,c++,lto \
222 --enable-bootstrap \
223 --enable-checking=release \
224 --disable-werror \
225 --disable-libssp \
226 --with-system-zlib \
227 --with-bugurl=http://bugtracker.ipfire.org \
228 --disable-libunwind-exceptions \
229 --enable-gnu-unique-object \
230 --enable-linker-build-id \
231 --with-linker-hash-style=gnu \
232 --enable-plugin \
233 --enable-initfini-array \
234 --disable-libgcj \
235 --enable-gnu-indirect-function \
236 %{configure_options}
237
238 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58012
239 # XXX disabled flags: --disable-static
240
241 # GCC does not support a parallel build.
242 make %{make_bootstrap} BOOT_CFLAGS="${CFLAGS}"
243
244 # Generate man pages.
245 perl -pi -e 's/head3/head2/' ../contrib/texi2pod.pl
246 for i in %{DIR_APP}/gcc/doc/*.texi; do
247 cp -a $i $i.orig; sed 's/ftable/table/' $i.orig > $i
248 done
249 make -C gcc generated-manpages
250 for i in %{DIR_APP}/gcc/doc/*.texi; do mv -f $i.orig $i; done
251 end
252
253 #test
254 # cd %{DIR_SRC}/gcc-build && make -k check || true
255 # cd %{DIR_APP} && ./contrib/test_summary
256 #end
257
258 install
259 cd %{DIR_SRC}/gcc-build
260 make install DESTDIR=%{BUILDROOT}
261
262 # Check if the installation path exists.
263 FULLPATH="%{BUILDROOT}%{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}"
264 [ -d "${FULLPATH}" ] || exit 1
265
266 mkdir -pv %{BUILDROOT}%{prefix}/lib
267 ln -sfv ../bin/cpp %{BUILDROOT}%{prefix}/lib/cpp
268 ln -sfv gcc %{BUILDROOT}/usr/bin/cc
269
270 # Fix libgcc_s symlinks.
271 rm -f ${FULLPATH}/libgcc_s.so %{BUILDROOT}%{libdir}/libgcc_s.so
272 case "%{DISTRO_ARCH}" in
273 arm*)
274 cat <<EOF >${FULLPATH}/libgcc_s.so
275 /* GNU ld script
276 Use the shared library, but some functions are only in
277 the static library, so try that secondarily. */
278 OUTPUT_FORMAT(elf32-littlearm)
279 GROUP ( %{libdir}/libgcc_s.so.1 libgcc.a )
280 EOF
281 ;;
282 *)
283 ln -svf ../../../../..%{libdir}/libgcc_s.so.1 ${FULLPATH}/libgcc_s.so
284 ;;
285 esac
286 chmod 755 %{BUILDROOT}%{libdir}/libgcc_s.so.1
287
288 # Remove some GNU debugger stuff.
289 rm -vf %{BUILDROOT}%{libdir}/lib*.py
290
291 # Install missing header file(s) on ARM.
292 case "%{DISTRO_ARCH}" in
293 arm*)
294 cp -vf %{DIR_APP}/gcc/config/vxworks-dummy.h \
295 ${FULLPATH}/plugin/include/config/
296 cp -vf %{DIR_APP}/gcc/config/arm/arm-cores.def \
297 ${FULLPATH}/plugin/include/config/arm/
298 ;;
299 esac
300
301 # libgomp
302 mv -vf %{BUILDROOT}%{libdir}/libgomp.spec ${FULLPATH}/
303 ln -svf ../../../libgomp.so.1.0.0 ${FULLPATH}/libgomp.so
304 chmod 755 %{BUILDROOT}%{libdir}/libgomp.so.1.*
305
306 # libstdc++
307 ln -svf ../../../libstdc++.so.6.0.21 ${FULLPATH}/libstdc++.so
308 mv -vf %{BUILDROOT}%{libdir}/lib{std,sup}c++.a ${FULLPATH}
309
310 # libquadmath
311 if [ "%{build_libquadmath}" = "1" ]; then
312 ln -svf ../../../libquadmath.so.0.0.0 ${FULLPATH}/libquadmath.so
313 chmod 755 %{BUILDROOT}%{libdir}/libquadmath.so.0.*
314 fi
315
316 # libitm
317 mv -vf %{BUILDROOT}%{libdir}/libitm.spec ${FULLPATH}/
318 ln -svf ../../../libitm.so.1.0.0 ${FULLPATH}/libitm.so
319 chmod 755 %{BUILDROOT}%{libdir}/libitm.so.1.*
320
321 # liblsan
322 if [ "%{build_liblsan}" = "1" ]; then
323 ln -svf ../../../liblsan.so.0.0.0 ${FULLPATH}/liblsan.so
324 chmod 755 %{BUILDROOT}%{libdir}/liblsan.so.*
325 fi
326
327 # libtsan
328 if [ "%{build_libtsan}" = "1" ]; then
329 ln -svf ../../../libtsan.so.0.0.0 ${FULLPATH}/libtsan.so
330 chmod 755 %{BUILDROOT}%{libdir}/libtsan.so.*
331 fi
332
333 # libubsan
334 if [ "%{build_libubsan}" = "1" ]; then
335 ln -svf ../../../libubsan.so.0.0.0 ${FULLPATH}/libubsan.so
336 chmod 755 %{BUILDROOT}%{libdir}/libubsan.so.*
337 fi
338
339 # libcilkrts
340 if [ "%{build_libcilkrts}" = "1" ]; then
341 ln -svf ../../../libcilkrts.so.5.0.0 ${FULLPATH}/libcilkrts.so
342 chmod 755 %{BUILDROOT}%{libdir}/libcilkrts.so.5.*
343 fi
344 end
345
346 keep_libraries
347 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libgcc.a
348 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libgcc_eh.a
349 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libstdc++.a
350 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libsupc++.a
351 end
352 end
353
354 packages
355 package %{name}
356 groups += Build
357
358 requires
359 binutils >= %{binutils_version}
360 filesystem >= 002
361 glibc >= 2.16
362 glibc-devel
363 gmp-devel
364 cpp = %{thisver}
365 libgcc = %{thisver}
366 libgomp = %{thisver}
367 end
368
369 # We do not ship libgcc-devel anymore.
370 provides += libgcc-devel = %{thisver}
371 obsoletes += libgcc-devel < %{thisver}
372 end
373
374 package %{name}-c++
375 summary = C++ support for GCC.
376 description
377 This package adds C++ support to the GNU Compiler Collection.
378 It includes support for most of the current C++ specification,
379 including templates and exception handling.
380 end
381
382 requires
383 gcc = %{thisver}
384 libstdc++ = %{thisver}
385 libstdc++-devel = %{thisver}
386 end
387
388 files
389 /usr/bin/*++
390 %{libdir}/gcc/*/*/cc1plus
391 /usr/share/man/man*/*++*
392 end
393 end
394
395 package cpp
396 summary = The C Preprocessor.
397 description
398 Cpp is the GNU C-Compatible Compiler Preprocessor.
399 Cpp is a macro processor which is used automatically
400 by the C compiler to transform your program before actual
401 compilation. It is called a macro processor because it allows
402 you to define macros, abbreviations for longer
403 constructs.
404
405 The C preprocessor provides four separate functionalities: the
406 inclusion of header files (files of declarations that can be
407 substituted into your program); macro expansion (you can define macros,
408 and the C preprocessor will replace the macros with their definitions
409 throughout the program); conditional compilation (using special
410 preprocessing directives, you can include or exclude parts of the
411 program according to various conditions); and line control (if you use
412 a program to combine or rearrange source files into an intermediate
413 file which is then compiled, you can use line control to inform the
414 compiler about where each source line originated).
415
416 You should install this package if you are a C programmer and you use
417 macros.
418 end
419 group = Development/Languages
420
421 files
422 %{prefix}/lib/cpp
423 %{bindir}/cpp
424 %{mandir}/man1/cpp.1*
425 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/cc1
426 end
427
428 provides = /lib/cpp
429 requires = gcc-c++ = %{thisver}
430 end
431
432 package libgcc
433 summary = GCC shared support library.
434 description
435 This package contains GCC shared support library which is needed
436 e.g. for exception handling support.
437 end
438
439 files
440 %{libdir}/libgcc*.so.*
441 end
442
443 obsoletes
444 libmudflap
445 libmudflap-devel
446 end
447 end
448
449 package libstdc++
450 summary = GNU Standard C++ Library.
451 description
452 The libstdc++ package contains a rewritten standard compliant GCC Standard
453 C++ Library.
454 end
455
456 files
457 %{libdir}/libstdc++*.so.*
458 end
459 end
460
461 package libstdc++-devel
462 summary = Header files and libraries for C++ development.
463 description
464 This is the GNU implementation of the standard C++ libraries. This
465 package includes the header files and libraries needed for C++
466 development. This includes rewritten implementation of STL.
467 end
468
469 requires
470 libstdc++ = %{thisver}
471 end
472
473 files
474 %{includedir}/c++
475 %{libdir}/libstdc++*.so
476 end
477 end
478
479 package libstdc++-static
480 summary = Static libraries for the GNU standard C++ library
481 description = %{summary}
482
483 requires
484 libstdc++-devel = %{thisver}
485 end
486
487 files
488 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libstdc++.a
489 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libsupc++.a
490 end
491 end
492
493 package libgomp
494 summary = GCC OpenMP v3.0 shared support library.
495 description
496 This package contains GCC shared support library which is needed
497 for OpenMP v3.0 support.
498 end
499
500 files
501 %{libdir}/libgomp*.so.*
502 end
503 end
504
505 if "%{build_libquadmath}" == "1"
506 package libquadmath
507 summary = GCC __float128 shared support library.
508 description
509 This package contains GCC shared support library which is needed
510 for __float128 math support and for Fortran REAL*16 support.
511 end
512
513 files
514 %{libdir}/libquadmath*.so.*
515 end
516 end
517
518 package libquadmath-devel
519 summary = Development files for GCC __float128 support.
520 description
521 This package contains headers for building Fortran programs using
522 REAL*16 and programs using __float128 math.
523 end
524
525 requires
526 gcc = %{thisver}
527 libquadmath = %{thisver}
528 end
529
530 files
531 %{libdir}/libquadmath.so
532 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/quadmath.h
533 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/quadmath_weak.h
534 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libquadmath.so
535 end
536 end
537 end
538
539 package libitm
540 summary = The GNU Transactional Memory library.
541 description
542 This package contains the GNU Transactional Memory library
543 which is a GCC transactional memory support runtime library.
544 end
545
546 files
547 %{libdir}/libitm.so.1*
548 end
549 end
550
551 package libitm-devel
552 summary = The GNU Transactional Memory support.
553 description
554 This package contains headers and support files for the
555 GNU Transactional Memory library.
556 end
557
558 requires
559 gcc = %{thisver}
560 libitm = %{thisver}
561 end
562
563 files
564 %{libdir}/libitm.so
565 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/itm.h
566 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/itm_weak.h
567 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libitm.so
568 end
569 end
570
571 package libatomic
572 summary = The GNU Atomic library
573 description
574 This package contains the GNU Atomic library which is a
575 GCC support runtime library for atomisc operations not
576 supported by hardware.
577 end
578
579 files
580 %{libdir}/libatomic.so.1*
581 end
582 end
583
584 package libasan
585 summary = The Address Sanitizer runtime library
586 description
587 This package contains the Address Sanitizer library
588 which is used for -fsanitize=address instrumented programs.
589 end
590
591 files
592 %{libdir}/libasan.so.2*
593 end
594 end
595
596 if "%{build_libtsan}" == "1"
597 package libtsan
598 summary = The Thread Sanitizer runtime library
599 description
600 This package contains the Thread Sanitizer library
601 which is used for -fsanitize=thread instrumented programs.
602 end
603
604 files
605 %{libdir}/libtsan.so.0*
606 end
607 end
608 end
609
610 if "%{build_libubsan}" == "1"
611 package libubsan
612 summary = The Undefined Behavior Sanitizer runtime library
613 description
614 This package contains the Undefined Behavior Sanitizer library
615 which is used for -fsanitize=undefined instrumented programs.
616 end
617
618 files
619 %{libdir}/libubsan.so.0*
620 end
621 end
622 end
623
624 if "%{build_liblsan}" == "1"
625 package liblsan
626 summary = The Leak Sanitizer runtime library
627 description
628 This package contains the Leak Sanitizer library
629 which is used for -fsanitize=leak instrumented programs.
630 end
631
632 files
633 %{libdir}/liblsan.so.0*
634 end
635 end
636 end
637
638 if "%{build_libcilkrts}" == "1"
639 package libcilkrts
640 summary = The Cilk+ runtime library
641 description
642 This package contains the Cilk+ runtime library.
643 end
644
645 files
646 %{libdir}/libcilkrts.so.5*
647 end
648 end
649 end
650
651 package gcc-plugin-devel
652 summary = Support for compiling GCC plugins.
653 description
654 This package contains header files and other support files
655 for compiling GCC plugins. The GCC plugin ABI is currently
656 not stable, so plugins must be rebuilt any time GCC is updated.
657 end
658
659 requires
660 gcc = %{thisver}
661 gmp-devel >= 4.1.2-8
662 mpfr-devel >= 2.2.1
663 libmpc-devel >= 0.8.1
664 end
665
666 files
667 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/plugin
668 end
669 end
670
671 package %{name}-debuginfo
672 template DEBUGINFO
673 end
674 end