Skip to content

Commit

Permalink
eclass/toolchain-glibc.eclass: skip pie check for gcc-6 or newer
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tamiko committed Jun 16, 2017
1 parent d33b49b commit acaffff
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions eclass/toolchain-glibc.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit acaffff

Please sign in to comment.