diff options
-rw-r--r-- | eclass/toolchain.eclass | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index ececcdc2..c9520a98 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -626,6 +626,22 @@ do_gcc_PIE_patches() { # configure to build with the hardened GCC specs as the default make_gcc_hard() { + + # Gcc >= 6.X we don't need to sed in Makefile + # It have configurations options to turn pie/ssp on as default + if tc_version_is_at_least 6.0 ; then + if use hardened ; then + # rebrand to make bug reports easier + BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened} + if use pie ; then + einfo "Updating gcc to use automatic PIE building ..." + fi + if use ssp ; then + einfo "Updating gcc to use automatic SSP building ..." + fi + return 1 + fi + # we want to be able to control the pie patch logic via something other # than ALL_CFLAGS... sed -e '/^ALL_CFLAGS/iHARD_CFLAGS = ' \ @@ -2264,6 +2280,10 @@ hardened_gcc_is_stable() { } want_minispecs() { + # on gcc 6 we don't need minispecs + if tc_version_is_at_least 6.0 ; then + return 0 + fi if tc_version_is_at_least 4.3.2 && use hardened ; then if ! want_pie ; then ewarn "PIE_VER or SPECS_VER is not defined in the GCC ebuild." |