Comment 1 for bug 1808722

Revision history for this message
Liviu Ionescu (ilg) wrote :

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
$ mkdir -p lib/bfd-plugins
$ ln -s -v ../../$(find * -type f -name liblto_plugin.0.so) lib/bfd-plugins/liblto_plugin.so

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.