summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2017-02-14 10:01:08 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2017-02-14 22:16:39 +0000
commit8274b84fb061ddcb1318f1ba5625b41b197e6987 (patch)
tree2eab7641a9f2c8856074d7c69e591fcbf3cfccda /dev-lang
parentprofiles: no tk on arm64 yet. (diff)
downloadgentoo-8274b84fb061ddcb1318f1ba5625b41b197e6987.tar.gz
gentoo-8274b84fb061ddcb1318f1ba5625b41b197e6987.tar.bz2
gentoo-8274b84fb061ddcb1318f1ba5625b41b197e6987.zip
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 <slyfox@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/ghc/ghc-7.10.3.ebuild10
-rw-r--r--dev-lang/ghc/ghc-8.0.2.ebuild10
2 files changed, 16 insertions, 4 deletions
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: