aboutsummaryrefslogtreecommitdiff
path: root/meta-bigendian
diff options
context:
space:
mode:
Diffstat (limited to 'meta-bigendian')
-rw-r--r--meta-bigendian/recipes-devtools/python/python/python_ffi_armeb_be8.patch34
-rw-r--r--meta-bigendian/recipes-devtools/python/python_2.7.3.bbappend3
2 files changed, 37 insertions, 0 deletions
diff --git a/meta-bigendian/recipes-devtools/python/python/python_ffi_armeb_be8.patch b/meta-bigendian/recipes-devtools/python/python/python_ffi_armeb_be8.patch
new file mode 100644
index 00000000..afd090b5
--- /dev/null
+++ b/meta-bigendian/recipes-devtools/python/python/python_ffi_armeb_be8.patch
@@ -0,0 +1,34 @@
+Index: Python-2.7.3/Modules/_ctypes/libffi/src/arm/ffi.c
+===================================================================
+--- Python-2.7.3.orig/Modules/_ctypes/libffi/src/arm/ffi.c
++++ Python-2.7.3/Modules/_ctypes/libffi/src/arm/ffi.c
+@@ -272,7 +272,7 @@ ffi_prep_incoming_args_SYSV(char *stack,
+ }
+
+ /* How to make a trampoline. */
+-
++#if !(defined(__ARMEB__) && defined(__ARM_ARCH_7A__))
+ #define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
+ ({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
+ unsigned int __fun = (unsigned int)(FUN); \
+@@ -284,7 +284,19 @@ ffi_prep_incoming_args_SYSV(char *stack,
+ *(unsigned int*) &__tramp[16] = __fun; \
+ __clear_cache((&__tramp[0]), (&__tramp[19])); \
+ })
+-
++#else /* armv7 big endian: be8 instructions are still little endian */
++#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
++({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
++ unsigned int __fun = (unsigned int)(FUN); \
++ unsigned int __ctx = (unsigned int)(CTX); \
++ *(unsigned int*) &__tramp[0] = 0x0f002de9; /* swab(0xe92d000f, 4) - stmfd sp!, {r0-r3} */ \
++ *(unsigned int*) &__tramp[4] = 0x00009fe5; /* swab(0xe59f0000, 4) - ldr r0, [pc] */ \
++ *(unsigned int*) &__tramp[8] = 0x00f09fe5; /* swab(0xe59ff000, 4) - ldr pc, [pc] */ \
++ *(unsigned int*) &__tramp[12] = __ctx; \
++ *(unsigned int*) &__tramp[16] = __fun; \
++ __clear_cache((&__tramp[0]), (&__tramp[19])); \
++ })
++#endif
+
+ /* the cif must already be prep'ed */
+
diff --git a/meta-bigendian/recipes-devtools/python/python_2.7.3.bbappend b/meta-bigendian/recipes-devtools/python/python_2.7.3.bbappend
new file mode 100644
index 00000000..a3dfa9bd
--- /dev/null
+++ b/meta-bigendian/recipes-devtools/python/python_2.7.3.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS := "${THISDIR}/${PN}"
+
+SRC_URI += "file://python_ffi_armeb_be8.patch"