From e14d9886d85688dc39e53f8cfa7a0288bf318783 Mon Sep 17 00:00:00 2001 From: Zachary Waldowski Date: Tue, 24 Apr 2012 11:16:20 -0400 Subject: [PATCH] More unified syntax compatibility, for all versions. Signed-off-by: Zachary Waldowski --- ios/src/arm/sysv.S | 59 ++++++++++++++++++---------------------------- libffi.podspec | 26 ++++++++++---------- 2 files changed, 36 insertions(+), 49 deletions(-) diff --git a/ios/src/arm/sysv.S b/ios/src/arm/sysv.S index e8b1acb..f6b1802 100644 --- a/ios/src/arm/sysv.S +++ b/ios/src/arm/sysv.S @@ -109,44 +109,31 @@ #define UNWIND #else #define UNWIND @ -#endif +#endif + +.syntax unified #if defined(__thumb__) && !defined(__THUMB_INTERWORK__) -.macro ARM_FUNC_START name - .text - .align 0 - .thumb - .thumb_func -#ifdef __APPLE__ - ENTRY($0) -#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 +#define ARM_FUNC_START(name) \ + .text; \ + .align 0; \ + .thumb; \ + .thumb_func; \ + ENTRY(name); \ + bx pc; \ + nop; \ + .arm; \ + UNWIND .fnstart; \ +_L__##name: \ .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 0; \ + .arm; \ + ENTRY(name); \ UNWIND .fnstart -.endm #endif .macro RETLDM @@ -165,7 +152,7 @@ _L__\name: @ 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} @@ -222,7 +209,7 @@ ARM_FUNC_START ffi_call_SYSV #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) @@ -260,7 +247,7 @@ LSYM(Lepilogue): 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} @@ -404,7 +391,7 @@ LSYM(Lbase_args): 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 diff --git a/libffi.podspec b/libffi.podspec index fe0e91f..7b8ff12 100644 --- a/libffi.podspec +++ b/libffi.podspec @@ -1,21 +1,21 @@ Pod::Spec.new do |s| - s.name = 'libffi' - s.version = '3.0.11' - s.license = 'MIT' - s.summary = 'A portable foreign-function interface library.' - s.homepage = 'http://sourceware.org/libffi/' - s.author = { 'Anthony Green' => 'green@moxielogic.com', - 'Raffaele Sena' => 'aff367@gmail.com', - 'Jon Beniston' => 'jon@beniston.com', - 'Bo Thorsen' => 'bo@suse.de', - 'Landon Fuller' => 'landonf@plausible.coop', - 'Zachary Waldowski' => 'zwaldowski@gmail.com' } - s.source = { :git => 'https://github.com/zwaldowski/libffi-iOS.git', :tag => 'v3.0.11' } + s.name = 'libffi' + s.version = '3.0.11' + s.license = 'MIT' + s.summary = 'A portable foreign-function interface library.' + s.homepage = 'http://sourceware.org/libffi/' + s.author = { 'Anthony Green' => 'green@moxielogic.com', + 'Raffaele Sena' => 'aff367@gmail.com', + 'Jon Beniston' => 'jon@beniston.com', + 'Bo Thorsen' => 'bo@suse.de', + 'Landon Fuller' => 'landonf@plausible.coop', + 'Zachary Waldowski' => 'zwaldowski@gmail.com' } + s.source = { :git => 'https://github.com/zwaldowski/libffi-iOS.git', :tag => 'v3.0.11' } s.clean_paths = 'patches/', 'libffi.xcodeproj/', '.gitignore' if config.ios? s.source_files = 'ios/include/*.h', 'ios/src/arm/*.{c,S}', 'ios/src/x86/{ffi.c,darwin.S}', 'src/{closures,prep_cif,raw_api,types}.c' else s.source_files = 'osx/include/*.h', 'osx/src/x86/{darwin.S,darwin64.S,ffi.c,ffi64.c}', 'src/{closures,prep_cif,raw_api,types}.c' end - s.xcconfig = { 'OTHER_LDFLAGS' => "-Wl,-no_compact_unwind" } + s.xcconfig = { 'OTHER_LDFLAGS' => "-Wl,-no_compact_unwind" } end \ No newline at end of file