This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

arm-none-eabi-ar: ../src/n1_main.o plugin needed to handle lto object

Dear all,

I use arm-none-eabi-gcc 7.2.1 in my project, when I want to use -flto option to optimize bin size, error shows:

../../../tools/gcc/linux/gcc-arm-none-eabi/bin/arm-none-eabi-ar: creating /proj/lib_m.a
../../../tools/gcc/linux/gcc-arm-none-eabi/bin/arm-none-eabi-ar: /proj/src/n1.o: plugin needed to handle lto object
../../../tools/gcc/linux/gcc-arm-none-eabi/bin/arm-none-eabi-ar: /projsrc/nb_data.o: plugin needed to handle lto object

what's wrong with my code? 

Thank you for your replay.

Parents
  • Hi,

    I've managed to reproduce your issue. Here are the steps I tried:

    arm-none-eabi-gcc -c -O2 -flto foo.c -o foo.o

    arm-none-eabi-gcc -c -O2 -flto bar.c -o bar.o

    $ arm-none-eabi-ar -vr libfoobar.a foo.o bar.o

    arm-none-eabi-ar: foo.o: plugin needed to handle lto object

    Try giving a --plugin option to your ar command-line:

    $ arm-none-eabi-ar -vr --plugin .../path/to/liblto_plugin.so libfoobar.a foo.o bar.o

    liblto_plugin.so usually resides in .../path/to/gcc/install/bin/libexec/gcc/7.2.1/liblto_plugin.so

Reply
  • Hi,

    I've managed to reproduce your issue. Here are the steps I tried:

    arm-none-eabi-gcc -c -O2 -flto foo.c -o foo.o

    arm-none-eabi-gcc -c -O2 -flto bar.c -o bar.o

    $ arm-none-eabi-ar -vr libfoobar.a foo.o bar.o

    arm-none-eabi-ar: foo.o: plugin needed to handle lto object

    Try giving a --plugin option to your ar command-line:

    $ arm-none-eabi-ar -vr --plugin .../path/to/liblto_plugin.so libfoobar.a foo.o bar.o

    liblto_plugin.so usually resides in .../path/to/gcc/install/bin/libexec/gcc/7.2.1/liblto_plugin.so

Children