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
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.
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.
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)
I pushed patches to the list to support lto for buildroot-clients. buildroot itself is still compiled without lto.
http://patchwork.ozlabs.org/patch/408558/ http://patchwork.ozlabs.org/patch/411183/
Why does nobody care about this patch?
Ah! didn't noticed http://thread.gmane.org/gmane.comp.lib.uclibc.buildroot/103000/focus
Updated patch: http://thread.gmane.org/gmane.comp.lib.uclibc.buildroot/106748
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.