URL: <https://savannah.gnu.org/support/?110475>
Summary: ranlib: plugin needed to handle lto object Project: Autoconf Submitted by: rdiez Submitted on: Thu 22 Apr 2021 07:32:38 AM UTC Category: None Priority: 5 - Normal Severity: 3 - Normal Status: None Privacy: Public Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Operating System: None _______________________________________________________ Details: More and more people are building software with GCC's LTO nowadays. I recently added a very simple library called libAtmelSoftwareFramework.a to this cross-compilation project of mine: https://github.com/rdiez/JtagDue/blob/master/Project/Makefile.am Then I got this error: arm-none-eabi-ranlib: libAtmelSoftwareFramework.a(libAtmelSoftwareFramework_a-system_sam3x.o): plugin needed to handle lto object The fix I came up with is to edit my top-level build script in order to add the following arguments to the ./configure invocation: AR=$TARGET_ARCH-gcc-ar RANLIB=$TARGET_ARCH-gcc-ranlib This has been a known issue for years. There are many discussions on the Internet. As a new Autoconf user, you have to search for the error message and read here and there. Example pages: https://stackoverflow.com/questions/40374061/autoconf-recipe-to-use-gcc-ar-and-gcc-ranlib https://bugzilla.redhat.com/show_bug.cgi?id=1467409 I think it is time for Autoconf to do something about this, instead of letting everybody lose time all over the place. At the very least, this shortcoming should be documented in the Autoconf manual. Failing that, the FAQ page should mention it. Autoconf already knows that it should not link directly with ld, so that it uses gcc as a linker wrapper, presumably because of similar issues. Is there any reason why Autoconf could not learn to use such gcc wrappers for ar and ranlib too? _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/support/?110475> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/