tsandmann / freertos-teensy

FreeRTOS port with C++ std::thread support for ARM boards Teensy 3.5, 3.6, 4.0 and 4.1 (cortex-m4f and cortex-m7f)
92 stars 15 forks source link

Compiler error when using LTO #7

Closed tyalie closed 2 years ago

tyalie commented 2 years ago

From commit 9b7ab75b13535b09b64594fd6c2b80af0c278979 onwards I receive the following error message the moment I try to use any of the LTO compiler flags defined in https://docs.platformio.org/en/latest/platforms/teensy.html#optimization

Linking .pio/build/teensy40/firmware.elf
/tmp/cclcmWf4.s: Assembler messages:
/tmp/cclcmWf4.s:706: Error: symbol `_MSP' is already defined
make: *** [/tmp/ccllgz6G.mk:2: /tmp/ccMTmdkH.ltrans0.ltrans.o] Error 1
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/home/elizabeth/.platformio/packages/toolchain-arm-cortexm-linux/bin/../lib/gcc/arm-cortexm7f-eabi/11.1.0/../../../../arm-cortexm7f-eabi/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
*** [.pio/build/teensy40/firmware.elf] Error 1

I can use any other optimization with the LTO attribute without problems.

tyalie commented 2 years ago

Solved by #8