[BUG] Lipo stripping `arm64e`
New Issue Checklist
- [x] I updated Pearcleaner to the latest version and still observe the issue
- [x] I searched for existing GitHub issues
- [x] OS Version: macOS 26.5
- [x] Pearcleaner Version: 5.4.3 build 121
Issue:
Pearcleaner Lipo appears to strip the arm64e slice from Xcode binaries. That can break developer tools on Apple Silicon.
The requested behavior is for Lipo to preserve arm64e when thinning Apple Silicon binaries. It should remove Intel slices but keep all ARM64-family slices:
x86_64 + arm64 + arm64e -> arm64 + arm64e
x86_64 + arm64e -> arm64e
x86_64 + arm64 -> arm64
This seems feasible because Pearcleaner already parses Mach-O fat headers directly. In Lipo.swift, the Apple Silicon target currently resolves to a single arm64 target, and the thinning path extracts one matching CPU_TYPE_ARM64 slice. When a binary contains both arm64 and arm64e, that can leave only arm64.
Instead of extracting a single ARM slice on Apple Silicon, the thinning logic could preserve every CPU_TYPE_ARM64 slice and remove only CPU_TYPE_X86_64. If subtype checks are added, arm64e should be treated as a required Apple Silicon slice, not a removable foreign architecture.
Steps:
- Run Pearcleaner Lipo on
/Applications/Xcode.app. - Check the active Xcode developer directory:
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcrun --find swiftc
- Observe the failure:
libxcrun.dylib ... incompatible architecture (have 'arm64', need 'arm64e')
- Compare the architecture slices:
/usr/bin/xcrun:
x86_64 arm64e
/Applications/Xcode.app/Contents/Developer/usr/lib/libxcrun.dylib:
arm64 only
/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib:
x86_64 arm64 arm64e
- I confirmed the issue affects tools that need the active Xcode developer directory. In my case, BetterTouchTool 6.521 could not compile Swift source plugins and showed
Swift Compiler Not Available.
Screenshots:
N/A. Terminal output above shows the failing architecture state.
Debug Console
No Pearcleaner debug console logs captured. The issue was diagnosed from the post-Lipo Mach-O architecture state.
Console Logs
No Pearcleaner Console logs captured. The visible failure is from xcrun loading Xcode's thinned libxcrun.dylib without arm64e.
Can you test this https://github.com/Genxster1998/Archify-rust
Same here — Pearcleaner 5.4.3, Apple Silicon, Lipo run on /Applications/Xcode.app. Afterwards every /usr/bin shim (make, git, clang, even lipo) failed with:
xcrun: error: unable to load libxcrun (... mach-o file, but is an incompatible architecture (have 'arm64', need 'arm64e'))
/Applications/Xcode.app/Contents/Developer/usr/lib/libxcrun.dylib was left arm64 only, while /usr/bin/xcrun is x86_64 + arm64e. An arm64e process can only load arm64e slices, so arm64 and arm64e aren't interchangeable even though both are ARM — keeping arm64e is required, not optional.
One more point beyond the slice selection: thinning also invalidates the code signature. After Lipo, codesign -v /Applications/Xcode.app reports a sealed resource is missing or invalid. So even with arm64e preserved, Apple-signed apps (Xcode and anything else with Apple's seal) should probably be excluded from Lipo entirely, or at least come with a clear warning.
Workaround until Xcode is reinstalled: sudo xcode-select -s /Library/Developer/CommandLineTools (the CLT were untouched and still have x86_64 arm64 arm64e).
hello everyone, so have any way to patch arm64e binaries now?
I use /Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib to replace /Applications/Xcode.app/Contents/Developer/usr/lib/libxcrun.dylib. that great! not need to reinstall Xcode.