From b53ac251ea150e9e7a351274b167fbb1e9597595 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 12 Dec 2015 08:32:38 +0100 Subject: [PATCH] env/hardening: handle {i686,mips,mipsel}-musl in a common place. --- common/environment/configure/hardening.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/common/environment/configure/hardening.sh b/common/environment/configure/hardening.sh index 111ee7020b1..d2eac78be5d 100644 --- a/common/environment/configure/hardening.sh +++ b/common/environment/configure/hardening.sh @@ -4,7 +4,17 @@ CXXFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 $CXXFLAGS" # Enable as-needed and relro by default. LDFLAGS="-Wl,--as-needed -Wl,-z,relro $LDFLAGS" -if [ -z "$nopie" ] && [ "$XBPS_TARGET_ARCH" != mipsel-musl ]; then +case "$XBPS_TARGET_MACHINE" in + i686-musl) # SSP currently broken (see https://github.com/voidlinux/void-packages/issues/2902) + CFLAGS+=" -fno-stack-protector" + CXXFLAGS+=" -fno-stack-protector" + ;; + mips-musl|mipsel-musl) # PIE support broken + unset nopie + ;; +esac + +if [ -z "$nopie" ]; then _GCCSPECSDIR=${XBPS_COMMONDIR}/environment/configure/gccspecs CFLAGS="-specs=${_GCCSPECSDIR}/hardened-cc1 $CFLAGS" CXXFLAGS="-specs=${_GCCSPECSDIR}/hardened-cc1 $CXXFLAGS"