]> git.ipfire.org Git - people/pmueller/ipfire-3.x.git/blobdiff - gcc/gcc.nm
prevent kernel address space leak via dmesg or /proc files
[people/pmueller/ipfire-3.x.git] / gcc / gcc.nm
index 919dccc4c88bd27d45c8aa56e9b9019f846c775c..cd3fb35a85367176999ed13f84252216dd9296b1 100644 (file)
@@ -3,11 +3,11 @@
 # Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
 ###############################################################################
 
-# Configure build to compile with cloog.
-build_cloog = 1
+# Configure build to compile with graphite
+build_graphite = 1
 
 name       = gcc
-version    = 4.9.1
+version    = 8.2.0
 release    = 1
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
@@ -23,7 +23,6 @@ end
 
 # This is the at least required version of binutils.
 binutils_version = 2.24
-cloog_version    = 0.18.1
 
 source_dl  = http://ftp.gnu.org/gnu/gcc/%{thisapp}/
 source_dl += ftp://gcc.gnu.org/pub/gcc/infrastructure/
@@ -41,17 +40,16 @@ build
                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}" == "1"
-               requires += cloog-devel >= %{cloog_version}
-               requires += isl-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).
@@ -63,8 +61,11 @@ build
        # Build libtasn (only on x86_64).
        build_libtsan = 0
 
-       # Build libcilkrts (only x86)
-       build_libcilkrts = 0
+       # Build libubsan
+       build_libubsan = 0
+
+       # Build libmpx (only on x86_64)
+       build_libmpx = 0
 
        # A couple of configure arguments depending on the architecture and
        # configuration.
@@ -78,21 +79,19 @@ build
                build_libquadmath = 1
                build_liblsan = 1
                build_libtsan = 1
-               build_libcilkrts = 1
+               build_libubsan = 1
+               build_libmpx = 1
        end
 
        if "%{DISTRO_ARCH}" == "i686"
                configure_options = --with-arch=%{DISTRO_ARCH} --with-tune=generic
 
                build_libquadmath = 1
-               build_libcilkrts = 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"
@@ -101,23 +100,28 @@ build
                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}" == "1"
-               configure_options += \
-                       --with-cloog=%{prefix} \
-                       --with-isl=%{prefix} \
-                       --enable-cloog-backend=isl
+       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 = -DENABLE_ESP -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
@@ -146,35 +150,19 @@ 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 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
        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')
@@ -182,7 +170,7 @@ build
                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')
+               #CXXFLAGS=$(echo  ${CXXFLAGS} | sed -e 's/ -Werror=format-security / -Wformat -Werror=format-security /g')
 
                case "${CFLAGS}" in
                        *-fasynchronous-unwind-tables*)
@@ -201,6 +189,7 @@ build
                        --libdir=%{libdir} \
                        --libexecdir=%{libdir} \
                        --mandir=%{mandir} \
+                       --with-boot-ldflags="%{LDFLAGS}" \
                        --enable-esp \
                        --enable-shared \
                        --enable-threads=posix \
@@ -209,6 +198,7 @@ build
                        --enable-languages=c,c++,lto \
                        --enable-bootstrap \
                        --enable-checking=release \
+                       --enable-default-pie \
                        --disable-werror \
                        --disable-libssp \
                        --with-system-zlib \
@@ -220,6 +210,7 @@ build
                        --enable-plugin \
                        --enable-initfini-array \
                        --disable-libgcj \
+                       --enable-gnu-indirect-function \
                        %{configure_options}
 
                # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58012
@@ -291,7 +282,8 @@ build
                chmod 755 %{BUILDROOT}%{libdir}/libgomp.so.1.*
 
                # libstdc++
-               ln -svf ../../../libstdc++.so.6.0.20 ${FULLPATH}/libstdc++.so
+               ln -svf ../../../libstdc++.so.6.0.25 ${FULLPATH}/libstdc++.so
+               mv -vf %{BUILDROOT}%{libdir}/lib{std,sup}c++.a ${FULLPATH}
 
                # libquadmath
                if [ "%{build_libquadmath}" = "1" ]; then
@@ -317,19 +309,22 @@ build
                fi
 
                # libubsan
-               ln -svf ../../../libubsan.so.0.0.0 ${FULLPATH}/libubsan.so
-               chmod 755 %{BUILDROOT}%{libdir}/libubsan.so.*
+               if [ "%{build_libubsan}" = "1" ]; then
+                       ln -svf ../../../libubsan.so.1.0.0 ${FULLPATH}/libubsan.so
+                       chmod 755 %{BUILDROOT}%{libdir}/libubsan.so.*
+               fi
 
-               # libcilkrts
-               if [ "%{build_libcilkrts}" = "1" ]; then
-                       ln -svf ../../../libcilkrts.so.5.0.0 ${FULLPATH}/libcilkrts.so
-                       chmod 755 %{BUILDROOT}%{libdir}/libcilkrts.so.5.*
+               if [ "%{build_libmpx}" = "1" ]; then
+                       ln -svf ../../../libmpx.so.2.0.1 ${FULLPATH}/libmpx.so
+                       ln -svf ../../../libmpxwrappers.so.2.0.1 ${FULLPATH}/libmpxwrappers.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
 
@@ -351,10 +346,6 @@ packages
                # We do not ship libgcc-devel anymore.
                provides += libgcc-devel = %{thisver}
                obsoletes += libgcc-devel < %{thisver}
-
-               if "%{build_cloog}" == "1"
-                       requires += cloog >= %{cloog_version}
-               end
        end
 
        package %{name}-c++
@@ -462,6 +453,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
@@ -516,7 +521,7 @@ packages
                end
 
                files
-                       %{libdir}/libitm.so.1*
+                       %{libdir}/libitm.so.*
                end
        end
 
@@ -549,7 +554,7 @@ packages
                end
 
                files
-                       %{libdir}/libatomic.so.1*
+                       %{libdir}/libatomic.so.*
                end
        end
 
@@ -561,7 +566,7 @@ packages
                end
 
                files
-                       %{libdir}/libasan.so.1*
+                       %{libdir}/libasan.so.*
                end
        end
 
@@ -574,20 +579,22 @@ packages
                        end
 
                        files
-                               %{libdir}/libtsan.so.0*
+                               %{libdir}/libtsan.so.*
                        end
                end
        end
 
-       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
+       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.0*
+                       files
+                               %{libdir}/libubsan.so.*
+                       end
                end
        end
 
@@ -600,20 +607,23 @@ packages
                        end
 
                        files
-                               %{libdir}/liblsan.so.0*
+                               %{libdir}/liblsan.so.*
                        end
                end
        end
 
-       if "%{build_libcilkrts}" == "1"
-               package libcilkrts
-                       summary = The Cilk+ runtime library
+       if "%{build_libmpx}" == "1"
+               package libmpx
+                       summary = The Memory Protection Extensions runtime libraries
                        description
-                               This package contains the Cilk+ runtime library.
+                               This package contains the Memory Protection Extensions
+                               runtime libraries which is used for -fcheck-pointer-bounds
+                               -mmpx instrumented programs.
                        end
 
                        files
-                               %{libdir}/libcilkrts.so.5*
+                               %{libdir}/libmpx.so.*
+                               %{libdir}/libmpxwrappers.so.*
                        end
                end
        end