Help ctypes on arm linux not compile

Samuel M. Smith smithsm at samuelsmith.org
Mon Oct 29 22:48:32 CET 2007


I have built python 1.5.1 from source for an embedded ARM9 debian  
linux Sarge distribution but
ctypes doesn't build.  Anybody have any idea what the problem is? Do  
I have to have the libffi package
installed.
See my errors below.
I looked and ffi.h exists in three places

/usr/local/src/Python-2.5.1/Modules/_ctypes/libffi_arm_wince/ffi.h
/usr/local/src/Python-2.5.1/Modules/_ctypes/libffi_msvc/ffi.h
/usr/local/src/Python-2.5.1/build/temp.linux-armv4l-2.5/libffi/ 
include/ffi.h


with two different definitions for ffi_closure
typedef struct {
   char tramp[FFI_TRAMPOLINE_SIZE];
   ffi_cif   *cif;
   void     (*fun)(ffi_cif*,void*,void**,void*);
   void      *user_data;
} ffi_closure __attribute__((aligned (8)));

typedef struct {
   char tramp[FFI_TRAMPOLINE_SIZE];
   ffi_cif   *cif;
   void     (*fun)(ffi_cif*,void*,void**,void*);
   void      *user_data;
} ffi_closure;

is the __attribute__ syntax causing a problem


building '_ctypes' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict- 
prototypes -fPIC -I. -I/usr/local/src/Python-2.5.1/./Include -Ibuild/ 
temp.linux-armv4l-2.5/libffi/include -Ibuild/temp.linux-armv4l-2.5/ 
libffi -I/usr/local/src/Python-2.5.1/Modules/_ctypes/libffi/src -I./ 
Include -I. -I/usr/local/include -I/usr/local/src/Python-2.5.1/ 
Include -I/usr/local/src/Python-2.5.1 -c /usr/local/src/Python-2.5.1/ 
Modules/_ctypes/_ctypes.c -o build/temp.linux-armv4l-2.5/usr/local/ 
src/Python-2.5.1/Modules/_ctypes/_ctypes.o
In file included from /usr/local/src/Python-2.5.1/Modules/_ctypes/ 
_ctypes.c:126:
/usr/local/src/Python-2.5.1/Modules/_ctypes/ctypes.h:71: error:  
syntax error before "ffi_closure"
/usr/local/src/Python-2.5.1/Modules/_ctypes/ctypes.h:71: warning: no  
semicolon at end of struct or union
/usr/local/src/Python-2.5.1/Modules/_ctypes/ctypes.h:78: error:  
syntax error before '}' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/ctypes.h:78: warning:  
type defaults to `int' in declaration of `ffi_info'
/usr/local/src/Python-2.5.1/Modules/_ctypes/ctypes.h:78: warning:  
data definition has no type or storage class
/usr/local/src/Python-2.5.1/Modules/_ctypes/ctypes.h:94: error:  
syntax error before "ffi_info"
/usr/local/src/Python-2.5.1/Modules/_ctypes/ctypes.h:94: warning: no  
semicolon at end of struct or union
/usr/local/src/Python-2.5.1/Modules/_ctypes/ctypes.h:101: error:  
conflicting types for `restype'
/usr/local/src/Python-2.5.1/Modules/_ctypes/ctypes.h:76: error:  
previous declaration of `restype'
/usr/local/src/Python-2.5.1/Modules/_ctypes/ctypes.h:109: error:  
syntax error before '}' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/ctypes.h:109: warning:  
type defaults to `int' in declaration of `CFuncPtrObject'
/usr/local/src/Python-2.5.1/Modules/_ctypes/ctypes.h:109: warning:  
data definition has no type or storage class
/usr/local/src/Python-2.5.1/Modules/_ctypes/ctypes.h:165: error:  
syntax error before '*' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/ctypes.h:168: warning:  
type defaults to `int' in declaration of `AllocFunctionCallback'
/usr/local/src/Python-2.5.1/Modules/_ctypes/ctypes.h:168: warning:  
data definition has no type or storage class
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: In function  
`c_void_p_from_param':
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:1330: error:  
`func' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:1330: error:  
(Each undeclared identifier is reported only once
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:1330: error:  
for each function it appears in.)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:1331: error:  
syntax error before ')' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: At top level:
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2470: error:  
syntax error before '*' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2471: warning:  
function declaration isn't a prototype
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: In function  
`CFuncPtr_set_errcheck':
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2472: error:  
`ob' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2477: error:  
`self' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: At top level:
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2484: error:  
syntax error before '*' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2485: warning:  
function declaration isn't a prototype
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: In function  
`CFuncPtr_get_errcheck':
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2486: error:  
`self' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: At top level:
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2495: error:  
syntax error before '*' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2496: warning:  
function declaration isn't a prototype
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: In function  
`CFuncPtr_set_restype':
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2497: error:  
`ob' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2498: error:  
`self' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: At top level:
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2520: error:  
syntax error before '*' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2521: warning:  
function declaration isn't a prototype
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: In function  
`CFuncPtr_get_restype':
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2523: error:  
`self' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: At top level:
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2539: error:  
syntax error before '*' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2540: warning:  
function declaration isn't a prototype
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: In function  
`CFuncPtr_set_argtypes':
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2543: error:  
`ob' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2544: error:  
`self' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: At top level:
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2562: error:  
syntax error before '*' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2563: warning:  
function declaration isn't a prototype
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: In function  
`CFuncPtr_get_argtypes':
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2565: error:  
`self' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: In function  
`CFuncPtr_FromDll':
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2747: error:  
`self' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2802: error:  
syntax error before ')' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: In function  
`CFuncPtr_new':
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2867: error:  
`self' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2870: error:  
`thunk' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:2939: error:  
syntax error before ')' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: At top level:
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3040: error:  
syntax error before '*' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3043: warning:  
function declaration isn't a prototype
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: In function  
`_build_callargs':
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3044: error:  
`self' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3054: error:  
`poutmask' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3055: error:  
`pinoutmask' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3056: error:  
`pnumretvals' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3064: error:  
`inargs' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3113: error:  
`kwds' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: At top level:
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3268: error:  
syntax error before '*' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3269: warning:  
function declaration isn't a prototype
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: In function  
`CFuncPtr_call':
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3274: error:  
`self' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3329: error:  
`inargs' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3329: error:  
`kwds' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: At top level:
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3398: error:  
syntax error before '*' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3399: warning:  
function declaration isn't a prototype
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: In function  
`CFuncPtr_traverse':
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3400: error:  
`self' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3400: warning:  
implicit declaration of function `visit'
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3400: error:  
`arg' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3407: error:  
`visit' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: At top level:
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3411: error:  
syntax error before '*' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3412: warning:  
function declaration isn't a prototype
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: In function  
`CFuncPtr_clear':
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3413: error:  
`self' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: At top level:
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3431: error:  
syntax error before '*' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3432: warning:  
function declaration isn't a prototype
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: In function  
`CFuncPtr_dealloc':
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3433: error:  
`self' undeclared (first use in this function)
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: At top level:
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3438: error:  
syntax error before '*' token
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3439: warning:  
function declaration isn't a prototype
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c: In function  
`CFuncPtr_repr':
/usr/local/src/Python-2.5.1/Modules/_ctypes/_ctypes.c:3448: error:  
`self' undeclared (first use in this function)




**********************************************************************
Samuel M. Smith Ph.D.
2966 Fort Hill Road
Eagle Mountain, Utah 84005-4108
801-768-2768 voice
801-768-2769 fax
**********************************************************************
"The greatest source of failure and unhappiness in the world is
giving up what we want most for what we want at the moment"
**********************************************************************


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071029/525198a2/attachment.html>


More information about the Python-list mailing list