summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-11-11 17:17:37 -0500
committerMike Frysinger <vapier@gentoo.org>2016-11-11 17:17:37 -0500
commitf461e9f8576ab71a998b580095a8de1530cdbd35 (patch)
treea75da848f2cd55926e206752c7725325c7e776ec /eclass
parentmedia-libs/mesa: allow USE=libressl too for sha1 funcs #591246 (diff)
downloadgentoo-f461e9f8576ab71a998b580095a8de1530cdbd35.tar.gz
gentoo-f461e9f8576ab71a998b580095a8de1530cdbd35.tar.bz2
gentoo-f461e9f8576ab71a998b580095a8de1530cdbd35.zip
flag-o-matic.eclass: handle gcc-6 -no-pie option #596584
Reported-by: Laine Gholson <laine.gholson@gmail.com>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/flag-o-matic.eclass13
1 files changed, 11 insertions, 2 deletions
diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index 69f613f43737..d2f504b34fa0 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -27,7 +27,7 @@ setup-allowed-flags() {
-pipe -O '-O[12sg]' -mcpu -march -mtune
'-fstack-protector*' '-fsanitize*'
-fbounds-check -fbounds-checking -fno-strict-overflow
- -fno-PIE -fno-pie -nopie -fno-unit-at-a-time
+ -fno-PIE -fno-pie -nopie -no-pie -fno-unit-at-a-time
-g '-g[0-9]' -ggdb '-ggdb[0-9]' '-gdwarf-*' gstabs -gstabs+
-fno-ident -fpermissive -frecord-gcc-switches
'-fdiagnostics*' '-fplugin*'
@@ -80,7 +80,16 @@ _filter-hardened() {
# thinking about -fPIE.
-fPIC|-fpic|-fPIE|-fpie|-Wl,pie|-pie)
gcc-specs-pie || continue
- is-flagq -nopie || append-flags -nopie;;
+ if ! is-flagq -nopie && ! is-flagq -no-pie ; then
+ # Support older Gentoo form first (-nopie) before falling
+ # back to the official gcc-6+ form (-no-pie).
+ if test-flags -nopie >/dev/null ; then
+ append-flags -nopie
+ else
+ append-flags -no-pie
+ fi
+ fi
+ ;;
-fstack-protector)
gcc-specs-ssp || continue
is-flagq -fno-stack-protector || append-flags $(test-flags -fno-stack-protector);;