Skip to content

Add article re: "bad CPU type in executable" error #172

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

Merged
merged 1 commit into from
Feb 16, 2023
Merged

Add article re: "bad CPU type in executable" error #172

merged 1 commit into from
Feb 16, 2023

Conversation

per1234
Copy link
Collaborator

@per1234 per1234 commented Feb 7, 2023

We saw a spike in reports of this error following the recent release of the native Apple Silicon build of Arduino IDE.

Investigation showed that the affected users did not have the Rosetta 2 translation software required to run executables built for x86 (AKA "Intel") host architecture on Apple Silicon machines.

Previously, this condition was not likely to occur because macOS shows a dialog when the user starts an x86 application if Rosetta 2 is not already installed. But it turns out macOS doesn't do that if the x86 executable is run by a subprocess. So users of the Apple Silicon build of Arduino IDE do not get the dialog when starting Arduino IDE, since the application itself does not require Rosetta 2, but when Arduino IDE executes one of the helper tools (e.g., avr-gcc) that is not built for Apple Silicon, the process fails with the "bad CPU in executable" error.

Changes proposed in this pull request

The solution is for the user to manually install Rosetta 2. Instructions for that are provided here.

The article is intended to be a comprehensive guide to solving the "bad CPU type in executable" error. This error may occur under other conditions than the one described above, so instructions for the resolution of the error as it occurs under those other conditions are also included.

Additional information

Resolves arduino/arduino-ide#1818

Related

Please check

  • This pull request changes an article title
  • This pull request removes an article

Copy link
Collaborator

@seaxwi seaxwi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work putting this together @per1234

Only some minor notes from my end

We saw a spike in reports of this error following the recent release of the native Apple Silicon build of Arduino IDE.

Investigation showed that the affected users did not have the Rosetta 2 translation software required to run executables
built for x86 (AKA "Intel") host architecture on Apple Silicon machines.

Previously, this condition was not likely to occurr because macOS shows a dialog when the user starts an x86 application
if Rosetta 2 is not already installed. But it turns out macOS doesn't do that if the x86 executable is run by a
subprocess. So users of the Apple Silicon build of Arduino IDE do not get the dialog when starting Arduino IDE, since
the application itself does not require Rosetta 2, but when Arduino IDE executes one of the helper tools (e.g., avr-gcc)
that is not built for Apple Silicon, the process fails with the "bad CPU in executable" error.

The solution is for the user to manually install Rosetta 2. Instructions for that are provided here.

The article is intended to be a comprehensive guide to solving the "bad CPU type in executable" error. This error may
occur under other conditions than the one described above, so instructions for the resolution of the error as it occurs
under those other conditions are also included.
@per1234 per1234 requested a review from seaxwi February 16, 2023 02:00
@seaxwi seaxwi merged commit 52ec107 into arduino:main Feb 16, 2023
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

Successfully merging this pull request may close these issues.

No ports reported on macos ventura 13.1 apple silicon arduino 2.0.3 unless rosetta is installed
2 participants