[Python-Dev] ctypes and powerpc

Thomas Heller theller at ctypes.org
Tue Nov 28 21:26:54 CET 2006


Ronald Oussoren schrieb:
>  
> On Friday, November 24, 2006, at 08:21PM, "Thomas Heller" <theller at ctypes.org> wrote:
>>I'd like to ask for help with an issue which I do not know
>>how to solve.
>>
>>Please see this bug http://python.org/sf/1563807
>>"ctypes built with GCC on AIX 5.3 fails with ld ffi error"
>>
>>Apparently this is a powerpc machine, ctypes builds but cannot be imported
>>because of undefined symbols like 'ffi_call', 'ffi_prep_closure'.
>>
>>These symbols are defined in file
>>  Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c.
>>The whole contents of this file is enclosed within a
>>
>>#ifdef __ppc__
>>...
>>#endif
>>
>>block.  IIRC, this block has been added by Ronald for the
>>Mac universal build.  Now, it seems that on the AIX machine
>>the __ppc__ symbols is not defined; removing the #ifdef/#endif
>>makes the built successful.
> 
> The defines were indeed added for the universal build and I completely overlooked the fact that ffi_darwin.c is also used for AIX. One way to fix this is
> 
> #if !  (defined(__APPLE__) && !defined(__ppc__))
> ...
> #endif
> 
> That is, compile the file unless __APPLE__ is defined but __ppc__ isn't. This more clearly documents the intent. 

Yes, this makes the most sense.  I've taken this approach.

Thanks,
Thomas



More information about the Python-Dev mailing list