1. Python CFFI
  2. Untitled project
  3. cffi
  4. Issues
Issue #34 closed

cffi has trouble with data type sizes in a cross compilation environment

Sarvi Shanmugham
created an issue

The current CFFI version has trouble with sizes of primitive data types in a cross compile environment. The sizes of primitive data types are coming primarily from 2 functions defined in the _c_backend.c

Namely, the sizeof() and nonstandard_integer_types() defined the _c_backend.c

Comments (10)

  1. Sarvi Shanmugham reporter

    A proposed solution based on an email thread documented in the cffi google groups is to use the cross_compile procedure to attempt snippets of C code that can confirm the size of a data type.

    I have a created a patch based on the suggested approach for your consideration. Please let me know if this is acceptable

  2. Armin Rigo

    This should become a non-issue with the new CFFI 1.0 if you are using set_source(). Can you check if the problem is really solved? Namely, that you can generate a .c file on one machine and manually cross-compile it for a different machine. It should work as expected because the content of the generated C file should be exactly the same independently on the platform where we generate it.

  3. Log in to comment