Skip to content
This repository has been archived by the owner on Dec 26, 2018. It is now read-only.

Commit

Permalink
More unified syntax compatibility, for all versions.
Browse files Browse the repository at this point in the history
Signed-off-by: Zachary Waldowski <zwaldowski@gmail.com>
  • Loading branch information
zwaldowski committed Apr 24, 2012
1 parent 80e2b0c commit e14d988
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 49 deletions.
59 changes: 23 additions & 36 deletions ios/src/arm/sysv.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions libffi.podspec
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e14d988

Please sign in to comment.