From ee307a9f5d9e77ce1dbb3655d4ba7f12fffaf554 Mon Sep 17 00:00:00 2001 From: Shane Peelar Date: Wed, 8 May 2019 14:55:53 -0400 Subject: [PATCH] {sys-devel/gcc,dev-lang/gnat-gpl}: add a USE for building GCC with LTO Bug: https://bugs.gentoo.org/685634 Signed-off-by: Shane Peelar Signed-off-by: Sergei Trofimovich --- eclass/toolchain.eclass | 6 ++++++ sys-devel/gcc/metadata.xml | 1 + 2 files changed, 7 insertions(+) diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 17850db43045..9df8ecf69bea 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -174,6 +174,7 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then tc_version_is_at_least 8.0 && IUSE+=" systemtap" TC_FEATURES+=(systemtap) tc_version_is_at_least 9.0 && IUSE+=" d" + tc_version_is_at_least 9.1 && IUSE+=" lto" fi SLOT="${GCC_CONFIG_VER}" @@ -993,6 +994,11 @@ toolchain_src_configure() { confgcc+=( --enable-libstdcxx-time ) fi + # Build compiler using LTO + if tc_version_is_at_least 9.1 && use_if_iuse lto ; then + confgcc+=( --with-build-config=bootstrap-lto ) + fi + # Support to disable pch when building libstdcxx if tc_version_is_at_least 6.0 && ! use_if_iuse pch ; then confgcc+=( --disable-libstdcxx-pch ) diff --git a/sys-devel/gcc/metadata.xml b/sys-devel/gcc/metadata.xml index d70e72131488..1b47b03d9102 100644 --- a/sys-devel/gcc/metadata.xml +++ b/sys-devel/gcc/metadata.xml @@ -21,6 +21,7 @@ This will slow down the compiler a bit as it forces all of the toolchain to be shared libs. Build SSP support into a dedicated library rather than use the code in the C library (DO NOT ENABLE THIS IF YOU DON'T KNOW WHAT IT DOES) + Build using Link Time Optimizations (LTO) Enable support for Intel Memory Protection Extensions (MPX) Add support for mudflap, a pointer use checking library Disable PIE support (NOT FOR GENERAL USE) -- 2.26.2