Commit Graph
86 Commits
Author SHA1 Message Date
Paul Monson db5706ff28 add support for 32-bit ARM on Windows (#477)
* add support for 32-bit ARM on Windows

* fix mismatched brace in appveyor.yml

* remove arm platform from appveyor.yml for now

* fix arm build

* fix typo

* fix assembler names

* try Visual Studio 2017

* add windows arm32 to .appveyor.yml

* update README.md
2019-04-26 07:58:58 -04:00
Jeremy Huddleston Sequoia 05a1796419 Cleanup symbol exports on darwin and add architecture preprocessor checks to assist in building fat binaries (eg: i386+x86_64 on macOS or arm+aarch64 on iOS) (#450)
* x86: Ensure _efi64 suffixed symbols are not exported

* x86: Ensure we do not export ffi_prep_cif_machdep

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* x86: Ensure we don't export ffi_call_win64, ffi_closure_win64, or ffi_go_closure_win64

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* closures: Silence a semantic warning

libffi/src/closures.c:175:23: This function declaration is not a prototype

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* aarch64: Ensure we don't export ffi_prep_cif_machdep

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* arm: Ensure we don't export ffi_prep_cif_machdep

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* aarch64, arm, x86: Add architecture preprocessor checks to support easier fat builds (eg: iOS)

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* x86: Silence some static analysis warnings

libffi/src/x86/ffi64.c:286:21: The left operand of '!=' is a garbage value due to array index out of bounds
libffi/src/x86/ffi64.c:297:22: The left operand of '!=' is a garbage value due to array index out of bounds

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* aarch: Use FFI_HIDDEN rather than .hidden

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>

* ffi.h: Don't advertise ffi_java_rvalue_to_raw, ffi_prep_java_raw_closure, and ffi_prep_java_raw_closure_loc when FFI_NATIVE_RAW_API is 0

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2019-02-19 07:11:28 -05:00
Jeremy Huddleston Sequoia ba73a671cb Update FFI_HIDDEN() to use .private_extern on Apple platforms and use the macro where appropriate
Fix issue #439

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
2018-07-21 14:36:10 -07:00
Jeremy Huddleston Sequoia 1d704051b2 i386: Fix missing break; in case statement leading to incorrectly returned FFI_BAD_ABI (#437)
* i386: Add missing break triggering dead store static analyzer checks.

Register calling sequence is being reported as bad ABI instead of working as intended.

Found-by: Clang Static Analysis
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>

* Mark ffi arm sysv entry points as private_extern.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>

* x86_64: Add implementation of compact unwind for ffi_call_unix64.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2018-06-17 20:01:50 -04:00
Saleem Abdulrasool 3c372c384a arm: fix a level of indirection issue
Rather than relying on the stack being 0'ed out always, do it manually.
The stack generally happened to be zero, and because the compiler
realizes that the tests are dealing with chars truncates the read value.
However, the top 3 nibbles of the value are undefined and may be
non-zero.  The indirection level caused a null-pointer dereference.

Explicitly scribbling on the stack during the allocation causes test
failures without the original zexting behaviour.
2017-10-24 16:44:54 -07:00
Saleem Abdulrasool 7ad0ae7f42 arm: zext return value parameters
The closure function (invoked as closure->fun in ffi_closure_XXX_inner)
will only populate the actual number of bytes for the true return type,
which may be a character.  This leaves garbage on the stack when the
assembly closure function (i.e. ffi_closure_XXX) reads the return value
off of the stack into r0 as a 4-byte value.  ffi_closure_XXX always
leaves room for at least 4 bytes here, so we can safely set them to 0.
Otherwise, if there is garbage in any of these bytes, these end up in r0
and in the returned value as well.
2017-10-10 11:46:20 -07:00
Anthony Green 02a5145abb Merge pull request #263 from ksjogo/master
fix ios builds
2017-09-27 21:43:03 -04:00
Anthony Green 10099d6cad Merge pull request #271 from frida/fix/qnx-cache-flushing
arm: Fix cache flushing on QNX
2017-09-27 20:54:09 -04:00
Gregory Pakosz bd72848c7a Prefix ALIGN macros with FFI_ 2017-04-27 13:22:28 +02:00
Johannes Goslar 0040694505 Update Xcodeproj
Include all currently relevent files.
Call autogen is build script.
Fix compiler settings.
Fix mach include.
2017-03-30 13:26:15 +02:00
s1341 ed8488345e arm: Fix cache flushing on QNX
Use `msync()` directly as `__clear_cache()` is broken in the
qnx650_gcc4.8.3 toolchain.
2016-08-10 17:09:17 +02:00
Russell Keith-Magee bc4fc07aa5 Fixed #181 -- Corrected problems with ARMv7 build under iOS.
Based on a patch from @fealebenpae, with input from @SolaWing and @rth7680,
and testing from @superdump.
2015-12-21 00:37:06 +08:00
Russell Keith-Magee e3d2812ce4 Modified arm/sysv.S to remove directives not allowed by clang. 2015-04-25 19:03:03 +08:00
Richard Henderson ab83cbb90b arm: Add support for Go closures 2014-11-12 09:32:39 +01:00
Richard Henderson 6fa617dabc arm: Add argument space for the hidden struct return pointer
This should have been failing all along, but it's only
exposed by the complex_int test case.
2014-11-12 09:32:39 +01:00
Richard Henderson a529bec27b arm: Add support for complex types 2014-11-12 09:32:36 +01:00
Richard Henderson 5e88ebe627 arm: Remove internal FFI_TYPE constants
These have been replaced by the contents of internal.h.
2014-11-12 09:32:13 +01:00
Richard Henderson a4b785ea69 arm: Rewrite ffi_closure
Move the push of the argument registers into ffi_closure_SYSV,
reducing the size of the trampoline.
2014-11-12 09:32:13 +01:00
Richard Henderson e7f15f60e8 arm: Rewrite ffi_call
Use the trick to allocate the stack frame for ffi_call_SYSV
within ffi_call itself.
2014-11-12 09:32:13 +01:00
Richard Henderson a74a3aaddb arm: Rewrite vfp_type_p
Do not modify the ffi_type.  Rearrange the tests so that we
quickly eliminate structures that cannot match.  Return an
encoded value of element count and base type.
2014-11-12 09:32:13 +01:00
Richard Henderson 0d39b4bb69 arm: Deref ffi_put_arg arguments 2014-11-12 09:32:13 +01:00
Richard Henderson 57b24fb3f5 arm: Deref ffi_align argument 2014-11-12 09:32:13 +01:00
Richard Henderson c129bea82a arm: Reindent arm/ffi.c 2014-11-12 09:32:13 +01:00
Matthias Klose aaf3101ba8 Fix -Werror=declaration-after-statement problem 2014-09-20 06:37:04 -04:00
Anthony Green 001aaf4b1b When no VFP arguments are present the IP register is used
uninitialized. Initialize it to the value of FP.

This fixes a number of testsuite failures when configured for
armv7l-unknown-linux-gnueabihf
2014-02-28 00:20:17 -05:00
Zachary Waldowski 6eff9ff9e7 Darwin/iOS: Improve unified syntax use for LLVM 2014-02-05 14:28:58 -05:00
Zachary Waldowski 994be3a5c1 Darwin/iOS: Fix mis-typing of vfp_reg_free 2014-02-05 14:28:58 -05:00
Zachary Waldowski a8e0a835ab Darwin/ARM: Assert on NULL dereference
This inhibits an analyzer warning by Clang on all platforms.
2014-02-05 14:28:58 -05:00
Zachary Waldowski 66469c381e Darwin/ARM: Inhibit Clang previous prototype warnings 2014-02-05 14:28:49 -05:00
Anthony Green 3dc3f32c35 Undo iOS ARM64 changes. 2013-12-05 16:23:25 -05:00
Zachary Waldowski 953b6f14c6 Darwin/iOS: More unified syntax support w/ Clang.
Signed-off-by: Zachary Waldowski <zwaldowski@gmail.com>
2013-11-30 03:48:45 -05:00
Zachary Waldowski c713a55379 Darwin/iOS: Simplify RETLDM arguments for LLVM 3.1
Signed-off-by: Zachary Waldowski <zwaldowski@gmail.com>
2013-11-30 03:48:05 -05:00
Zachary Waldowski 16ba1b8002 Darwin: Silence Clang warnings. 2013-11-30 03:47:58 -05:00
Anthony Green 2f450822a8 Clean up code to appease modern GCC compiler. 2013-11-18 06:52:29 -05:00
David Schneider 77f823e31f stop trying to assing vfp regs once we are done with the registers 2013-11-13 14:26:57 +01:00
David Schneider 37067ec503 mark all vfp registers as used when done.
To avoid assigning registers the would fit, once arguments have been on
the stack, we mark all registers as used once we do not find a free
register for the first time.
2013-11-12 19:49:01 +01:00
Anthony Green c2422174b3 Merge pull request #45 from foss-for-synopsys-dwc-arc-processors/arc_support
arc: Fix build error
2013-11-02 17:11:08 -04:00
Anthony Green 128cd1d2f3 Fix spelling errors 2013-10-08 06:45:51 -04:00
David Schneider 9708e7cf09 folow the ARM hard-float ABI in ffi_prep_incoming_args_VFP 2013-03-28 16:40:40 +01:00
David Schneider b41120981e create separated versions of ffi_prep_incoming_args_* for SYSV and VFP ABIs.
The different versions will be called depending on the value of cif->abi
2013-03-28 16:40:40 +01:00
David Schneider 3c1608613a extend ffi_prepare_args for FFI_VFP (hard-float ABI), fixing an issue with passing VFP arguments in VFP registers and the stack, while at the same time not using all core registers. 2013-03-28 16:38:28 +01:00
David Schneider 0f2ff2d4c9 separate ARM ffi_prepare_args in a version implementing the simple SYSV calling convention and one for the hard-float calling convention 2013-03-28 16:38:25 +01:00
David Schneider 3a352b8a82 move the hardfloat specific argument copying code to the helper function 2013-03-28 16:38:21 +01:00
David Schneider 5df6b7944a extract setting of arguments to be passed to a helper function 2013-03-28 16:38:15 +01:00
David Schneider 7d1048c471 extract code to align the argument storage pointer to a helper function 2013-03-28 16:38:10 +01:00
Zachary Waldowski 39e6a58604 More mac/ios build improvements 2012-04-11 22:39:46 -04:00
Zachary Waldowski 39dccddb60 Fix building with Clang for Darwin (OS X 10.6+ and iOS
4.0+)
2012-04-05 12:32:41 -04:00
Anthony Green e1539266e6 ARM VFP fix for old toolchains 2012-03-30 00:40:18 -04:00
Anthony Green 8360bf1cd0 Ensure that users don't include ffitarget.h directly 2012-02-23 07:01:13 -05:00
Anthony Green ff9454da44 Add David Gilbert's variadic function call support 2011-11-12 17:18:51 -05:00