summaryrefslogtreecommitdiff
path: root/lang/python26/files
diff options
context:
space:
mode:
Diffstat (limited to 'lang/python26/files')
-rw-r--r--lang/python26/files/patch-Modules___ctypes__libffi__src__arm__ffi.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/lang/python26/files/patch-Modules___ctypes__libffi__src__arm__ffi.c b/lang/python26/files/patch-Modules___ctypes__libffi__src__arm__ffi.c
new file mode 100644
index 000000000000..7df383494904
--- /dev/null
+++ b/lang/python26/files/patch-Modules___ctypes__libffi__src__arm__ffi.c
@@ -0,0 +1,36 @@
+# Description: Fix _ctypes abort on import for FreeBSD/ARM. This is an issue
+# for anything !apple that is using the libcompiler_rt provided by clang on arm
+# PR: ports/149167 ports/184517
+# Patch by: cognet@ (to be upstreamed @ LLVM)
+
+--- ./Modules/_ctypes/libffi/src/arm/ffi.c.orig 2013-12-06 00:45:21.870941788 +1100
++++ ./Modules/_ctypes/libffi/src/arm/ffi.c 2013-12-06 00:46:42.804848626 +1100
+@@ -29,6 +29,11 @@
+
+ #include <stdlib.h>
+
++#if defined(__FreeBSD__) && defined(__arm__)
++#include <sys/types.h>
++#include <machine/sysarch.h>
++#endif
++
+ /* ffi_prep_args is called by the assembly routine once stack space
+ has been allocated for the function's arguments */
+
+@@ -273,6 +278,16 @@
+
+ /* How to make a trampoline. */
+
++#if defined(__FreeBSD__) && defined(__arm__)
++#define __clear_cache(start, end) do { \
++ struct arm_sync_icache_args ua; \
++ \
++ ua.addr = (uintptr_t)(start); \
++ ua.len = (char *)(end) - (char *)start; \
++ sysarch(ARM_SYNC_ICACHE, &ua); \
++ } while (0);
++#endif
++
+ #define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
+ ({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
+ unsigned int __fun = (unsigned int)(FUN); \