From 7e117fb96def4305ff2bc763e1ab679b14261b11 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 27 Apr 2016 12:46:08 +0200 Subject: [PATCH] env/hardening: reenable hardening for MIPS. I just booted a full PIE base-system successfully on my CI20 Creator. For now we set -fPIE again in C{,XX}FLAGS to fix the build in attr/acl/coreutils, etc. --- common/environment/configure/hardening.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/common/environment/configure/hardening.sh b/common/environment/configure/hardening.sh index 38a65ff2298..a519efce585 100644 --- a/common/environment/configure/hardening.sh +++ b/common/environment/configure/hardening.sh @@ -9,12 +9,16 @@ case "$XBPS_TARGET_MACHINE" in CFLAGS+=" -fno-stack-protector" CXXFLAGS+=" -fno-stack-protector" ;; - mips*) # PIE support broken - nopie=yes - ;; esac if [ -z "$nopie" ]; then + case "$XBPS_TARGET_MACHINE" in + mips*) + # XXX for some reason the gcc specs does not apply correctly + CFLAGS+=" -fPIE" + CXXFLAGS+=" -fPIE" + ;; + esac _GCCSPECSDIR=${XBPS_COMMONDIR}/environment/configure/gccspecs CFLAGS="-specs=${_GCCSPECSDIR}/hardened-cc1 $CFLAGS" CXXFLAGS="-specs=${_GCCSPECSDIR}/hardened-cc1 $CXXFLAGS"