The cxx code generated by swig with -builtin option will not be compiled in stackless python environment.
I have searched through the stackless python source code and found the reason:
In stackless python, the PyHeapTypeObject and PyTypeObject are the same type. In the 'object.h' it defines:
#define PyHeapTypeObject PyTypeObject
In swig, the builtin object implemented as a PyHeapTypeObject and the object's layout is slighty different with stackless python's PyTypeObject.
so the cxx code can't be compiled.
Maybe this bug is mainly caused by stackless python, but I think it is more easy to be fixed in swig.
I will upload a patch in short a while.