fixed ctypes error. Added .patch files for required modifications to get working pyobjus on iOS.
This commit is contained in:
parent
a2aeb88386
commit
8217ea4a55
6 changed files with 144 additions and 3014 deletions
137
src/ffi_files/ffi-3.0.13-sysv.S.patch
Normal file
137
src/ffi_files/ffi-3.0.13-sysv.S.patch
Normal file
|
@ -0,0 +1,137 @@
|
|||
--- libffi-3.0.13-old/src/arm/sysv.S 2013-03-16 12:19:39.000000000 +0100
|
||||
+++ libffi-3.0.13-new/src/arm/sysv.S 2013-08-26 19:33:28.000000000 +0200
|
||||
@@ -109,58 +109,35 @@
|
||||
#define UNWIND @
|
||||
#endif
|
||||
|
||||
+.syntax unified
|
||||
|
||||
#if defined(__thumb__) && !defined(__THUMB_INTERWORK__)
|
||||
-.macro ARM_FUNC_START name
|
||||
- .text
|
||||
- .align 0
|
||||
- .thumb
|
||||
- .thumb_func
|
||||
-#ifdef __APPLE__
|
||||
- ENTRY($0)
|
||||
+#define ARM_FUNC_START(name) \
|
||||
+ .text; \
|
||||
+ .align 4; \
|
||||
+ .thumb; \
|
||||
+ .thumb_func; \
|
||||
+ ENTRY(name); \
|
||||
+ bx pc; \
|
||||
+ nop; \
|
||||
+ .arm; \
|
||||
+ UNWIND .fnstart; \
|
||||
+_L__##name:
|
||||
#else
|
||||
- ENTRY(\name)
|
||||
-#endif
|
||||
- bx pc
|
||||
- nop
|
||||
- .arm
|
||||
- UNWIND .fnstart
|
||||
-/* A hook to tell gdb that we've switched to ARM mode. Also used to call
|
||||
- directly from other local arm routines. */
|
||||
-#ifdef __APPLE__
|
||||
-_L__$0:
|
||||
-#else
|
||||
-_L__\name:
|
||||
-#endif
|
||||
-.endm
|
||||
-#else
|
||||
-.macro ARM_FUNC_START name
|
||||
- .text
|
||||
- .align 0
|
||||
- .arm
|
||||
-#ifdef __APPLE__
|
||||
- ENTRY($0)
|
||||
-#else
|
||||
- ENTRY(\name)
|
||||
-#endif
|
||||
+#define ARM_FUNC_START(name) \
|
||||
+ .text; \
|
||||
+ .align 4; \
|
||||
+ .arm; \
|
||||
+ ENTRY(name); \
|
||||
UNWIND .fnstart
|
||||
-.endm
|
||||
#endif
|
||||
|
||||
-.macro RETLDM regs=, cond=, dirn=ia
|
||||
+.macro RETLDM
|
||||
#if defined (__INTERWORKING__)
|
||||
- .ifc "\regs",""
|
||||
- ldr\cond lr, [sp], #4
|
||||
- .else
|
||||
- ldm\cond\dirn sp!, {\regs, lr}
|
||||
- .endif
|
||||
- bx\cond lr
|
||||
+ ldr lr, [sp], #4
|
||||
+ bx lr
|
||||
#else
|
||||
- .ifc "\regs",""
|
||||
- ldr\cond pc, [sp], #4
|
||||
- .else
|
||||
- ldm\cond\dirn sp!, {\regs, pc}
|
||||
- .endif
|
||||
+ ldr pc, [sp], #4
|
||||
#endif
|
||||
.endm
|
||||
|
||||
@@ -170,8 +147,7 @@
|
||||
@ r3: fig->flags
|
||||
@ sp+0: ecif.rvalue
|
||||
|
||||
- @ This assumes we are using gas.
|
||||
-ARM_FUNC_START ffi_call_SYSV
|
||||
+ARM_FUNC_START(ffi_call_SYSV)
|
||||
@ Save registers
|
||||
stmfd sp!, {r0-r3, fp, lr}
|
||||
UNWIND .save {r0-r3, fp, lr}
|
||||
@@ -228,7 +204,7 @@
|
||||
#if defined(__SOFTFP__) || defined(__ARM_EABI__)
|
||||
cmpne r3, #FFI_TYPE_DOUBLE
|
||||
#endif
|
||||
- stmeqia r2, {r0, r1}
|
||||
+ stmiaeq r2, {r0, r1}
|
||||
|
||||
#if !defined(__SOFTFP__) && !defined(__ARM_EABI__)
|
||||
beq LSYM(Lepilogue)
|
||||
@@ -266,7 +242,7 @@
|
||||
void *args;
|
||||
*/
|
||||
|
||||
-ARM_FUNC_START ffi_closure_SYSV
|
||||
+ARM_FUNC_START(ffi_closure_SYSV)
|
||||
UNWIND .pad #16
|
||||
add ip, sp, #16
|
||||
stmfd sp!, {ip, lr}
|
||||
@@ -345,7 +321,7 @@
|
||||
@ r3: fig->flags
|
||||
@ sp+0: ecif.rvalue
|
||||
|
||||
-ARM_FUNC_START ffi_call_VFP
|
||||
+ARM_FUNC_START(ffi_call_VFP)
|
||||
@ Save registers
|
||||
stmfd sp!, {r0-r3, fp, lr}
|
||||
UNWIND .save {r0-r3, fp, lr}
|
||||
@@ -410,7 +386,7 @@
|
||||
beq LSYM(Lepilogue_vfp)
|
||||
|
||||
cmp r3, #FFI_TYPE_SINT64
|
||||
- stmeqia r2, {r0, r1}
|
||||
+ stmiaeq r2, {r0, r1}
|
||||
beq LSYM(Lepilogue_vfp)
|
||||
|
||||
cmp r3, #FFI_TYPE_FLOAT
|
||||
@@ -433,7 +409,7 @@
|
||||
.size CNAME(ffi_call_VFP),.ffi_call_VFP_end-CNAME(ffi_call_VFP)
|
||||
|
||||
|
||||
-ARM_FUNC_START ffi_closure_VFP
|
||||
+ARM_FUNC_START(ffi_closure_VFP)
|
||||
fstmfdd sp!, {d0-d7}
|
||||
@ r0-r3, then d0-d7
|
||||
UNWIND .pad #80
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "Building libffi ============================="
|
||||
|
||||
. $(dirname $0)/environment.sh
|
||||
|
||||
if [ ! -f $CACHEROOT/libffi-$FFI_VERSION.tar.gz ]; then
|
||||
|
@ -17,10 +19,10 @@ fi
|
|||
|
||||
# lib not found, compile it
|
||||
pushd $TMPROOT/libffi-$FFI_VERSION
|
||||
try patch -p1 < $KIVYIOSROOT/src/ffi_files/ffi-$FFI_VERSION-sysv.S.patch
|
||||
|
||||
try xcodebuild -project libffi.xcodeproj -target "libffi iOS" -configuration Release -sdk iphoneos$SDKVER OTHER_CFLAGS="-no-integrated-as"
|
||||
|
||||
try cp build/Release-iphoneos/libffi.a $BUILDROOT/lib/libffi.a
|
||||
try cp -a build/Release-iphoneos/usr/local/include $BUILDROOT/include/ffi
|
||||
|
||||
popd
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
. $(dirname $0)/environment.sh
|
||||
echo "Building pyobjus ============================="
|
||||
|
||||
. $(dirname $0)/environment.sh
|
||||
|
||||
if [ ! -d $TMPROOT/pyobjus ] ; then
|
||||
try pushd $TMPROOT
|
||||
|
@ -42,6 +43,5 @@ export LDFLAGS="$OLD_LDFLAGS"
|
|||
export LDSHARED="$OLD_LDSHARED"
|
||||
|
||||
bd=$TMPROOT/pyobjus/build/lib.macosx-*/pyobjus
|
||||
echo $bd
|
||||
try $KIVYIOSROOT/tools/biglink $BUILDROOT/lib/libpyobjus.a $bd
|
||||
deduplicate $BUILDROOT/lib/libpyobjus.a
|
||||
|
|
|
@ -63,8 +63,8 @@ try ./configure CC="$ARM_CC" LD="$ARM_LD" \
|
|||
--without-doc-strings
|
||||
|
||||
# with undefined lookup, checks in configure just failed :(
|
||||
try cp $KIVYIOSROOT/src/python_files/pyconfig.h pyconfig.h
|
||||
try cp $KIVYIOSROOT/src/python_files/cfield.c Modules/_ctypes/cfield.c
|
||||
try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$IOS_PYTHON_VERSION-pyconfig.patch
|
||||
try patch -p1 < $KIVYIOSROOT/src/python_files/Python-$IOS_PYTHON_VERSION-ctypes_duplicate.patch
|
||||
|
||||
try make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen \
|
||||
CROSS_COMPILE_TARGET=yes
|
||||
|
|
Loading…
Reference in a new issue