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