Thursday, December 30, 2010

dyld: unknown required load command 0x80000022 starting Firefox (and others) on Mac OS X 10.5

If you get a message like this when running a Mozilla application on Leopard:
dyld: unknown required load command 0x80000022
Trace/BPT trap
...chances are the system tries to run a build intended for Snow Leopard.

A workaround you could try is to run Terminal.app and use the arch command like this:

arch -i386 /Applications/Firefox.app/Contents/MacOS/firefox-bin

(Substitute /Application/Firefox.app with the location of the app, and use the name of the executable (ending with -bin) instead of firefox-bin as necessary.)

As with any other command you can create a launcher icon for the command easily.

This should apply to newer Mozilla-based applications: Firefox 4 (including Minefield builds since Oct 2010), Thunderbird post 3.2, BlueGriffon, and future versions of other applications based on Mozilla 2 (Komodo, Songbird, etc.)

Technical details

If the workaround works for you, the application is a i386/x86_64 universal binary. The x86_64 part of the application uses 10.6-specific features, so it can't run on 10.5; the i386 binary is intended for 10.5.

The cause of the error message is that the wrong architecture is selected for some reason. This happened to me when trying to run such an executable directly from the command line (technical details are in this Mozilla bug).

Stripping x86_64 part from the binary

This tip is brought to you by JW from the comments (via jarib from github): if you don't control the command line command used to start Firefox, you can instead strip the x86_64 part from firefox-bin using ditto:

cd /Applications/Firefox.app/Contents/MacOS
mv firefox-bin firefox-bin.original
ditto --arch i386 firefox-bin.original firefox-bin

Warning: with this workaround (unlike when running via arch) you will stop receiving Firefox updates and this change will have to be re-applied each time you update Firefox manually.