summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Maier <tamiko@gentoo.org>2017-06-14 10:22:54 -0500
committerMatthias Maier <tamiko@gentoo.org>2017-06-16 03:23:35 -0500
commitacaffff075a2be413e9dbca54cc682f2bb265bc8 (patch)
tree29a7a6ac45a886b863a8b5fb3561425937defdf4 /eclass/toolchain-glibc.eclass
parenteclass/toolchain-glibc.eclass: use tc-enables-pie instead of gcc-specs-pie (diff)
downloadgentoo-acaffff075a2be413e9dbca54cc682f2bb265bc8.tar.gz
gentoo-acaffff075a2be413e9dbca54cc682f2bb265bc8.tar.bz2
gentoo-acaffff075a2be413e9dbca54cc682f2bb265bc8.zip
eclass/toolchain-glibc.eclass: skip pie check for gcc-6 or newer
For gcc-6 and newer the old logic in the toolchain-glibc eclass: if use hardened && gcc-specs-pie ; then append-cppflags -DPIC else filter-flags -fPIE fi is obsolete. Simply disable the check.
Diffstat (limited to 'eclass/toolchain-glibc.eclass')
-rw-r--r--eclass/toolchain-glibc.eclass22
1 files changed, 14 insertions, 8 deletions
diff --git a/eclass/toolchain-glibc.eclass b/eclass/toolchain-glibc.eclass
index 1667f1ac7ad6..1d6a54a37f14 100644
--- a/eclass/toolchain-glibc.eclass
+++ b/eclass/toolchain-glibc.eclass
@@ -266,14 +266,20 @@ setup_flags() {
tc-enables-ssp && append-flags $(test-flags -fno-stack-protector)
fi
- if use hardened && tc-enables-pie ; then
- # Force PIC macro definition for all compilations since they're all
- # either -fPIC or -fPIE with the default-PIE compiler.
- append-cppflags -DPIC
- else
- # Don't build -fPIE without the default-PIE compiler and the
- # hardened-pie patch
- filter-flags -fPIE
+ if [[ $(gcc-major-version) -lt 6 ]]; then
+ # Starting with gcc-6 (and fully upstreamed pie patches) we control
+ # default enabled/disabled pie via use flags. So nothing to do
+ # here. #618160
+
+ if use hardened && tc-enables-pie ; then
+ # Force PIC macro definition for all compilations since they're all
+ # either -fPIC or -fPIE with the default-PIE compiler.
+ append-cppflags -DPIC
+ else
+ # Don't build -fPIE without the default-PIE compiler and the
+ # hardened-pie patch
+ filter-flags -fPIE
+ fi
fi
}