I keep getting this message when i try to upload the code to my arduino.

lto1: fatal error: bytecode stream generated with LTO version 3.0 instead of the expected 4.1

compilation terminated.

lto-wrapper: fatal error: ./opt/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2/bin/avr-gcc returned 1 exit status

compilation terminated.

/home/ubuntu/opt/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld: error: lto-wrapper failed

collect2: error: ld returned 1 exit status

exit status 1

There are multiple other reports of this bug:

I recommend subscribing to those threads so that you'll be sure to get news of any progress in fixing it.

Hello, please follow topic Issue 2018-10-30: lto-wrapper error prevent compilations for further information and updates about this.

Thank you.