# Copyright (C) - IPFire Development Team <info@ipfire.org> #
###############################################################################
-# Configure build to compile with cloog and ppl.
-build_cloog_ppl = 1
+# Configure build to compile with graphite
+build_graphite = 1
name = gcc
-version = 4.8.1
-release = 1
+version = 12.3.0
+release = 1.1
maintainer = Michael Tremer <michael.tremer@ipfire.org>
groups = Development/Compilers
end
# This is the at least required version of binutils.
-required_binutils_version = 2.21.51.0.8-1
+binutils_version = 2.35
-source_dl = http://ftp.gnu.org/gnu/gcc/%{thisapp}/
+source_dl = https://ftp.gnu.org/gnu/gcc/%{thisapp}/
sources = %{thisapp}.tar.gz
build
requires
- autogen
- binutils >= %{required_binutils_version}
+ binutils >= %{binutils_version}
dejagnu
elfutils-devel
expect
filesystem >= 002
flex
glibc-devel >= 2.16
- gmp-devel
+ gmp-devel >= 4.3.2
+ isl-devel >= 0.15
libffi-devel
- libmpc-devel
- mpfr-devel
+ libmpc-devel >= 1.0.1
+ libxcrypt-devel
+ mpfr-devel >= 3.1.0
perl
texinfo
zlib-devel
+ zstd-devel
end
- # If cloog support is enabled, we require the devel packages for build.
- if "%{build_cloog_ppl}" == "1"
- requires += cloog-ppl-devel >= 0.15.11-2
- requires += ppl-devel >= 1.0
+ # 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
- # A couple of configure arguments depending on the architecture and
- # configuration.
- configure_options =
+ # Build libubsan
+ build_libubsan = 0
- make_bootstrap = profiledbootstrap
+ DIR_BUILD = %{DIR_SRC}/gcc-build
if "%{DISTRO_ARCH}" == "x86_64"
- configure_options = --disable-multilib
-
build_libquadmath = 1
+ build_liblsan = 1
build_libtsan = 1
+ build_libubsan = 1
end
- if "%{DISTRO_ARCH}" == "i686"
- configure_options = --with-arch=%{DISTRO_ARCH} --with-tune=generic
-
- build_libquadmath = 1
- end
-
- if "%{DISTRO_ARCH}" == "armv5tel"
- make_bootstrap = bootstrap
-
- configure_options += --disable-sjlj-exceptions
- configure_options += --with-float=soft
+ if "%{DISTRO_ARCH}" == "aarch64"
+ build_libubsan = 1
end
- if "%{DISTRO_ARCH}" == "armv7hl"
- make_bootstrap = bootstrap
-
- configure_options += --disable-sjlj-exceptions
-
- configure_options += \
- --with-cpu=cortex-a8 \
- --with-tune=cortex-a8 \
- --with-arch=armv7-a \
- --with-float=hard \
- --with-fpu=vfpv3-d16 \
- --with-abi=aapcs-linux
- end
-
- if "%{build_cloog_ppl}" == "1"
- configure_options += --with-cloog --with-ppl \
- --disable-ppl-version-check
- end
-
- # CFLAGS for hardening.
- HARD_CFLAGS = -DENABLE_ESP -DEFAULT_PIE_SSP -DEFAULT_RELRO -DEFAULT_BIND_NOW
-
prepare_cmds
- mkdir -v %{DIR_SRC}/gcc-build
-
# Remove unneeded features that will save some compile time
rm -rf lib{gfortran,java,objc} gcc/{fortran,java,objc,objcp}
# Branding gcc
echo "%{DISTRO_NAME} %{version}-%{release}" > gcc/DEV-PHASE
- # Libgomp uses -Werror regardless of --disable-werror, and this will cause a
- # build failure when -D_FORTIFY_SOURCE=2 causes build time warnings:
- sed -e "s/-Werror//" -i libgomp/configure
-
# 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
- sed -i gcc/Makefile.in \
- -e "s/-fno-exceptions/& -fno-asynchronous-unwind-tables/"
-
- # we want to be able to control the pie patch logic via something other
- # than ALL_CFLAGS and ALL_CXXFLAGS...
- sed -i gcc/Makefile.in \
- -e '/^ALL_CFLAGS/iHARD_CFLAGS = %{HARD_CFLAGS}' \
- -e 's|^ALL_CFLAGS = |ALL_CFLAGS = $(HARD_CFLAGS) |' \
- -e '/^ALL_CXXFLAGS/iHARD_CFLAGS = %{HARD_CFLAGS}' \
- -e 's|^ALL_CXXFLAGS = |ALL_CXXFLAGS = $(HARD_CFLAGS) |'
-
- # However, genautomata crashes with a "Bus Error" when compiled
- # with PIC.
- sed -i gcc/Makefile.in \
- -e 's|^build/genautomata$(build_exeext) .*|& -fno-PIC|'
-
- # Default to -gdwarf-4 -fno-debug-types-section rather than -gdwarf-2
- sed -i gcc/common.opt \
- -e '/UInteger Var(dwarf_version)/s/Init(2)/Init(4)/' \
- -e '/flag_debug_types_section/s/Init(1)/Init(0)/' \
- -e '/dwarf_record_gcc_switches/s/Init(0)/Init(1)/' \
- -e 's/\(may be either 2, 3 or 4; the default version is \)2\./\14./'
-
- #./contrib/gcc_update --touch
+ # 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
- build
- cd %{DIR_SRC}/gcc-build
-
- # Modify CFLAGS
- CFLAGS="%{CFLAGS}"
- CFLAGS=$(echo ${CFLAGS} | sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g')
- CFLAGS=$(echo ${CFLAGS} | sed -e 's/-m64//g;s/-m32//g;s/-m31//g')
- CFLAGS=$(echo ${CFLAGS} | sed -e 's/-march=i.86//g')
- CFLAGS=$(echo ${CFLAGS} | sed -e 's/ -pipe / /g')
- CFLAGS=$(echo "${CFLAGS}" | sed -e 's/[[:blank:]]\+/ /g')
- CXXFLAGS=$(echo ${CFLAGS} | sed -e 's/ -Wall//g')
-
- CFLAGS="${CFLAGS}" \
- CXXFLAGS="${CXXFLAGS}" \
- XCFLAGS="${CFLAGS}" \
- TCFLAGS="${CFLAGS}" \
- ../%{thisapp}/configure \
- --build=%{DISTRO_BUILDTARGET} \
- --prefix=/usr \
- --libdir=%{libdir} \
- --libexecdir=%{libdir} \
- --mandir=%{mandir} \
- --enable-esp \
- --enable-shared \
- --enable-threads=posix \
- --enable-__cxa_atexit \
- --enable-clocale=gnu \
- --enable-languages=c,c++,lto \
- --enable-bootstrap \
- --enable-checking=release \
- --disable-werror \
- --disable-libssp \
- --disable-static \
- --with-system-zlib \
- --with-bugurl=http://bugtracker.ipfire.org \
- --disable-libunwind-exceptions \
- --enable-gnu-unique-object \
- --enable-linker-build-id \
- --with-linker-hash-style=gnu \
- --enable-plugin \
- --enable-initfini-array \
- %{configure_options}
-
- # GCC does not support a parallel build.
- make %{make_bootstrap} BOOT_CFLAGS="${CFLAGS}"
-
- # Generate man pages.
- perl -pi -e 's/head3/head2/' ../contrib/texi2pod.pl
- for i in %{DIR_APP}/gcc/doc/*.texi; do
- cp -a $i $i.orig; sed 's/ftable/table/' $i.orig > $i
- done
- make -C gcc generated-manpages
- for i in %{DIR_APP}/gcc/doc/*.texi; do mv -f $i.orig $i; done
+ 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 check
+ # cd %{DIR_SRC}/gcc-build && make -k check || true
# cd %{DIR_APP} && ./contrib/test_summary
#end
install
- cd %{DIR_SRC}/gcc-build
make install DESTDIR=%{BUILDROOT}
# Check if the installation path exists.
# Fix libgcc_s symlinks.
rm -f ${FULLPATH}/libgcc_s.so %{BUILDROOT}%{libdir}/libgcc_s.so
- case "%{DISTRO_ARCH}" in
- arm*)
- cat <<EOF >${FULLPATH}/libgcc_s.so
- /* GNU ld script
- Use the shared library, but some functions are only in
- the static library, so try that secondarily. */
- OUTPUT_FORMAT(elf32-littlearm)
- GROUP ( %{libdir}/libgcc_s.so.1 libgcc.a )
- EOF
- ;;
- *)
- ln -svf ../../../../..%{libdir}/libgcc_s.so.1 ${FULLPATH}/libgcc_s.so
- ;;
- esac
- chmod 755 %{BUILDROOT}%{libdir}/libgcc_s.so.1
+ 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
- # Install missing header file(s) on ARM.
- case "%{DISTRO_ARCH}" in
- arm*)
- cp -vf %{DIR_APP}/gcc/config/vxworks-dummy.h \
- ${FULLPATH}/plugin/include/config/
- cp -vf %{DIR_APP}/gcc/config/arm/arm-cores.def \
- ${FULLPATH}/plugin/include/config/arm/
- ;;
- esac
-
# libgomp
mv -vf %{BUILDROOT}%{libdir}/libgomp.spec ${FULLPATH}/
ln -svf ../../../libgomp.so.1.0.0 ${FULLPATH}/libgomp.so
- chmod 755 %{BUILDROOT}%{libdir}/libgomp.so.1.*
+ chmod -v 755 %{BUILDROOT}%{libdir}/libgomp.so.1.*
# libstdc++
- ln -svf ../../../libstdc++.so.6.0.18 ${FULLPATH}/libstdc++.so
-
- # libmudflap
- ln -svf ../../../libmudflap.so.0.0.0 ${FULLPATH}/libmudflap.so
- ln -svf ../../../libmudflapth.so.0.0.0 ${FULLPATH}/libmudflapth.so
- chmod 755 %{BUILDROOT}%{libdir}/libmudflap{,th}.so.0.*
+ 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 755 %{BUILDROOT}%{libdir}/libquadmath.so.0.*
+ 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 755 %{BUILDROOT}%{libdir}/libitm.so.1.*
- end
+ chmod -v 755 %{BUILDROOT}%{libdir}/libitm.so.1.*
- keep_libraries
- %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libgcc.a
- %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libgcc_eh.a
+ # 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
groups += Build
requires
- binutils >= %{required_binutils_version}
+ binutils >= %{binutils_version}
filesystem >= 002
glibc >= 2.16
glibc-devel
# We do not ship libgcc-devel anymore.
provides += libgcc-devel = %{thisver}
obsoletes += libgcc-devel < %{thisver}
-
- if "%{build_cloog_ppl}" == "1"
- requires += cloog-ppl >= 0.15
- end
end
package %{name}-c++
files
%{libdir}/libgcc*.so.*
end
+
+ obsoletes
+ libmudflap
+ libmudflap-devel
+ end
end
package libstdc++
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
+ package libstdc++-static
+ summary = Static libraries for the GNU standard C++ library
+ description = %{summary}
- package libmudflap
- summary = GCC mudflap shared support library.
- description
- This package contains GCC shared support library which is needed
- for mudflap support.
+ requires
+ libstdc++-devel = %{thisver}
end
files
- %{libdir}/libmudflap*.so.*
+ %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libstdc++.a
+ %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libsupc++.a
end
end
- package libmudflap-devel
- summary = Development files for GCC mudflap support.
+ package libgomp
+ summary = GCC OpenMP v3.0 shared support library.
description
- This package contains headers for building mudflap-instrumented programs.
-
- To instrument a non-threaded program, add -fmudflap
- option to GCC and when linking add -lmudflap, for threaded programs
- also add -fmudflapth and -lmudflapth.
- end
-
- requires
- libmudflap = %{thisver}
+ This package contains GCC shared support library which is needed
+ for OpenMP v3.0 support.
end
files
- %{libdir}/libmudflap.so
- %{libdir}/libmudflapth.so
- %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/mf-runtime.h
- %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libmudflap.so
- %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libmudflapth.so
+ %{libdir}/libgomp*.so.*
end
end
end
files
- %{libdir}/libitm.so.1*
+ %{libdir}/libitm.so.*
end
end
end
files
- %{libdir}/libatomic.so.1*
+ %{libdir}/libatomic.so.*
end
end
end
files
- %{libdir}/libasan.so.0*
+ %{libdir}/libasan.so.*
end
end
end
files
- %{libdir}/libtsan.so.0*
+ %{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