Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC compiler error when trying to compile the example sketch 'PassThru' #18

Open
Chase0fSpades opened this issue Oct 9, 2018 · 4 comments

Comments

@Chase0fSpades
Copy link

Arduino: 1.8.6 (Windows 10), TD: 1.44, Board: "Arduino/Genuino Uno"

lto1.exe: internal compiler error: in lto_output_varpool_node, at lto-cgraph.c:624

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
Copy link

per1234 commented Oct 9, 2018

This problem only occurs with the avr-gcc 5.4.0-atmel3.6.1-arduino2 used by Arduino AVR Boards 1.6.22 and newer. The relevant bug report is here:
arduino/ArduinoCore-avr#39
A code workaround is described in that thread.


An easier, though less desirable, workaround is to roll back Arduino AVR Boards to 1.6.21:

  1. Tools > Board > Boards Manager
  2. Wait for downloads to finish.
  3. Click on "Arduino AVR Boards".
  4. Select 1.6.21 from the dropdown menu.
  5. Click "Install".
  6. Wait for installation to finish.
  7. Click "Close".

Due to a bug, you can not do this with Arduino IDE 1.8.6 but you can with any other Arduino IDE version.

If you have File > Check for updates on startup enabled, the Arduino IDE will periodically prompt you to update Arduino AVR Boards. You must refrain from doing so, otherwise the error will come back.

@stkeane1
Copy link

So I had a thread about this issue here: https://forum.arduino.cc/index.php?topic=566280.0

internalBegin() causes the issue here

`// The usual initialization sequence
FlashString strings[3] = { F("ATE1\r"), F("AT&D0\r"), F("AT&K0\r") };
for (int i=0; i<3; ++i)
{
send(strings[i]);
if (!waitForATResponse())
return cancelled() ? ISBD_CANCELLED : ISBD_PROTOCOL_ERROR;
}

`
The solution we found was

` // The usual initialization sequence
const FlashString a = F("ATE1\r");

const FlashString b = F("AT&D0\r");
const FlashString c = F("AT&K0\r");
const FlashString strings[3] = { a, b, c };
for (int i=0; i<3; ++i)
{
send(strings[i]);
if (!waitForATResponse())
return cancelled() ? ISBD_CANCELLED : ISBD_PROTOCOL_ERROR;
}`

Hope this helps.

@mikalhart
Copy link
Owner

Outstanding analysis @stkeane1. Sorry for the abysmally slow reply. I'll incorporate a variant of this in a forthcoming update. Thanks again.

@mikalhart
Copy link
Owner

mikalhart commented Oct 13, 2019

Please try new release 2.0.0 and see if this is resolved. Thanks again @stkeane1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants