AR needs plugin to support LTO
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
New
|
Undecided
|
Unassigned |
Bug Description
The librarian reports that it needs a plugin to support LTO within library files.
/opt/gcc-
/opt/gcc-
From a read of the man page, it looks like this is a configuration issue for the toolchain. The linker accepts the LTO object without issue. Per the ar documentation, the plugin for LTO must be available in ${libdir}
Should the installation of the toolchain include this fixup so that AR can handle LTO out-of-the-box?
I confirm the problem, it occured to mee too.
My environment is Eclipse, building static libraries. In this configuration, the build process automatically compiles and archives the objects.
Here is an example of a build:
17:11:09 **** Build of configuration Debug for project static-lto ****
make all
Building file: ../file.c
Invoking: GNU ARM Cross C Compiler
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -flto -g3 -std=gnu11 -MMD -MP -MF"file.d" -MT"file.o" -c -o "file.o" "../file.c"
Finished building: ../file.c
Building target: libstatic-lto.a
Invoking: GNU ARM Cross Archiver
arm-none-eabi-ar -r "libstatic-lto.a" ./file.o
arm-none-eabi-ar: creating libstatic-lto.a
arm-none-eabi-ar: ./file.o: plugin needed to handle lto object
Finished building target: libstatic-lto.a
17:11:09 Build Finished. 0 errors, 0 warnings. (took 271ms)
On macOS, manually creating a link fixed the problem:
$ cd gcc-arm- none-eabi- 8-2018- q4-major plugins/ liblto_ plugin. so
$ mkdir -p lib/bfd-plugins
$ ln -s -v ../../$(find * -type f -name liblto_plugin.0.so) lib/bfd-
I'm currently working on a solution for the GNU MCU Eclipse ARM Embedded GCC distribution to include this links automatically.
It would be good if the Arm distribution would do the same.