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

Bug 630066

Summary: sys-devel/gcc-config should set symlink lto linker plugins
Product: Gentoo Linux Reporter: Martin Väth <martin>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Severity: normal CC: bureau, jj, lookatyouhacker, pageexec, public+gentoo, tdalman, tsmksubc
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 618550    
Attachments: Add LTO symlink support to gcc-config

Description Martin Väth 2017-09-06 09:35:00 UTC
Quite some packages fail with -flto if the gcc's flto linker plugin library /usr/libexec/gcc/$ARCH/$GCC_VERSION/ is not symlinked into /usr/$ARCH/binutils-bin/lib/bfd-plugins

In particular, without this symlink, all packages creating static archives with "ar" or "$ARCH-ar" (in contrast to "gcc-ar" or "$ARCH-gcc-ar") do not do this correctly (unless -ffat-lto objects is in effect - but the latter simply means that flto cannot be used with that archive).

Note that tc-getAR from toolchain-funcs outputs $ARCH-ar (and not $ARCH-gcc-ar), so that e.g. meson.eclass exports a value for AR which requires the plugin.

This leads to such problems as discussed in

In my opinion, the correct solution would be that gentoo manages the above mentioned plugin symlink. Since this symlink should better point to the plugin corresponding to the currently selected gcc version, I suggest that this be done in gcc-config.
Comment 1 Shane Peelar 2017-09-21 17:08:17 UTC
Created attachment 495798 [details, diff]
Add LTO symlink support to gcc-config
Comment 3 Larry the Git Cow gentoo-dev 2017-12-17 00:24:09 UTC
The bug has been closed via the following commit(s):

commit f29fde782b79bc0bf7a8603a86e238412dc2ddfe
Author:     Andreas K. Hüttel <>
AuthorDate: 2017-12-17 00:23:49 +0000
Commit:     Andreas K. Hüttel <>
CommitDate: 2017-12-17 00:24:00 +0000

    sys-devel/gcc-config: Version bump; fixes prefix issues (bug 641096) and adds support for LTO linker plugins (bug 630066)
    Package-Manager: Portage-2.3.19, Repoman-2.3.6

 sys-devel/gcc-config/Manifest                |  1 +
 sys-devel/gcc-config/gcc-config-1.9.1.ebuild | 54 ++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)
Comment 4 Shane Peelar 2017-12-17 00:51:36 UTC
Awesome!  Now I can remove this from lto-overlay and advise users to use gcc-config-9999.  Thank you!
Comment 5 Andreas K. Hüttel archtester gentoo-dev 2017-12-27 22:43:03 UTC
*** Bug 612816 has been marked as a duplicate of this bug. ***