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

Bug 612816

Summary: sys-devel/binutils: Make binutils work with -flto optimization
Product: Gentoo Linux Reporter: Markus Walter <gentoo>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED DUPLICATE    
Severity: normal CC: Adrian.Bassett, bug, paolo.pedroni, steffen
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 618550    

Description Markus Walter 2017-03-16 14:10:14 UTC
In the default configuration the CFLAG -flto causes lots of packages to fail to compile. The ar, nm and ranlib tools complain with "plugin needed to handle lto object". The common workaround seems to be, that wrappers gcc-ar, gcc-nm and gcc-ranlib are used, which is discourage by upstream, instead one can create a symlink to automatically load the needed lto plugin as per [1] and [2]. It would be great if this could be done automatically by the binutils or gcc package. (That way some poor sobs may be spared the hunt of the correct solution I had to do in the past few hours).

[1] https://forums.gentoo.org/viewtopic-t-1035544-start-0.html
[2] https://gcc.gnu.org/ml/gcc-help/2016-02/msg00005.html
Comment 1 Andreas K. Hüttel archtester gentoo-dev 2017-12-27 22:43:03 UTC

*** This bug has been marked as a duplicate of bug 630066 ***
Comment 2 Shane Peelar 2017-12-28 14:39:13 UTC
Markus, consider trying out lto-overlay if you want to do a full system build with LTO.  We actually just upstreamed a patch to gcc-config that solves this problem.

Details here:

https://github.com/InBetweenNames/gentooLTO
Comment 3 Markus Walter 2017-12-31 10:46:11 UTC
(In reply to Shane Peelar from comment #2)
> Markus, consider trying out lto-overlay if you want to do a full system
> build with LTO.

Cool, I will definitely check it out. Thanks a lot. :)