arduino / arduino-builder

A command line tool for compiling Arduino sketches
GNU General Public License v2.0
457 stars 114 forks source link

lto-wrapper failed error on Windows IDE #332

Closed np703 closed 2 years ago

np703 commented 5 years ago

Arduino: 1.8.9 (Windows 10), Board: "Arduino/Genuino Uno"

In function 'global constructors keyed to 65535_0_Servo_current_test_4.ino.cpp.o':

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

exit status 1 Error compiling for board Arduino/Genuino Uno.

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

per1234 commented 5 years ago

Duplicate of https://github.com/arduino/Arduino/issues/7949

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.

Here's the traditional workaround:

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

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.