Skip to content
Snippets Groups Projects
user avatar
John David Anglin authored
A couple of years ago the libffi port for hppa-linux was changed from using a
trampoline executed on the stack to the function descriptor technique used by
ia64. This doesn't require an executable stack and is simpler. However,
function pointers need to have the PLABEL bit set in the pointer. As a result,
a simple cast can't be used to convert closure pointers to function pointers.

python-cffi uses its own closure allocation so the problem can't be fixed in
libffi.

I added a macro CFFI_FN to do the conversion. It shouldn't affect other
architectures. There is a similar define in libffi.

Fixes: https://bugs.debian.org/1024271
31b49424
History
Name Last commit Last update
.github/workflows
c
cffi
demo
doc
testing
.hgignore
.hgtags
AUTHORS
LICENSE
MANIFEST.in
README.md
requirements.txt
setup.cfg
setup.py
setup_base.py

CFFI

Foreign Function Interface for Python calling C code. Please see the Documentation or uncompiled in the doc/ subdirectory.

Download

Download page

Source Code

CFFI is developed using Mercurial SCM. The source code is publicly available on heaptapod.

You can read more about how to contribute to the project on PyPy's documentation.

Contact

Mailing list

Testing/development tips

To run tests under CPython, run::

pip install pytest     # if you don't have pytest already
pip install pycparser
python setup.py build_ext -f -i
pytest c/ testing/

If you run in another directory (either the tests or another program), you should use the environment variable PYTHONPATH=/path to point to the location that contains the _cffi_backend.so just compiled.