| Previous | Next |
| EBADEXEC | ESHLIBVERS |
EBADARCH
EBADARCH is the Darwin program-loading result for a bad CPU type in an executable. It means that the image cannot supply an architecture usable by the process that is trying to load it. The file may otherwise be a well-formed Mach-O image; this code is about CPU compatibility, not necessarily file damage.
macOS binaries may be single-architecture or universal. A universal binary contains separate architecture slices, while a dependent dynamic library must be usable by the client image that loads it. Therefore, checking only the main executable is not enough: an app, plugin, helper tool, framework, and private .dylib can each introduce a different architecture mismatch.
Check the process-side architecture, then every image
- Use
lipo -archs <path>for the main executable, the rejected plugin or framework, and its non-system dependencies. - Use
otool -hv <path>to inspect the Mach-O header andotool -L <path>to enumerate linked libraries. - Compare the architecture of the process actually performing the load, not just the physical CPU of the Mac. A compatible host CPU does not make an incompatible in-process library loadable.
- For a distributed universal product, ensure that every required binary has the intended slices before packaging; adding an
arm64slice only to the main app does not repair anx86_64-only private framework.
Do not confuse it with adjacent failures
EBADMACHOmeans that the Mach-O structure itself is malformed.ESHLIBVERSis a shared-library compatibility-version failure after the relevant library image is considered for loading.- A missing install-name target is a path-resolution problem, not a CPU-type result.
References
- Apple XNU: errno.h
- Apple XNU: Mach-O CPU and file-type fields
- Apple: Building a universal macOS binary
- Apple: Dynamic-library architecture requirements
Looking for a different code? Search another status or error code.