]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Revert "Revert "toolchain: Fix compiling due to Stack Protector changes.""
authorArne Fitzenreiter <arne_f@ipfire.org>
Wed, 22 Oct 2014 11:49:54 +0000 (13:49 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Wed, 22 Oct 2014 11:49:54 +0000 (13:49 +0200)
This reverts commit 4ec728f840372f61d61c5019d766f453231eb706.

lfs/gcc
lfs/glibc

diff --git a/lfs/gcc b/lfs/gcc
index a9f124b8cee0a393baa355d5acec5d44fd53db51..0264d37f8308aa989604c40f15303aa2c69ddbab 100644 (file)
--- a/lfs/gcc
+++ b/lfs/gcc
@@ -97,6 +97,9 @@ else
   EXTRA_MAKE = 
   EXTRA_INSTALL = 
 endif
+
+  # Disable stack protection in toolchain.
+  CFLAGS += -fno-stack-protector
 endif
 
 ifeq "$(MACHINE_TYPE)" "arm"
index 32c494f24388a06cbb18d45530f3372d148ca564..ee332c40f0ade2e9316a7d3b7a771cd6c8b6e6e0 100644 (file)
--- a/lfs/glibc
+++ b/lfs/glibc
@@ -297,8 +297,21 @@ endif
        cd $(DIR_SRC)/glibc-build && \
                CFLAGS="$(CFLAGS) -fno-asynchronous-unwind-tables" \
                $(DIR_APP)/configure $(EXTRA_CONFIG)
+
+       sed -i $(DIR_SRC)/glibc-build/config.make \
+               -e "s/^build-pic-default=.*/build-pic-default=yes/"
+
+       # Build the glibc libraries without stack protection (as this is not supported)
+       echo "build-programs=no" >> $(DIR_SRC)/glibc-build/configparms
+       cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=$(MAKETUNING) \
+               CFLAGS="$(CFLAGS) -fno-stack-protector -U_FORTIFY_SOURCE" \
+               CXXFLAGS="$(CXXFLAGS) -fno-stack-protector -U_FORTIFY_SOURCE"
+
+       # Build the programs with hardening
+       : > $(DIR_SRC)/glibc-build/configparms
        cd $(DIR_SRC)/glibc-build && make PARALLELMFLAGS=$(MAKETUNING) \
                CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)"
+
        cd $(DIR_SRC)/glibc-build && make $(EXTRA_INSTALL) install
 
 ifeq "$(ROOT)" ""