Linking .pioenvs/uno/firmware.elf
/home/steve/.platformio/packages/framework-arduinoavr/cores/arduino/main.cpp: In function 'main':
/home/steve/.platformio/packages/framework-arduinoavr/cores/arduino/main.cpp:51:1: internal compiler error: Segmentation fault
}
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: avr-g++ returned 1 exit status
/home/steve/.platformio/packages/toolchain-atmelavr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld: lto-wrapper failed
collect2: error: ld returned 1 exit status
*** [.pioenvs/uno/firmware.elf] Error 1
I can verify that adding the following to my environment resolves the issue:
build_unflags = -flto
However on code where this workaround is not required, LTO does reduces binary size.
I am not sure what the correct fix is as this seems to be an issue from the bowels of the compiler. However this ticket should help future users when googling the symptoms.
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/48822812-lto-causes-internal-compiler-error?utm_campaign=plugin&utm_content=tracker%2F38207915&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F38207915&utm_medium=issues&utm_source=github).
Occasionally avr-gcc will crash when compiling:
This seems related to link time optimisation: https://github.com/sudar/Arduino-Makefile/issues/486
I can verify that adding the following to my environment resolves the issue:
However on code where this workaround is not required, LTO does reduces binary size.
I am not sure what the correct fix is as this seems to be an issue from the bowels of the compiler. However this ticket should help future users when googling the symptoms.