lto-wrapper.exe: fatal error

Can anyone please tell me what is going on here?...

Apologies if this has been solved before...and yes I'm a novice so child like explanations will be greatly appreciated...

lto-wrapper.exe: fatal error: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.15.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avr-gcc returned 1 exit status

compilation terminated.

c:/program files/windowsapps/arduinollc.arduinoide_1.8.15.0_x86__mdqgnx93n4wtt/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

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

If I were you I would remove the APP version and use the regular desktop version of the IDE.

One of the things we see in here quite often is the windows store version not playing as nice as it should.

Version 1.8.5 seems the most stable at the moment

I am using beta 1.9
I'd be interested in the text before the text you posted.

For example:

I experienced this error when I was a little overzealous with my decimal places in a float.
I noticed a clue in the error with the word "float"
If this is like yours, try knocking off some decimal places in your decimal numbers.

Error text output:

sketch\src\module\motion.cpp: In function 'clamp_to_software_endstops(float*) [clone .part.2]':

sketch\src\module\motion.cpp:494:3: internal compiler error: Segmentation fault

lto-wrapper.exe: fatal error: C:\Program Files (x86)\arduino-PR-beta1.9-BUILD-84\hardware\tools\avr/bin/avr-gcc returned 1 exit status

compilation terminated.

c:/program files (x86)/arduino-pr-beta1.9-build-84/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

exit status 1

Otherwise try to seek a clue in the output. In my case I was tipped off because I hadn't made many changes to the file.

Hello,

I'm getting the same error with the latest nightly build - that's 1.8.9 2018/12/19 06:33 right now.

I took a couple of screen shots - but I've found, by accident, that resizing the lower window will result in the code being able to compile.

Not sure right now how these two are tied together; but it's repeatable and the only way I get new code to compile sometimes.

Also, it will take more than one attempt - and resizing the window immediately after kicking off a compile/download step seems to be the most reliable time at which to slightly resize the window.

Regards,
John W.

That is very strange that the console size would affect it.

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".

Hello Shannon Member,

Thanks - did what you've outlined, so far, so good.

Would be nice to know when this will be fixed - I'll look on github.

Happy Holidays,
John

You're welcome. I'm glad if I was able to be of assistance.

Regarding when it will be fixed, I think they'll want to wait a while to make sure none of the beta testers report any problems with avr-gcc 7.3.0. After that, I don't think there is any reason not to release a new version of Arduino AVR Boards immediately. You could help out the process by using the "Alternative workaround" I listed above and then reporting any problems you encounter.

ballscrewbob:
If I were you I would remove the APP version and use the regular desktop version of the IDE.

One of the things we see in here quite often is the windows store version not playing as nice as it should.

Version 1.8.5 seems the most stable at the moment

Can I just say a huge 'thank you!' for this post!

I've been going round in circles for days trying to get a graphical display working on my Geeetech A10M when the problem was the Windows version all along!

Thank you!