Skip to contentSkip to conversation

python: fix the _ctype module compiling error caused by ffi library

PATCH New Diankun Zhang 2 participants 2 messages Jul 20, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python: fix the _ctype module compiling error caused by ffi library

The ctype compiling error for python 2 is caused by the mixed ifdefs X86_WIN32 and X86_WIN64. The issue is tracked by python upstream issue https://bugs.python.org/issue23042.
Whereas the patch is not completely applied on python package. This additional patch is a supplement for the issue.

---
 package/python/0035-fix-ffi-windws-ifdefs.patch | 27
+++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 package/python/0035-fix-ffi-windws-ifdefs.patch
(quoted diff) +0 -0

b/package/python/0035-fix-ffi-windws-ifdefs.patch
new file mode 100644
index 0000000..74511cf

package/python/0035-fix-ffi-windws-ifdefs.patch new file +27 -0
@@ -0,0 +1,27 @@
+ffi.c: fix the compiling error caused by the mixed definition of calls for
+       different platforms(x86 and x64) in function ffi_prep_closure_loc()
+
+The issue is tracked by upstream python bug
+https://bugs.python.org/issue23042
+
+Signed-off-by: Diankun Zhang <[email protected]>
+
+--- a/Modules/_ctypes/libffi/src/x86/ffi.c     Wed Mar 18 14:39:33 2015
+0100
++++ b/Modules/_ctypes/libffi/src/x86/ffi.c     Thu Mar 19 08:39:52 2015
+0000
+@@ -673,6 +673,7 @@
+                            &ffi_closure_SYSV,
+                            (void*)codeloc);
+     }
++#ifdef X86_WIN32
+   else if (cif->abi == FFI_FASTCALL)
+     {
+       FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0],
+@@ -691,7 +692,6 @@
+                                    &ffi_closure_STDCALL,
+                                    (void*)codeloc);
+     }
+-#ifdef X86_WIN32
+   else if (cif->abi == FFI_MS_CDECL)
+     {

+ FFI_INIT_TRAMPOLINE (&closure->tramp[0],
+
--
2.7.4

Signature · 4 lines
-Diankun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170720/56371484/attachment.html>
#1 lore raw

PATCH 1/1 python: fix the _ctype module compiling error caused by ffi library

Hello,

Your patch is line-wrapped. Could you please send it with "git send-email" ?

Quoted 7 lines · Diankun Zhang

The ctype compiling error for python 2 is caused by the mixed ifdefs X86_WIN32 and X86_WIN64. The issue is tracked by python upstream issue https://bugs.python.org/issue23042.
Whereas the patch is not completely applied on python package. This additional patch is a supplement for the issue.

Which Buildroot configuration causes the build error fixed by this patch ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com