Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 519120

Summary: toolchain.eclass - allow -flto -fno-fat-lto-objects in C*FLAGS
Product: Gentoo Linux Reporter: ytrezq
Component: EclassesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED WONTFIX    
Severity: normal CC: tdalman
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 618550    

Description ytrezq 2014-08-05 10:16:45 UTC
Recent gcc version improved lto support. I successfully build a stage2 cross-compiler with -fuse-linker-plugin -flto -fno-fat-lto-otjects --param lto-partitions=1 with crossdev (so shared libraries are disabled). I've seen great speeds/memory improvements for emerge.

This the matter of few replacements (ar by gcc-ar; ranlib by gcc-ranlib; nm by gcc-nm; stage 1 and 2 CFLAGS...).

Versions prior <4.8.2 have a bug that affect symbols in libraries and lto support should be disabled if the target version or the current gcc version is <4.8.2.

Currently, it take 1.5 Gb of RAM per --jobs=number for make. So checking the available RAM or reducing the number of make Jobs should be a requirement.


It seems there's some work for building a native compiler by this way as well as not using --disable-shared in the confgcc variable.
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2019-02-13 22:54:36 UTC
Doesn't
    GCC_MAKE_TARGET=bootstrap-lto emerge -v1 gcc
do the right thing?
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2019-08-20 22:41:17 UTC
USE=lto should pick lto-style bootstrap of gcc.