OK. So I worked around this error:

/sw/bin/xemacs: Bad CPU type in executable.

but I don't understand why what I did worked and am curious. All I did was replace /sw with what should have been an identical copy.

A little background... I've had this copy of xemacs since around 2000. I love it and it's all configured just right. Building xemacs from scratch was something I used to do way back when, but it was always such a pain that I tarred up /sw (probably originally installed using Fink) and have copied it from computer to computer since forever ago. I did this recently back in Jan '14 onto my brand new iMac running Mavericks and everything works fine. Even more recently, I upgraded from 10.7 to 10.9 on my MacBook Pro at home. I just installed xquartz and when I went to run my copy of xemacs, I got the bad CPU error.

I couldn't understand why I was having trouble since my newer iMac at work could run it no problem. After struggling with it for awhile, I tried simply tarring & copying /sw from the work iMac to my older laptop, and all of a sudden, it worked!

But /sw SHOULD be identical in every case here. They both originated from the same copy of /sw that I've been using since ~2000. Why would a fresh copy of /sw make any difference? Here's some pastes from the command line:

% /sw/bin/xemacs &
/sw/bin/xemacs: Bad CPU type in executable.
% sudo mv /sw /sw-old
% sudo mv /Users/robleach/Downloads/sw /
% /sw/bin/xemacs &

Home Laptop:

% uname -a
Darwin #### 13.3.0 Darwin Kernel Version 13.3.0: Tue Jun  3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64

Work iMac:

% uname -a
Darwin #### 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64

Did the update from 10.7 to 10.9 muck around with what was in /sw? Why did the new identical copy make it work? From what I've read about this error, it seems like xemacs shouldn't even work at all since 10.7 - but it does! I use it all the time at work.

  • Can you run 'file' on both executables? – Alex Oct 12 '14 at 23:31
  • /sw/bin/xemacs: Mach-O executable i386 /sw-old/bin/xemacs: Mach-O executable ppc Yup, they're different! But I don't understand how they became different. They're both from the same tarball I've had for over a decade... I compiled this thing before intel macs existed. Maybe I'm just losing my mind and I did a fresh install at some point when I first tried using an intel mac and just forgot... – hepcat72 Oct 13 '14 at 18:02

Running file on both executables will show you how the actual executable was compiled:

file /sw/bin/emacs

This will tell you why you're having issues running the file between different systems.

Obviously, with incompatible CPU types you'll face the error you're getting.

Rosetta was available for 10.6, but not from 10.7 onwards. Could you have been using it somehow on an older machine?

  • It was definitely running on an older machine. Though I don't recall explicitly doing so, I must've recompiled at some point after getting an intel mac. I don't do much coding on my laptop, so this was probably just the first time I tried using it since installing my older copy of /sw on it. – hepcat72 Oct 14 '14 at 15:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .