Skip to content

Commit

Permalink
flag-o-matic.eclass: handle gcc-6 -no-pie option #596584
Browse files Browse the repository at this point in the history
Reported-by: Laine Gholson <[email protected]>
  • Loading branch information
vapier committed Nov 11, 2016
1 parent c941486 commit f461e9f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions eclass/flag-o-matic.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -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*'
Expand Down Expand Up @@ -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);;
Expand Down

0 comments on commit f461e9f

Please sign in to comment.