############################################################################### # IPFire.org - An Open Source Firewall Solution # # Copyright (C) - IPFire Development Team # ############################################################################### # Configure build to compile with graphite build_graphite = 1 name = gcc version = 12.3.0 release = 1.1 maintainer = Michael Tremer groups = Development/Compilers url = https://gcc.gnu.org/ license = GPLv3+ and GPLv2+ with exceptions summary = Various compilers (C, C++, Objective-C, Java, ...). description The gcc package contains the GNU Compiler Collection. \ You'll need this package in order to compile C code. end # This is the at least required version of binutils. binutils_version = 2.35 source_dl = https://ftp.gnu.org/gnu/gcc/%{thisapp}/ sources = %{thisapp}.tar.gz build requires binutils >= %{binutils_version} dejagnu elfutils-devel expect filesystem >= 002 flex glibc-devel >= 2.16 gmp-devel >= 4.3.2 isl-devel >= 0.15 libffi-devel libmpc-devel >= 1.0.1 libxcrypt-devel mpfr-devel >= 3.1.0 perl texinfo zlib-devel zstd-devel end # If graphite support is enabled, we require the devel packages for build. if "%{build_graphite}" == "1" requires += isl-devel >= 0.14 end # Build libquadmath (only on x86). build_libquadmath = 0 # Build liblsan (only on x86_64). build_liblsan = 0 # Build libtasn (only on x86_64). build_libtsan = 0 # Build libubsan build_libubsan = 0 DIR_BUILD = %{DIR_SRC}/gcc-build if "%{DISTRO_ARCH}" == "x86_64" build_libquadmath = 1 build_liblsan = 1 build_libtsan = 1 build_libubsan = 1 end if "%{DISTRO_ARCH}" == "aarch64" build_libubsan = 1 end prepare_cmds # Remove unneeded features that will save some compile time rm -rf lib{gfortran,java,objc} gcc/{fortran,java,objc,objcp} # Apply a sed substitution that will suppress the installation of # libiberty.a. The version of libiberty.a provided by Binutils will be used # instead: sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in # Branding gcc echo "%{DISTRO_NAME} %{version}-%{release}" > gcc/DEV-PHASE # The fixincludes script is known to occasionally erroneously attempt to # "fix" the system headers installed so far. As the headers up to this point # are known to not require fixing, issue the following command to prevent # the fixincludes script from running: sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in end # Disable LTO LTO_CFLAGS = # Disable any string format security checks STRING_FORMAT_SECURITY_CFLAGS = configure_options = \ CFLAGS="%{CFLAGS}" \ CXXFLAGS="%{CXXFLAGS}" \ XCFLAGS="%{CFLAGS}" \ TCFLAGS="%{CFLAGS}" \ --build=%{DISTRO_BUILDTARGET} \ --prefix=%{prefix} \ --libdir=%{libdir} \ --libexecdir=%{libdir} \ --mandir=%{mandir} \ --disable-static \ --enable-shared \ --enable-threads=posix \ --enable-__cxa_atexit \ --enable-languages=c,c++,lto \ --enable-bootstrap \ --with-build-config=bootstrap-lto \ --enable-link-serialization=1 \ --enable-checking=release \ --enable-default-pie \ --enable-default-ssp \ --disable-werror \ --disable-libssp \ --with-system-zlib \ --with-bugurl=https://bugzilla.ipfire.org/ \ --enable-libstdcxx-backtrace \ --disable-libstdcxx-pch \ --with-libstdcxx-zoneinfo=%{datadir}/zoneinfo \ --disable-libunwind-exceptions \ --enable-gnu-unique-object \ --enable-linker-build-id \ --with-linker-hash-style=gnu \ --enable-decimal-float \ --enable-plugin \ --enable-initfini-array \ --disable-libgcj \ --enable-gnu-indirect-function if "%{build_graphite}" == "1" configure_options += \ --with-isl end if "%{DISTRO_ARCH}" == "x86_64" configure_options += \ --disable-multilib \ --with-arch_64=x86-64-v2 \ --enable-cet \ --with-tune=generic end make_build_targets += \ profiledbootstrap \ BOOT_CFLAGS="%{CFLAGS}" \ BOOT_LDFLAGS="%{LDFLAGS}" \ LDFLAGS_FOR_TARGET="%{LDFLAGS}" #test # cd %{DIR_SRC}/gcc-build && make -k check || true # cd %{DIR_APP} && ./contrib/test_summary #end install make install DESTDIR=%{BUILDROOT} # Check if the installation path exists. FULLPATH="%{BUILDROOT}%{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}" [ -d "${FULLPATH}" ] || exit 1 mkdir -pv %{BUILDROOT}%{prefix}/lib ln -sfv ../bin/cpp %{BUILDROOT}%{prefix}/lib/cpp ln -sfv gcc %{BUILDROOT}/usr/bin/cc # Fix libgcc_s symlinks. rm -f ${FULLPATH}/libgcc_s.so %{BUILDROOT}%{libdir}/libgcc_s.so echo '/* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT('`gcc -Wl,--print-output-format -nostdlib -r -o /dev/null`') GROUP ( /%{libdir}/libgcc_s.so.1 libgcc.a )' > ${FULLPATH}/libgcc_s.so chmod -v 755 ${FULLPATH}/libgcc_s.so chmod -v 755 %{BUILDROOT}%{libdir}/libgcc_s.so.1 # Remove some GNU debugger stuff. rm -vf %{BUILDROOT}%{libdir}/lib*.py # libgomp mv -vf %{BUILDROOT}%{libdir}/libgomp.spec ${FULLPATH}/ ln -svf ../../../libgomp.so.1.0.0 ${FULLPATH}/libgomp.so chmod -v 755 %{BUILDROOT}%{libdir}/libgomp.so.1.* # libstdc++ ln -svf ../../../libstdc++.so.6.0.30 ${FULLPATH}/libstdc++.so # libquadmath if [ "%{build_libquadmath}" = "1" ]; then ln -svf ../../../libquadmath.so.0.0.0 ${FULLPATH}/libquadmath.so chmod -v 755 %{BUILDROOT}%{libdir}/libquadmath.so.0.* fi # libitm mv -vf %{BUILDROOT}%{libdir}/libitm.spec ${FULLPATH}/ ln -svf ../../../libitm.so.1.0.0 ${FULLPATH}/libitm.so chmod -v 755 %{BUILDROOT}%{libdir}/libitm.so.1.* # liblsan if [ "%{build_liblsan}" = "1" ]; then ln -svf ../../../liblsan.so.0.0.0 ${FULLPATH}/liblsan.so chmod -v 755 %{BUILDROOT}%{libdir}/liblsan.so.* fi # libtsan if [ "%{build_libtsan}" = "1" ]; then ln -svf ../../../libtsan.so.2.0.0 ${FULLPATH}/libtsan.so chmod -v 755 %{BUILDROOT}%{libdir}/libtsan.so.* fi # libubsan if [ "%{build_libubsan}" = "1" ]; then ln -svf ../../../libubsan.so.1.0.0 ${FULLPATH}/libubsan.so chmod -v 755 %{BUILDROOT}%{libdir}/libubsan.so.* fi end end packages package %{name} groups += Build requires binutils >= %{binutils_version} filesystem >= 002 glibc >= 2.16 glibc-devel gmp-devel cpp = %{thisver} libgcc = %{thisver} libgomp = %{thisver} end # We do not ship libgcc-devel anymore. provides += libgcc-devel = %{thisver} obsoletes += libgcc-devel < %{thisver} end package %{name}-c++ summary = C++ support for GCC. description This package adds C++ support to the GNU Compiler Collection. It includes support for most of the current C++ specification, including templates and exception handling. end requires gcc = %{thisver} libstdc++ = %{thisver} libstdc++-devel = %{thisver} end files /usr/bin/*++ %{libdir}/gcc/*/*/cc1plus /usr/share/man/man*/*++* end end package cpp summary = The C Preprocessor. description Cpp is the GNU C-Compatible Compiler Preprocessor. Cpp is a macro processor which is used automatically by the C compiler to transform your program before actual compilation. It is called a macro processor because it allows you to define macros, abbreviations for longer constructs. The C preprocessor provides four separate functionalities: the inclusion of header files (files of declarations that can be substituted into your program); macro expansion (you can define macros, and the C preprocessor will replace the macros with their definitions throughout the program); conditional compilation (using special preprocessing directives, you can include or exclude parts of the program according to various conditions); and line control (if you use a program to combine or rearrange source files into an intermediate file which is then compiled, you can use line control to inform the compiler about where each source line originated). You should install this package if you are a C programmer and you use macros. end group = Development/Languages files %{prefix}/lib/cpp %{bindir}/cpp %{mandir}/man1/cpp.1* %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/cc1 end provides = /lib/cpp requires = gcc-c++ = %{thisver} end package libgcc summary = GCC shared support library. description This package contains GCC shared support library which is needed e.g. for exception handling support. end files %{libdir}/libgcc*.so.* end obsoletes libmudflap libmudflap-devel end end package libstdc++ summary = GNU Standard C++ Library. description The libstdc++ package contains a rewritten standard compliant GCC Standard C++ Library. end files %{libdir}/libstdc++*.so.* end end package libstdc++-devel summary = Header files and libraries for C++ development. description This is the GNU implementation of the standard C++ libraries. This package includes the header files and libraries needed for C++ development. This includes rewritten implementation of STL. end requires libstdc++ = %{thisver} end files %{includedir}/c++ %{libdir}/libstdc++*.so end end package libstdc++-static summary = Static libraries for the GNU standard C++ library description = %{summary} requires libstdc++-devel = %{thisver} end files %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libstdc++.a %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libsupc++.a end end package libgomp summary = GCC OpenMP v3.0 shared support library. description This package contains GCC shared support library which is needed for OpenMP v3.0 support. end files %{libdir}/libgomp*.so.* end end if "%{build_libquadmath}" == "1" package libquadmath summary = GCC __float128 shared support library. description This package contains GCC shared support library which is needed for __float128 math support and for Fortran REAL*16 support. end files %{libdir}/libquadmath*.so.* end end package libquadmath-devel summary = Development files for GCC __float128 support. description This package contains headers for building Fortran programs using REAL*16 and programs using __float128 math. end requires gcc = %{thisver} libquadmath = %{thisver} end files %{libdir}/libquadmath.so %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/quadmath.h %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/quadmath_weak.h %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libquadmath.so end end end package libitm summary = The GNU Transactional Memory library. description This package contains the GNU Transactional Memory library which is a GCC transactional memory support runtime library. end files %{libdir}/libitm.so.* end end package libitm-devel summary = The GNU Transactional Memory support. description This package contains headers and support files for the GNU Transactional Memory library. end requires gcc = %{thisver} libitm = %{thisver} end files %{libdir}/libitm.so %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/itm.h %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/itm_weak.h %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libitm.so end end package libatomic summary = The GNU Atomic library description This package contains the GNU Atomic library which is a GCC support runtime library for atomisc operations not supported by hardware. end files %{libdir}/libatomic.so.* end end package libasan summary = The Address Sanitizer runtime library description This package contains the Address Sanitizer library which is used for -fsanitize=address instrumented programs. end files %{libdir}/libasan.so.* end end if "%{build_libtsan}" == "1" package libtsan summary = The Thread Sanitizer runtime library description This package contains the Thread Sanitizer library which is used for -fsanitize=thread instrumented programs. end files %{libdir}/libtsan.so.* end end end if "%{build_libubsan}" == "1" package libubsan summary = The Undefined Behavior Sanitizer runtime library description This package contains the Undefined Behavior Sanitizer library which is used for -fsanitize=undefined instrumented programs. end files %{libdir}/libubsan.so.* end end end if "%{build_liblsan}" == "1" package liblsan summary = The Leak Sanitizer runtime library description This package contains the Leak Sanitizer library which is used for -fsanitize=leak instrumented programs. end files %{libdir}/liblsan.so.* end end end package gcc-plugin-devel summary = Support for compiling GCC plugins. description This package contains header files and other support files for compiling GCC plugins. The GCC plugin ABI is currently not stable, so plugins must be rebuilt any time GCC is updated. end requires gcc = %{thisver} gmp-devel >= 4.1.2-8 mpfr-devel >= 2.2.1 libmpc-devel >= 0.8.1 end files %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/plugin end end package %{name}-debuginfo template DEBUGINFO end end