Bug 7592

Summary: Buildroot GCC: -lto requires plugin support in ranlib
Product: buildroot Reporter: syntheticpp
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: minor CC: buildroot
Priority: P5    
Version: 2014.08   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

Description syntheticpp 2014-11-04 11:28:59 UTC
To circumvent linker errors when lto is enabled I use  
arm-linux-gcc-ranlib and arm-linux-gcc-ar
but arm-linux-gcc-ranlib stops with this error:

sorry - this program has been built without plugin support


Config:

BR2_arm=y
BR2_cortex_a8=y
BR2_ARM_EABIHF=y
BR2_ARM_FPU_VFPV3=y
BR2_DEPRECATED=y
BR2_OPTIMIZE_3=y
BR2_TOOLCHAIN_BUILDROOT_EGLIBC=y
BR2_EGLIBC_VERSION_2_19=y
BR2_BINUTILS_VERSION_2_24=y
BR2_GCC_VERSION_4_9_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
Comment 1 Thomas Petazzoni 2014-11-07 07:28:23 UTC
We don't have LTO support right now in Buildroot. There is a patch adding LTO support (see http://patchwork.ozlabs.org/patch/362034/), but we not entirely happy with it yet, so it hasn't been applied. Feel free to test it and report back: some feedback on the patch would be very useful.

So, I'm tempted to classify this bug not as a bug, but as a feature request.
Comment 2 syntheticpp 2014-11-09 10:54:30 UTC
OK, I build gcc and binutils with

+		--enable-plugins \
+		--enable-lto

rootfs builds fine, but when gcc-ar is called it fails because it is also called with all the GCC options.
Comment 3 syntheticpp 2014-11-09 11:11:20 UTC
The problem is that arm-linux-gcc-ar/ranlib are also wrapped by ext-toolchain-wrapper.
When those tools just link to the external toolchain lto works (without switching to gold)
Comment 4 syntheticpp 2014-11-09 12:14:18 UTC
I pushed patches to the list to support lto for buildroot-clients.
buildroot itself is still compiled without lto.
Comment 6 syntheticpp 2015-02-12 09:10:10 UTC
Why does nobody care about this patch?
Comment 7 syntheticpp 2015-02-14 08:11:12 UTC
Ah! didn't noticed 
http://thread.gmane.org/gmane.comp.lib.uclibc.buildroot/103000/focus
Comment 8 syntheticpp 2015-02-18 10:37:22 UTC
Updated patch:
http://thread.gmane.org/gmane.comp.lib.uclibc.buildroot/106748
Comment 9 Thomas Petazzoni 2015-06-04 15:15:44 UTC
This has actually been fixed a long time ago, in commit 814f63ec32585f281855587fe0a287cee32e4232, which adds LTO support. It makes sure the wrapper is not generated for tools that shouldn't be wrapped.