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