distutils & OS X universal binaries

Robin Becker robin at NOSPAMreportlab.com
Sat Dec 8 09:17:24 EST 2007


A user reports problems with one of our extensions when running the 
intel compiled extension on ppc and vice versa. He is building the 
extension as a universal binary. Although the intel compiled version 
runs fine it displays a known bug when run on a ppc.

It appears we have an endianness dependency which is statically compiled 
into the binaries.

One proposed fix is to make the endian variable code dynamically change 
at run time.  However, I assume that under the hood the extension is 
being built in multiple ways so our static definition of endianness in a 
pre-processor macro needs to be dynamic.

Is there a way to get distutils to pass different macros/definitions to 
the separate compilations.

Failing that does anyone know off hand exactly how this problem is 
supposed to be handled? Ie if there are multiple compiles what 
distinguishes them. My understanding is that up to 4 different binaries 
are being squashed together in these universal binaries.
-- 
Robin Becker



More information about the Python-list mailing list