Issue 16050: ctypes: callback from C++ to Python fails with Illegal Instruction call (original) (raw)

Created on 2012-09-26 00:22 by Opilki_Inside, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
soft_float.patch Opilki_Inside,2012-09-26 00:22 patch that support _SOFT_FLOAT flag along with __NO_FPRS__ review
Messages (4)
msg171325 - (view) Author: Pavel Maltsev (Opilki_Inside) Date: 2012-09-26 00:22
ppc_405, Linux 2.4, GCC 3.3.1 Python crashes on attempt to pass python callback function to custom C++ library under PowerPC 405. This happens because some versions of GCC (I guess below 4.1) doesn't raise __NO_FPRS__ flag if hard-floats is not supported, instead they use _SOFT_FLOAT. So we need to change #ifndef __NO_FPRS__ to #if (!defined(__NO_FPRS__) && !defined(_SOFT_FLOAT))
msg171422 - (view) Author: Jesús Cea Avión (jcea) * (Python committer) Date: 2012-09-28 09:24
Pavel, I think the FFI we use is a direct copy of libffi. Could you contact upstream?.
msg240627 - (view) Author: Arnon Yaari (wiggin15) * Date: 2015-04-13 15:42
libffi seem to have fixed this issue in their commit "4acf005 - Build fix for soft-float power targets". The fix is different than what Pavel suggested, but sounds like it should do the same.
msg240678 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-04-13 17:38
Arnon also checked that our local copy of libffi contains the upstream fix. In the absence of a way to test this, we'll just have to assume it is fixed.
History
Date User Action Args
2022-04-11 14:57:36 admin set github: 60254
2015-04-13 17:38:00 r.david.murray set status: open -> closednosy: + r.david.murraymessages: + resolution: out of datestage: resolved
2015-04-13 15:42:17 wiggin15 set nosy: + wiggin15messages: +
2012-10-07 12:30:30 asvetlov set nosy: + asvetlov
2012-09-28 09:24:33 jcea set nosy: + jceamessages: +
2012-09-26 00:22:14 Opilki_Inside create