]> git.ipfire.org Git - ipfire-3.x.git/blobdiff - gcc/gcc.nm
git: Update to 2.23.0
[ipfire-3.x.git] / gcc / gcc.nm
index 845ad5434e6ba3da0844967bc5452dbfc958597c..64831ef3a197fa7e1532dce0a61aadd98c011357 100644 (file)
@@ -3,12 +3,12 @@
 # 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.6.2
-release    = 11
+version    = 9.1.0
+release    = 1
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
 groups     = Development/Compilers
@@ -22,52 +22,48 @@ description
 end
 
 # This is the at least required version of binutils.
-required_binutils_version = 2.21.51.0.8-1
+binutils_version = 2.24
 
 source_dl  = http://ftp.gnu.org/gnu/gcc/%{thisapp}/
+source_dl += ftp://gcc.gnu.org/pub/gcc/infrastructure/
 sources    = %{thisapp}.tar.gz
 
-patches = \
-       gcc46-hack.patch0 \
-       gcc46-c++-builtin-redecl.patch0 \
-       gcc46-pr33763.patch0 \
-       gcc46-libgomp-omp_h-multilib.patch0 \
-       gcc46-libtool-no-rpath.patch0 \
-       gcc46-cloog-dl.patch0 \
-       gcc46-pr38757.patch0 \
-       gcc46-no-add-needed.patch0 \
-       gcc46-unwind-debughook-sdt.patch0 \
-       gcc46-ppl-0.10.patch \
-       gcc46-Woverlength-string.patch0 \
-       gcc46-Woverlength-string-asm.patch0 \
-       gcc-4.6.0-piepatches-20110407.patch
-
 build
        requires
                autogen
-               binutils>=%{required_binutils_version}
+               binutils >= %{binutils_version}
                dejagnu
                elfutils-devel
                expect
+               filesystem >= 002
                flex
-               glibc-devel
+               glibc-devel >= 2.16
                gmp-devel
                libffi-devel
-               libmpc-devel
+               libmpc-devel >= 0.8.1
                mpfr-devel
+               perl
                texinfo
                zlib-devel
        end
 
-       # If cloog support is enabled, we require the devel packages for build.
-       if "%{build_cloog_ppl}" == "1"
-               requires += cloog-ppl-devel
-               requires += ppl-devel
+       # 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
+
        # A couple of configure arguments depending on the architecture and
        # configuration.
        configure_options =
@@ -78,41 +74,50 @@ build
                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
+               build_libubsan = 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"
+       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
+
+               build_libubsan = 1
        end
 
-       if "%{build_cloog_ppl}" == "1"
-               configure_options += --with-cloog --with-ppl
+       if "%{DISTRO_ARCH}" == "armv5tel"
+               make_bootstrap = bootstrap
+
+               configure_options += --disable-sjlj-exceptions
+               configure_options += --with-float=soft
+
+               build_libubsan = 1
        end
 
-       # CFLAGS for hardening.
-       HARD_CFLAGS = -DEFAULT_PIE_SSP -DEFAULT_RELRO -DEFAULT_BIND_NOW
+       if "%{build_graphite}" == "1"
+               configure_options += \
+                       --with-isl
+       end
 
        prepare_cmds
                mkdir -v %{DIR_SRC}/gcc-build
@@ -141,41 +146,34 @@ build
                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...
-               sed -i gcc/Makefile.in \
-                       -e '/^ALL_CFLAGS/iHARD_CFLAGS = ' \
-                       -e 's|^ALL_CFLAGS = |ALL_CFLAGS = $(HARD_CFLAGS) |'
-
-               # Enable the GCC hardening by default.
-               sed -i gcc/Makefile.in \
-                       -e "s|^HARD_CFLAGS = |HARD_CFLAGS = %{HARD_CFLAGS} |"
-
-               # Compile the compiler with -fPIC as well.
-               sed -i gcc/Makefile.in \
-                       -e "s|^ESP_NOPIE_CFLAGS = .*|ESP_NOPIE_CFLAGS =|"
-
-               # 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
+               #./contrib/gcc_update --touch
        end
 
+       export CC=gcc
+       export CXX=g++
+
        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/-Werror=format-security//g')
                CFLAGS=$(echo ${CFLAGS} | sed -e 's/-m64//g;s/-m32//g;s/-m31//g')
+               CFLAGS=$(echo ${CFLAGS} | sed -e 's/-mfpmath=sse/-mfpmath=sse -msse2/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')
+               CXXFLAGS=$(echo  ${CXXFLAGS} | sed -e 's/ -fexceptions / /g')
+               #CXXFLAGS=$(echo  ${CXXFLAGS} | sed -e 's/ -Werror=format-security / -Wformat -Werror=format-security /g')
+
+               case "${CFLAGS}" in
+                       *-fasynchronous-unwind-tables*)
+                               sed -i -e "s/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/" \
+                                       ../%{thisapp}/Makefile.in
+                               ;;
+               esac
 
                CFLAGS="${CFLAGS}" \
                CXXFLAGS="${CXXFLAGS}" \
@@ -186,7 +184,8 @@ build
                        --prefix=/usr \
                        --libdir=%{libdir} \
                        --libexecdir=%{libdir} \
-                       --mandir=/usr/share/man \
+                       --mandir=%{mandir} \
+                       --with-boot-ldflags="%{LDFLAGS}" \
                        --enable-esp \
                        --enable-shared \
                        --enable-threads=posix \
@@ -195,22 +194,38 @@ build
                        --enable-languages=c,c++,lto \
                        --enable-bootstrap \
                        --enable-checking=release \
+                       --enable-default-pie \
                        --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 \
+                       --disable-libgcj \
+                       --enable-gnu-indirect-function \
                        %{configure_options}
 
+               # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58012
+               # XXX disabled flags: --disable-static
+
                # 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
        end
 
        #test
-       #       cd %{DIR_SRC}/gcc-build && make check
+       #       cd %{DIR_SRC}/gcc-build && make -k check || true
        #       cd %{DIR_APP} && ./contrib/test_summary
        #end
 
@@ -222,14 +237,12 @@ build
                FULLPATH="%{BUILDROOT}%{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}"
                [ -d "${FULLPATH}" ] || exit 1
 
-               mkdir -pv %{BUILDROOT}/%{lib}
-               ln -sfv ../usr/bin/cpp %{BUILDROOT}/%{lib}/cpp
+               mkdir -pv %{BUILDROOT}%{prefix}/lib
+               ln -sfv ../bin/cpp %{BUILDROOT}%{prefix}/lib/cpp
                ln -sfv gcc %{BUILDROOT}/usr/bin/cc
 
-               # Move libgcc_s to /lib
+               # Fix libgcc_s symlinks.
                rm -f ${FULLPATH}/libgcc_s.so %{BUILDROOT}%{libdir}/libgcc_s.so
-               mkdir -pv %{BUILDROOT}/%{lib}
-               mv -vf %{BUILDROOT}%{libdir}/libgcc_s.so.1 %{BUILDROOT}/%{lib}/
                case "%{DISTRO_ARCH}" in
                        arm*)
                                cat <<EOF >${FULLPATH}/libgcc_s.so
@@ -237,40 +250,72 @@ build
                   Use the shared library, but some functions are only in
                   the static library, so try that secondarily.  */
                OUTPUT_FORMAT(elf32-littlearm)
-               GROUP ( /%{lib}/libgcc_s.so.1 libgcc.a )
+               GROUP ( %{libdir}/libgcc_s.so.1 libgcc.a )
                EOF
                                ;;
                        *)
-                               ln -svf ../../../../../%{lib}/libgcc_s.so.1 ${FULLPATH}/libgcc_s.so
+                               ln -svf ../../../../..%{libdir}/libgcc_s.so.1 ${FULLPATH}/libgcc_s.so
                                ;;
                esac
+               chmod 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.*
 
                # libstdc++
-               ln -svf ../../../libstdc++.so.6.0.16 ${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.26 ${FULLPATH}/libstdc++.so
+               mv -vf %{BUILDROOT}%{libdir}/lib{std,sup}c++.a ${FULLPATH}
 
                # libquadmath
                if [ "%{build_libquadmath}" = "1" ]; then
                        ln -svf ../../../libquadmath.so.0.0.0 ${FULLPATH}/libquadmath.so
                        chmod 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.*
+
+               # liblsan
+               if [ "%{build_liblsan}" = "1" ]; then
+                       ln -svf ../../../liblsan.so.0.0.0 ${FULLPATH}/liblsan.so
+                       chmod 755 %{BUILDROOT}%{libdir}/liblsan.so.*
+               fi
+
+               # libtsan
+               if [ "%{build_libtsan}" = "1" ]; then
+                       ln -svf ../../../libtsan.so.0.0.0 ${FULLPATH}/libtsan.so
+                       chmod 755 %{BUILDROOT}%{libdir}/libtsan.so.*
+               fi
+
+               # libubsan
+               if [ "%{build_libubsan}" = "1" ]; then
+                       ln -svf ../../../libubsan.so.1.0.0 ${FULLPATH}/libubsan.so
+                       chmod 755 %{BUILDROOT}%{libdir}/libubsan.so.*
+               fi
        end
 
        keep_libraries
                %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libgcc.a
                %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libgcc_eh.a
+               %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libstdc++.a
+               %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libsupc++.a
        end
 end
 
@@ -279,21 +324,19 @@ packages
                groups += Build
 
                requires
-                       binutils>=%{required_binutils_version}
+                       binutils >= %{binutils_version}
+                       filesystem >= 002
+                       glibc >= 2.16
                        glibc-devel
                        gmp-devel
-                       cpp=%{thisver}
-                       libgcc=%{thisver}
-                       libgomp=%{thisver}
+                       cpp = %{thisver}
+                       libgcc = %{thisver}
+                       libgomp = %{thisver}
                end
 
                # 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
+               provides += libgcc-devel = %{thisver}
+               obsoletes += libgcc-devel < %{thisver}
        end
 
        package %{name}-c++
@@ -305,9 +348,9 @@ packages
                end
 
                requires
-                       gcc=%{thisver}
-                       libstdc++=%{thisver}
-                       libstdc++-devel=%{thisver}
+                       gcc = %{thisver}
+                       libstdc++ = %{thisver}
+                       libstdc++-devel = %{thisver}
                end
 
                files
@@ -344,11 +387,14 @@ packages
                group = Development/Languages
 
                files
-                       /%{lib}/cpp
-                       /usr/bin/cpp
-                       /usr/share/man/man1/cpp.1*
+                       %{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
@@ -359,7 +405,12 @@ packages
                end
 
                files
-                       /%{lib}/libgcc*.so.*
+                       %{libdir}/libgcc*.so.*
+               end
+
+               obsoletes
+                       libmudflap
+                       libmudflap-devel
                end
        end
 
@@ -384,7 +435,7 @@ packages
                end
 
                requires
-                       libstdc++=%{thisver}
+                       libstdc++ = %{thisver}
                end
 
                files
@@ -393,6 +444,20 @@ packages
                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
@@ -405,68 +470,135 @@ packages
                end
        end
 
-       package libmudflap
-               summary = GCC mudflap shared support library.
+       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 GCC shared support library which is needed
-                       for mudflap support.
+                       This package contains the GNU Transactional Memory library
+                       which is a GCC transactional memory support runtime library.
                end
 
                files
-                       %{libdir}/libmudflap*.so.*
+                       %{libdir}/libitm.so.*
                end
        end
 
-       package libmudflap-devel
-               summary = Development files for GCC mudflap support.
+       package libitm-devel
+               summary = The GNU Transactional Memory support.
                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.
+                       This package contains headers and support files for the
+                       GNU Transactional Memory library.
                end
 
                requires
-                       libmudflap=%{thisver}
+                       gcc = %{thisver}
+                       libitm = %{thisver}
                end
 
                files
-                       %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/mf-runtime.h
-                       %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libmudflap.so
-                       %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libmudflapth.so
+                       %{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
 
-       if "%{build_libquadmath}" == "1"
-               package libquadmath
-                       summary = GCC __float128 shared support library.
+       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 GCC shared support library which is needed
-                               for __float128 math support and for Fortran REAL*16 support.
+                               This package contains the Thread Sanitizer library
+                               which is used for -fsanitize=thread instrumented programs.
                        end
 
                        files
-                               %{libdir}/libquadmath*.so.*
+                               %{libdir}/libtsan.so.*
                        end
                end
+       end
 
-               package libquadmath-devel
-                       summary = Development files for GCC __float128 support.
+       if "%{build_libubsan}" == "1"
+               package libubsan
+                       summary = The Undefined Behavior Sanitizer runtime library
                        description
-                               This package contains headers for building Fortran programs using
-                               REAL*16 and programs using __float128 math.
+                               This package contains the Undefined Behavior Sanitizer library
+                               which is used for -fsanitize=undefined instrumented programs.
                        end
 
-                       requires
-                               gcc=%{thisver}
-                               libquadmath=%{thisver}
+                       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}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/quadmath.h
-                               %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/include/quadmath_weak.h
-                               %{libdir}/gcc/%{DISTRO_BUILDTARGET}/%{version}/libquadmath.so
+                               %{libdir}/liblsan.so.*
                        end
                end
        end
@@ -480,10 +612,10 @@ packages
                end
 
                requires
-                       gcc=%{thisver}
-                       gmp-devel>=4.1.2-8
-                       mpfr-devel>=2.2.1
-                       libmpc-devel>=0.8.1
+                       gcc = %{thisver}
+                       gmp-devel >= 4.1.2-8
+                       mpfr-devel >= 2.2.1
+                       libmpc-devel >= 0.8.1
                end
 
                files