1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
6 # Configure build to compile with graphite
13 maintainer = Michael Tremer <michael.tremer@ipfire.org>
14 groups = Development/Compilers
15 url = https://gcc.gnu.org/
16 license = GPLv3+ and GPLv2+ with exceptions
17 summary = Various compilers (C, C++, Objective-C, Java, ...).
20 The gcc package contains the GNU Compiler Collection. \
21 You'll need this package in order to compile C code.
24 # This is the at least required version of binutils.
25 binutils_version = 2.35
27 source_dl = https://ftp.gnu.org/gnu/gcc/%{thisapp}/
28 sources = %{thisapp}.tar.gz
32 binutils >= %{binutils_version}
51 # If graphite support is enabled, we require the devel packages for build.
52 if "%{build_graphite}" == "1"
53 requires += isl-devel >= 0.14
56 # Build libquadmath (only on x86).
59 # Build liblsan (only on x86_64).
62 # Build libtasn (only on x86_64).
68 DIR_BUILD = %{DIR_SRC}/gcc-build
70 if "%{DISTRO_ARCH}" == "x86_64"
77 if "%{DISTRO_ARCH}" == "aarch64"
82 # Remove unneeded features that will save some compile time
83 rm -rf lib{gfortran,java,objc} gcc/{fortran,java,objc,objcp}
85 # Apply a sed substitution that will suppress the installation of
86 # libiberty.a. The version of libiberty.a provided by Binutils will be used
88 sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
91 echo "%{DISTRO_NAME} %{version}-%{release}" > gcc/DEV-PHASE
93 # The fixincludes script is known to occasionally erroneously attempt to
94 # "fix" the system headers installed so far. As the headers up to this point
95 # are known to not require fixing, issue the following command to prevent
96 # the fixincludes script from running:
97 sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
103 # Disable any string format security checks
104 STRING_FORMAT_SECURITY_CFLAGS =
106 configure_options = \
108 CXXFLAGS="%{CXXFLAGS}" \
109 XCFLAGS="%{CFLAGS}" \
110 TCFLAGS="%{CFLAGS}" \
111 --build=%{DISTRO_BUILDTARGET} \
114 --libexecdir=%{libdir} \
118 --enable-threads=posix \
119 --enable-__cxa_atexit \
120 --enable-languages=c,c++,lto \
122 --with-build-config=bootstrap-lto \
123 --enable-link-serialization=1 \
124 --enable-checking=release \
125 --enable-default-pie \
126 --enable-default-ssp \
130 --with-bugurl=https://bugzilla.ipfire.org/ \
131 --enable-libstdcxx-backtrace \
132 --disable-libstdcxx-pch \
133 --with-libstdcxx-zoneinfo=%{datadir}/zoneinfo \
134 --disable-libunwind-exceptions \
135 --enable-gnu-unique-object \
136 --enable-linker-build-id \
137 --with-linker-hash-style=gnu \
138 --enable-decimal-float \
140 --enable-initfini-array \
142 --enable-gnu-indirect-function
144 if "%{build_graphite}" == "1"
145 configure_options += \
149 if "%{DISTRO_ARCH}" == "x86_64"
150 configure_options += \
152 --with-arch_64=x86-64-v2 \
157 make_build_targets += \
159 BOOT_CFLAGS="%{CFLAGS}" \
160 BOOT_LDFLAGS="%{LDFLAGS}" \
161 LDFLAGS_FOR_TARGET="%{LDFLAGS}"
164 # cd %{DIR_SRC}/gcc-build && make -k check || true
165 # cd %{DIR_APP} && ./contrib/test_summary
169 make install DESTDIR=%{BUILDROOT}
171 # Check if the installation path exists.
172 FULLPATH="%{BUILDROOT}%{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}"
173 [ -d "${FULLPATH}" ] || exit 1
175 mkdir -pv %{BUILDROOT}%{prefix}/lib
176 ln -sfv ../bin/cpp %{BUILDROOT}%{prefix}/lib/cpp
177 ln -sfv gcc %{BUILDROOT}/usr/bin/cc
179 # Fix libgcc_s symlinks.
180 rm -f ${FULLPATH}/libgcc_s.so %{BUILDROOT}%{libdir}/libgcc_s.so
181 echo '/* GNU ld script
182 Use the shared library, but some functions are only in
183 the static library, so try that secondarily. */
185 OUTPUT_FORMAT('`gcc -Wl,--print-output-format -nostdlib -r -o /dev/null`')
186 GROUP ( /%{libdir}/libgcc_s.so.1 libgcc.a )' > ${FULLPATH}/libgcc_s.so
187 chmod -v 755 ${FULLPATH}/libgcc_s.so
188 chmod -v 755 %{BUILDROOT}%{libdir}/libgcc_s.so.1
190 # Remove some GNU debugger stuff.
191 rm -vf %{BUILDROOT}%{libdir}/lib*.py
194 mv -vf %{BUILDROOT}%{libdir}/libgomp.spec ${FULLPATH}/
195 ln -svf ../../../libgomp.so.1.0.0 ${FULLPATH}/libgomp.so
196 chmod -v 755 %{BUILDROOT}%{libdir}/libgomp.so.1.*
199 ln -svf ../../../libstdc++.so.6.0.30 ${FULLPATH}/libstdc++.so
202 if [ "%{build_libquadmath}" = "1" ]; then
203 ln -svf ../../../libquadmath.so.0.0.0 ${FULLPATH}/libquadmath.so
204 chmod -v 755 %{BUILDROOT}%{libdir}/libquadmath.so.0.*
208 mv -vf %{BUILDROOT}%{libdir}/libitm.spec ${FULLPATH}/
209 ln -svf ../../../libitm.so.1.0.0 ${FULLPATH}/libitm.so
210 chmod -v 755 %{BUILDROOT}%{libdir}/libitm.so.1.*
213 if [ "%{build_liblsan}" = "1" ]; then
214 ln -svf ../../../liblsan.so.0.0.0 ${FULLPATH}/liblsan.so
215 chmod -v 755 %{BUILDROOT}%{libdir}/liblsan.so.*
219 if [ "%{build_libtsan}" = "1" ]; then
220 ln -svf ../../../libtsan.so.2.0.0 ${FULLPATH}/libtsan.so
221 chmod -v 755 %{BUILDROOT}%{libdir}/libtsan.so.*
225 if [ "%{build_libubsan}" = "1" ]; then
226 ln -svf ../../../libubsan.so.1.0.0 ${FULLPATH}/libubsan.so
227 chmod -v 755 %{BUILDROOT}%{libdir}/libubsan.so.*
237 binutils >= %{binutils_version}
247 # We do not ship libgcc-devel anymore.
248 provides += libgcc-devel = %{thisver}
249 obsoletes += libgcc-devel < %{thisver}
253 summary = C++ support for GCC.
255 This package adds C++ support to the GNU Compiler Collection.
256 It includes support for most of the current C++ specification,
257 including templates and exception handling.
262 libstdc++ = %{thisver}
263 libstdc++-devel = %{thisver}
268 %{libdir}/gcc/*/*/cc1plus
269 /usr/share/man/man*/*++*
274 summary = The C Preprocessor.
276 Cpp is the GNU C-Compatible Compiler Preprocessor.
277 Cpp is a macro processor which is used automatically
278 by the C compiler to transform your program before actual
279 compilation. It is called a macro processor because it allows
280 you to define macros, abbreviations for longer
283 The C preprocessor provides four separate functionalities: the
284 inclusion of header files (files of declarations that can be
285 substituted into your program); macro expansion (you can define macros,
286 and the C preprocessor will replace the macros with their definitions
287 throughout the program); conditional compilation (using special
288 preprocessing directives, you can include or exclude parts of the
289 program according to various conditions); and line control (if you use
290 a program to combine or rearrange source files into an intermediate
291 file which is then compiled, you can use line control to inform the
292 compiler about where each source line originated).
294 You should install this package if you are a C programmer and you use
297 group = Development/Languages
302 %{mandir}/man1/cpp.1*
303 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/cc1
307 requires = gcc-c++ = %{thisver}
311 summary = GCC shared support library.
313 This package contains GCC shared support library which is needed
314 e.g. for exception handling support.
318 %{libdir}/libgcc*.so.*
328 summary = GNU Standard C++ Library.
330 The libstdc++ package contains a rewritten standard compliant GCC Standard
335 %{libdir}/libstdc++*.so.*
339 package libstdc++-devel
340 summary = Header files and libraries for C++ development.
342 This is the GNU implementation of the standard C++ libraries. This
343 package includes the header files and libraries needed for C++
344 development. This includes rewritten implementation of STL.
348 libstdc++ = %{thisver}
353 %{libdir}/libstdc++*.so
357 package libstdc++-static
358 summary = Static libraries for the GNU standard C++ library
359 description = %{summary}
362 libstdc++-devel = %{thisver}
366 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libstdc++.a
367 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libsupc++.a
372 summary = GCC OpenMP v3.0 shared support library.
374 This package contains GCC shared support library which is needed
375 for OpenMP v3.0 support.
379 %{libdir}/libgomp*.so.*
383 if "%{build_libquadmath}" == "1"
385 summary = GCC __float128 shared support library.
387 This package contains GCC shared support library which is needed
388 for __float128 math support and for Fortran REAL*16 support.
392 %{libdir}/libquadmath*.so.*
396 package libquadmath-devel
397 summary = Development files for GCC __float128 support.
399 This package contains headers for building Fortran programs using
400 REAL*16 and programs using __float128 math.
405 libquadmath = %{thisver}
409 %{libdir}/libquadmath.so
410 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/quadmath.h
411 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/quadmath_weak.h
412 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libquadmath.so
418 summary = The GNU Transactional Memory library.
420 This package contains the GNU Transactional Memory library
421 which is a GCC transactional memory support runtime library.
425 %{libdir}/libitm.so.*
430 summary = The GNU Transactional Memory support.
432 This package contains headers and support files for the
433 GNU Transactional Memory library.
443 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/itm.h
444 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/itm_weak.h
445 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libitm.so
450 summary = The GNU Atomic library
452 This package contains the GNU Atomic library which is a
453 GCC support runtime library for atomisc operations not
454 supported by hardware.
458 %{libdir}/libatomic.so.*
463 summary = The Address Sanitizer runtime library
465 This package contains the Address Sanitizer library
466 which is used for -fsanitize=address instrumented programs.
470 %{libdir}/libasan.so.*
474 if "%{build_libtsan}" == "1"
476 summary = The Thread Sanitizer runtime library
478 This package contains the Thread Sanitizer library
479 which is used for -fsanitize=thread instrumented programs.
483 %{libdir}/libtsan.so.*
488 if "%{build_libubsan}" == "1"
490 summary = The Undefined Behavior Sanitizer runtime library
492 This package contains the Undefined Behavior Sanitizer library
493 which is used for -fsanitize=undefined instrumented programs.
497 %{libdir}/libubsan.so.*
502 if "%{build_liblsan}" == "1"
504 summary = The Leak Sanitizer runtime library
506 This package contains the Leak Sanitizer library
507 which is used for -fsanitize=leak instrumented programs.
511 %{libdir}/liblsan.so.*
516 package gcc-plugin-devel
517 summary = Support for compiling GCC plugins.
519 This package contains header files and other support files
520 for compiling GCC plugins. The GCC plugin ABI is currently
521 not stable, so plugins must be rebuilt any time GCC is updated.
528 libmpc-devel >= 0.8.1
532 %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/plugin
536 package %{name}-debuginfo