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:
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: