From: Sergei Trofimovich Date: Tue, 14 Feb 2017 10:01:08 +0000 (+0000) Subject: ghc: spell '-nopie' as '-no-pie' for gcc-6.3.0, bug #606666 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=8274b84fb061ddcb1318f1ba5625b41b197e6987;p=gentoo.git ghc: spell '-nopie' as '-no-pie' for gcc-6.3.0, bug #606666 Gentoo upstreamed -pie/-nopie patch to GCC upstream but there is a twist: '-nopie' gentoo flag became '-no-pie'. But at least '-no-pie' is accessible in both vanilla and hardened profiles of gcc-6.3.0. Reported-by: Toralf Förster Bug: https://bugs.gentoo.org/606666 Signed-off-by: Sergei Trofimovich --- diff --git a/dev-lang/ghc/ghc-7.10.3.ebuild b/dev-lang/ghc/ghc-7.10.3.ebuild index ac9989cf6e5c..a963d059c61c 100644 --- a/dev-lang/ghc/ghc-7.10.3.ebuild +++ b/dev-lang/ghc/ghc-7.10.3.ebuild @@ -244,9 +244,15 @@ ghc_setup_cflags() { append-ghc-cflags link ${flag} done - # hardened-gcc needs to be disabled, because the mangler doesn't accept - # its output. + # hardened-gcc needs to be disabled, because our prebuilt binaries/libraries + # are not built with fPIC, bug #606666 gcc-specs-pie && append-ghc-cflags persistent compile link -nopie + tc-is-gcc && version_is_at_least 6.3 $(gcc-version) && if ! use ghcbootstrap; then + # gcc-6.3 has support for -no-pie upstream, but spelling differs from + # gentoo-specific '-nopie'. We enable it in non-bootstrap to allow + # hardened users try '-pie' in USE=ghcbootstrap mode. + append-ghc-cflags persistent compile link -no-pie + fi gcc-specs-ssp && append-ghc-cflags persistent compile -fno-stack-protector # prevent from failind building unregisterised ghc: diff --git a/dev-lang/ghc/ghc-8.0.2.ebuild b/dev-lang/ghc/ghc-8.0.2.ebuild index e6dc320cb76a..e5abb43d9463 100644 --- a/dev-lang/ghc/ghc-8.0.2.ebuild +++ b/dev-lang/ghc/ghc-8.0.2.ebuild @@ -236,9 +236,15 @@ ghc_setup_cflags() { append-ghc-cflags link ${flag} done - # hardened-gcc needs to be disabled, because the mangler doesn't accept - # its output. + # hardened-gcc needs to be disabled, because our prebuilt binaries/libraries + # are not built with fPIC, bug #606666 gcc-specs-pie && append-ghc-cflags persistent compile link -nopie + tc-is-gcc && version_is_at_least 6.3 $(gcc-version) && if ! use ghcbootstrap; then + # gcc-6.3 has support for -no-pie upstream, but spelling differs from + # gentoo-specific '-nopie'. We enable it in non-bootstrap to allow + # hardened users try '-pie' in USE=ghcbootstrap mode. + append-ghc-cflags persistent compile link -no-pie + fi gcc-specs-ssp && append-ghc-cflags persistent compile -fno-stack-protector # prevent from failind building unregisterised ghc: