]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
gcc: Fix CFLAGS that confused the hardening.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 19 Feb 2011 11:56:32 +0000 (12:56 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 19 Feb 2011 11:56:32 +0000 (12:56 +0100)
There were some options on the CFLAGS that had to be removed
to make the hardening (SSP, PIC, etc.) working.

Additionally, I fixed the --with-arch flags that did not work,
lately.

pkgs/core/gcc/gcc.nm

index c24ed3f0e965841b8578175f0f80132340379603..2fbc8b36affa0a678716bbf505a6ebadd1ae5209 100644 (file)
@@ -26,7 +26,7 @@ include $(PKGROOT)/Include
 
 PKG_NAME       = gcc
 PKG_VER        = 4.5.2
-PKG_REL        = 4
+PKG_REL        = 5
 
 PKG_MAINTAINER = Michael Tremer <michael.tremer@ipfire.org>
 PKG_GROUP      = Development/Compilers
@@ -40,22 +40,30 @@ define PKG_DESCRIPTION
 endef
 
 PKG_BUILD_DEPS+= autogen cloog-devel dejagnu elfutils-devel expect gmp-devel \
-       libffi-devel mpc-devel mpfr-devel pkg-config ppl-devel zlib-devel
+       libffi-devel mpc-devel mpfr-devel pkg-config ppl-devel texinfo zlib-devel
 PKG_DEPS-gcc  += binutils libgcc-devel
 
 # Make the GCC target platform
 GCC_TARGET_PLATFORM = $(subst -gnu,,$(DISTRO_MACHINE))
 
-ifeq "$(MACHINE)" "i586"
-       CONFIGURE_ARGS = --disable-decimal-float
+ifeq "$(DISTRO_ARCH)" "x86_64"
+       CONFIGURE_ARGS = --disable-multilib
 endif
 
-ifeq "$(MACHINE)" "x86_64"
-       CONFIGURE_ARGS = --disable-multilib
-else
-       CONFIG_CPU = --with-cpu=$(TARGET_MACHINE) --with-arch=$(TARGET_MACHINE)
+ifeq "$(DISTRO_ARCH)" "i686"
+       CONFIGURE_ARGS = --with-arch=$(DISTRO_ARCH) --with-tune=generic
 endif
 
+# Modify CFLAGS
+#  Remove -m32 and -m64
+CFLAGS := $(subst -m32,,$(CFLAGS))
+CFLAGS := $(subst -m64,,$(CFLAGS))
+#  Remove -march=i686
+CFLAGS := $(subst -march=i686,,$(CFLAGS))
+
+export CFLAGS
+export CXXFLAGS = $(subst -Wall,,$(CFLAGS))
+
 PKG_TARBALL   += $(THISAPP).tar.gz
 
 # A package for C++
@@ -141,14 +149,18 @@ define STAGE_PREPARE_CMDS
        # are known to not require fixing, issue the following command to prevent
        # the fixincludes script from running:
        cd $(DIR_APP) && sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
+
+       cd $(DIR_APP) && sed -i gcc/Makefile.in \
+               -e "s/-fno-exceptions/& -fno-asynchronous-unwind-tables/"
 endef
 
 define STAGE_BUILD
        cd $(DIR_SRC)/gcc-build && \
+               CFLAGS="$(CFLAGS)" \
+               CXXFLAGS="$(CXXFLAGS)" \
                XCFLAGS="$(CFLAGS)" \
                TCFLAGS="$(CFLAGS)" \
                ../$(THISAPP)/configure \
-                       $(CONFIG_CPU) \
                        --build=$(GCC_TARGET_PLATFORM) \
                        --prefix=/usr \
                        --libexecdir=/usr/lib \