From 8ab745bdff4b392d56bfb27823eec5501827aa3f Mon Sep 17 00:00:00 2001 From: Magnus Granberg Date: Sat, 23 Apr 2016 19:27:01 +0200 Subject: add more gcc 6 support to toolchain.eclass --- eclass/toolchain.eclass | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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." -- cgit v1.2.3-65-gdbad