3

It appears that Xcode4 doesn't include PPC as a build option anymore. When using setup.py for modules that include C extensions, setup.py always attempts the build with these options:

gcc-4.2 ... -DMACOSX -arch i386 -arch ppc ...

This fails with the error message

/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386

If I just remove -arch ppc from the failed command it completes fine and I can rerun setup.py build to move on to the next step.

This is okay for modules that only include one C extension, like ssl, but for something like PIL that builds a ton of extensions it is a major pain.

Is there some way to prevent setup.py from including -arch ppc in the compilation parameters?

Calvin
  • 4,177
  • 1
  • 16
  • 17

1 Answers1

2

Or, fix Xcode 4 installation about ppc assembler.

$ sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gcc/darwin/ppc /Developer/usr/libexec/gcc/darwin
$ sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gcc/darwin/ppc /usr/libexec/gcc/darwin
Community
  • 1
  • 1
Kazuki Sakamoto
  • 13,929
  • 2
  • 34
  • 96
  • I found the offending line in `/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/sysconfig.py` – Calvin May 09 '11 at 02:10