Glenn Schmottlach
|
Is a QNX port available for ARM for libffi (portable foreign function interface library)?
|
Glenn Schmottlach
06/03/2009 10:40 AM
post30692
|
Is a QNX port available for ARM for libffi (portable foreign function interface library)?
I was wondering if anybody at QNX has looked into supporting the libffi library (see http://sourceware.org/libffi/) on
QNX ARM platforms.
This library has been adopted internally by Python in the "ctypes" module and allows you to make calls into 'C' code and
even have 'C' code make callbacks back into Python.
After a ***tremendous*** amount of effort, I managed to get Python 2.6.2 compiled under QNX 6.4.0 x86, SH (haven't
tested it yet), and ARM. I know QNX supports Python 2.5.2 with the 6.4.0 distro but apparently no one ever tested the
'ctypes' module since it isn't available with the distro. Well, my Python 2.6.2 port *does* support the ctypes module
(passes all regression tests) under x86 but seg-faults under ARM:
# python /lib/python2.6/test/regrtest.py -v test_ctypes.py
test_ctypes
test_anon (ctypes.test.test_anon.AnonTest) ... ok
test_anon_nonmember (ctypes.test.test_anon.AnonTest) ... ok
test_anon_nonseq (ctypes.test.test_anon.AnonTest) ... ok
test_nested (ctypes.test.test_anon.AnonTest) ... ok
test_cache (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_classcache (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_from_address (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_from_addressW (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_numeric_arrays (ctypes.test.test_arrays.ArrayTestCase) ... ok
test_simple (ctypes.test.test_arrays.ArrayTestCase) ... ok
test (ctypes.test.test_array_in_pointer.Test) ... ok
test_2 (ctypes.test.test_array_in_pointer.Test) ... ok
test_byval (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ... ok
test_callbacks (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ...
Process 1527858 (python) terminated SIGSEGV code=1 fltno=11 ip=78295168(_ctypes.so@ffi_closure_SYS
V_inner+0x18) mapaddr=00015168. ref=00000004
Memory fault (core dumped)
Looking at the documentation (and code) for the FFI library I see that it's only been verified on ARM Linux. I'm not
sure how compatible the Linux ARM ABI is compared to the QNX ARM ABI and I suspect that this might be the cause for my
segfault. I know the Linux ARM is expecting a system defined '__clear_cache' function that the QNX compiler warns that
it isn't explicitly defined (although it still builds and links).
The subtle differences between the Linux ARM ABI and the QNX ARM ABI is a little over my head. I was hoping a QNX guru
might be able to look at the libffi library code (for ARM) and possibly tell me what's missing. I'm asking a lot, I know
, but I'm soooooo close to having most of the modules for a completely cross-compiled Python 2.6.2 for x86, SH, and ARM
working I'd hate to say I didn't at least try to resolve this issue. Are there any takers at QNX with ARM experience
that might be interested in taking a look at this code?
Thanks . . .
|
|
|