Compilation fails spuriously: "avr-g++: internal compiler error: Killed: 9 (program cc1plus)"
- Dominant language
- Java
- Stars
- 14.6k
- Forks
- 7k
- PR merge metrics
- No merged PRs in 30d
Description
When compiling for UNO R4 WiFi, UNO R3, Nano, or Mega on my MacBook Pro M2, I get an "`avr-g++: internal compiler error: Killed: 9 (program cc1plus)`" error:
```text
FQBN: arduino:avr:nano:cpu=atmega328old
Using board 'nano' from platform in folder: /Users/edwardunderwood/Library/Arduino15/packages/arduino/hardware/avr/1.8.6
Using core 'arduino' from platform in folder: /Users/edwardunderwood/Library/Arduino15/packages/arduino/hardware/avr/1.8.6
Detecting libraries used...
/Users/edwardunderwood/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/Users/edwardunderwood/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/edwardunderwood/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/eightanaloginputs /private/var/folders/lv/lxk9nf7n1ks0s5l698yl6mv40000gn/T/arduino/sketches/37ACAEF4D865AE6E43B49B5A23BD8456/sketch/Blink.ino.cpp -o /dev/null
Error while detecting libraries included by /private/var/folders/lv/lxk9nf7n1ks0s5l698yl6mv40000gn/T/arduino/sketches/37ACAEF4D865AE6E43B49B5A23BD8456/sketch/Blink.ino.cpp
Generating function prototypes...
/Users/edwardunderwood/Library/Arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/Users/edwardunderwood/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/Users/edwardunderwood/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/variants/eightanaloginputs /private/var/folders/lv/lxk9nf7n1ks0s5l698yl6mv40000gn/T/arduino/sketches/37ACAEF4D865AE6E43B49B5A23BD8456/sketch/Blink.ino.cpp -o /private/var/folders/lv/lxk9nf7n1ks0s5l698yl6mv40000gn/T/1557648738/sketch_merged.cpp
avr-g++: internal compiler error: Killed: 9 (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
exit status 4
Compilation error: exit status 4
```
### Additional context
Discussion:
https://forum.arduino.cc/t/new-ide-install-on-new-macbook-pro-m2-not-working/1307490
---
I am using macOS OS 14.6.1
----
I am using Arduino IDE 2.3.3.
---
The fault does not occur when I compile the same sketch for the same board on my older iMac with "Intel" processor.
Contributor guide
Research direction
Start by reproducing the Arduino IDE 2.3.3 compilation for the listed UNO boards on macOS 14.6.1, focusing on the avr-g++ command and generated Blink.ino.cpp shown in the report. Compare the failing M2 environment with the older Intel iMac; done means the same sketch compiles successfully for the affected boards without the cc1plus termination.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, macos
- Domain
- build-system, embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100