This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: ctypes tests fail with clang on non-OS X
Type: Stage:
Components: ctypes Versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, benjamin.peterson, djc, doko, georg.brandl, larry, meador.inge, ronaldoussoren
Priority: release blocker Keywords:

Created on 2013-02-05 16:24 by djc, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (11)
msg181454 - (view) Author: Dirkjan Ochtman (djc) * (Python committer) Date: 2013-02-05 16:24
I recently filed, prompted by (for 2.7, and for 3.2), for which I found Similar issues have subsequently been found in The latter has been fixed in (for 2.7 -- other branches were affected as well), but that fix is incorrectly scoped to just OS X.

It looks like clang is actually right here, and gcc is wrong; see their bug at (clang has a bug for this at
msg181483 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2013-02-05 21:10
The changes in CPython mentioned by you are in bundled copy of libffi for OS X (Modules/_ctypes/libffi_osx).
You probably should report the problem to libffi upstream.
Gentoo ebuilds of CPython use --with-system-ffi option, so any fixes in bundled copy of libffi (Modules/_ctypes/libffi) would not help in Gentoo.
msg181499 - (view) Author: Dirkjan Ochtman (djc) * (Python committer) Date: 2013-02-06 07:52
Thanks, I've filed
msg181500 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2013-02-06 08:01
I don't know how the main copy of libffi in the CPython tree is updated, and if it is a straight copy of the upstream release. Given the mercurial log I'd guess that Modules/_ctypes/libffi is libffi 3.0.11 with a small patch in Modules/_ctypes/libffi.diff.

As Arfrever notes libffi_osx is used on OSX only, and that version is a fork of libffi shared with PyObjC (that is, I try to update the copy in the CPython tree whenever I have to update the copy for PyObjC). 

I agree that the issue with libffi should be fixed upstream first,  otherwise it would get harder and harder to import new upstream versions.
msg181501 - (view) Author: Dirkjan Ochtman (djc) * (Python committer) Date: 2013-02-06 08:10
Is there a particular reason for not upstreaming the PyObjC changes?
msg181510 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-02-06 12:29
I'm planning to update the tip to the next libffi release candidate once it's released. 

Once this is checked in, maybe revisit the extra copy for OS X; an ABI issue with llvm/clang was identified in

and a work-around provided in
msg181513 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2013-02-06 12:53
Matthias: libffi_osx already contains the workaround you refer to.

libffi_osx is the same as the variant of libffi included with PyObjC, and that is derived from the system libffi on OSX (IIRC the last time I merged their changes was around 10.7). 

The system libffi on OSX is a fork of the upstream one, at least partially because upstream didn't support darwin/i386 at the time of the fork.
msg181734 - (view) Author: Dirkjan Ochtman (djc) * (Python committer) Date: 2013-02-09 12:52
libffi now has this fix:

Can someone test with that?
msg181949 - (view) Author: Dirkjan Ochtman (djc) * (Python committer) Date: 2013-02-12 09:00
libffi-3.0.12 has been released with that fix. Perhaps that should be included in future Python releases?
msg181959 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2013-02-12 14:34
libffi-3.0.12 is now imported, tracked in issue #17192.
msg184888 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2013-03-21 17:21
Fixed by libffi-3.0.13 import.
Date User Action Args
2022-04-11 14:57:41adminsetgithub: 61338
2013-03-21 17:21:47benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg184888
2013-02-12 14:34:39dokosetmessages: + msg181959
2013-02-12 09:00:05djcsetpriority: normal -> release blocker
nosy: + larry, benjamin.peterson, georg.brandl
messages: + msg181949

2013-02-09 12:52:33djcsetmessages: + msg181734
2013-02-06 12:53:09ronaldoussorensetmessages: + msg181513
2013-02-06 12:29:00dokosetmessages: + msg181510
2013-02-06 08:10:44djcsetmessages: + msg181501
2013-02-06 08:01:49ronaldoussorensetnosy: + doko
messages: + msg181500
2013-02-06 07:52:31djcsetmessages: + msg181499
2013-02-05 21:10:21Arfreversetnosy: + Arfrever
messages: + msg181483
2013-02-05 16:48:53ned.deilysetnosy: + ronaldoussoren, meador.inge
2013-02-05 16:24:11djccreate