Issue 2018-10-30: lto-wrapper error prevent compilations

Hello,

the team is investigating all report of errors related to the lto-wrapper error preventing compilations.
We identified a possible root cause.

Please follow this topic to receive updates. All duplicate topics will be locked in favor of this one.

This issue affected compilation between October 30 and October 31; trying to compile working sketches was resulting in this error:

./opt/arduino-builder/arduino-builder -compile -core-api-version 10611 -hardware opt/arduino-builder/hardware -hardware ./opt/cores -tools opt/arduino-builder/tools -tools ./opt/tools -built-in-libraries opt/libraries/latest -logger humantags -fqbn arduino:avr:uno -build-cache /tmp -build-path /tmp/093139344/build -verbose -prefs runtime.tools.avr-gcc.path=./opt/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2 -prefs runtime.tools.avrdude.path=./opt/tools/avrdude/6.3.0-arduino14 -prefs runtime.tools.arduinoOTA.path=./opt/tools/arduinoOTA/1.2.1 -libraries /tmp/093139344/custom -libraries /tmp/093139344/pinned /tmp/093139344/BareMinimum

Linking everything together...

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

The issue seems to be solved now, was caused by an update of a core dependency of the online builder.

Please let us know if you still have the mentioned issue, and sorry for the troubles!

Seems to be okay here. Txs for a fast debugging

Yep. Works. Thank you.

Thank you!

Crys :frowning: i am getting this error since updating my Arduino IDE, i have tried to reinstall it loads of times and i get the issue when using one of the following libraries i think its related to SPI.

The most odd thing is that it is intermittent, i can compile the same code sometimes fine 10 times in row and other times fail 10 times in a row, with no changes to the code - pc - ide i just keep clicking verify ???

See here for a quick video of me compiling the code and it passing and failing with no changes

Arduino: 1.8.8 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

lto1.exe: 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.exe: fatal error: C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc returned 1 exit status

compilation terminated.

c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed

collect2.exe: error: ld returned 1 exit status

Using library RA8875-0.70 at version 0.70.11 in folder: C:\Users\Edwin\Documents\Arduino\libraries\RA8875-0.70
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI
Using library OneWire-master at version 2.3.4 in folder: C:\Users\Edwin\Documents\Arduino\libraries\OneWire-master
Using library DallasTemperature at version 3.7.6 in folder: C:\Users\Edwin\Documents\Arduino\libraries\DallasTemperature
Using library EEPROM at version 2.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM
Using library DS3231 in folder: C:\Users\Edwin\Documents\Arduino\libraries\DS3231 (legacy)
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

This bug is specific to the 5.4.0-atmel3.6.1-arduino2 version of avr-gcc used by Arduino AVR Boards 1.6.22 and newer. It has been reported here:

Here's the traditional workaround:

  • Tools > Board > Boards Manager
  • Wait for downloads to finish.
  • When you move the mouse pointer over "Arduino AVR Boards", you will see a "Select version" dropdown menu appear. Select "1.6.21".
  • Click "Install".
  • Wait for installation to finish.
  • Click "Close".

Due to a bug, this workaround doesn't work with Arduino IDE 1.8.6, but it will work with any other version of the Arduino IDE.

If you have File > Preferences > Check for updates on startup checked, the Arduino IDE may occasionally notify you that a new version of Arduino AVR Boards is available, you'll need to refrain from updating back to the new Arduino AVR Boards version, otherwise you'll be back to seeing the segmentation fault error again.

Alternate workaround:
One of the Arduino developers recently worked on this and claims to have fixed it. There is a special beta testing hardware package you can install via the Arduino IDE's Boards Manager that has the fix:

  • (In the Arduino IDE) File > Preferences
  • In the "Additional Boards Manager URLs" field, enter: http://downloads.arduino.cc/packages/package_avr_7.3.0_index.json If you already have an additional Boards Manager URL in that field, you can separate multiple URLs with commas or click the button on the right side of the field to open a dialog that allows you to add each on its own line.
  • Click "OK"
  • Tools > Board > Boards Manager
  • Wait for the downloads to finish
  • Click on "Arduino AVR Boards by Arduino"
  • Click the "Update" button.
  • Wait for the update to finish.
  • Click "Close".

KawasakiZx10r:
The most odd thing is that it is intermittent, i can compile the same code sometimes fine 10 times in row and other times fail 10 times in a row, with no changes to the code - pc - ide i just keep clicking verify ???

Isn't that annoying? I actually encountered this issue when the new toolchain was still in beta testing but I couldn't produce a minimal example that would consistently reproduce the problem so I decided it wasn't worth reporting because perhaps it was some problem isolated to my somewhat hacked together system. Well, now we know that it has affected many other people and I wish I would have taken action before it was released on the world.