[python-committers] The state of our copies of libffi (was: Redoing the C API?)

Berker Peksağ berker.peksag at gmail.com
Thu Mar 17 05:44:21 EDT 2016


On Thu, Mar 3, 2016 at 10:58 PM, Zachary Ware
<zachary.ware+pydev at gmail.com> wrote:
> We actually have four separate copies of libffi:
>
> Modules/_ctypes/libffi: This is a mostly-vanilla copy of libffi-3.1
> (released 19May2014), lightly patched according to
> Modules/_ctypes/libffi.diff.  This one is used for any non-OSX posix
> build that doesn't use `--with-system-ffi`.  doko has done a pretty
> good job keeping this one relatively up to date.

I've opened pull requests to the libffi repository for some of the
changes (I haven't looked at the ones in configure{.ac} yet) in
Modules/_ctypes/libffi.diff:
https://github.com/atgreen/libffi/pulls/berkerpeksag

> Modules/_ctypes/libffi_osx: This is a "lightly patched" copy from
> somewhere before libffi-2.0, probably.  It has barely been touched
> since 2009.  I've been given to understand that it has modifications
> necessary to allow building fat binaries on OSX (Ned or Ronald would
> know better than I), but I don't know if such modifications may have
> made it upstream since pre-2.0.  This one is used for all OSX builds
> that don't use `--with-system-ffi`.

I did a quick check and yes, some of them have already been
upstreamed. For example,
https://github.com/python/cpython/commit/9dc4e927f635a08ea236c9a1e5a32a990480263e#diff-4bc0ccb0eeb98833488f557ce8da5ce5R267

> Modules/_ctypes/libffi_arm_wince: I don't know why we even have this.
> Nobody has touched it since ctypes was merged into cpython in 2006.

I couldn't find any reference to Modules/_ctypes/libffi_arm_wince in
the codebase so I guess we can now file an issue to remove it.

Thanks for the great summary, Zachary :)

--Berker


More information about the python-committers mailing list