Commit Graph
387 Commits
Author SHA1 Message Date
Tony Reix 0ff9419f2e This patch enables FFI Go Closure on AIX. 2017-05-17 14:57:53 +02:00
Gregory Pakosz bd72848c7a Prefix ALIGN macros with FFI_ 2017-04-27 13:22:28 +02:00
Anthony Green a94c999ba0 Handle fastcall declaration differently for some Microsoft compilers 2017-03-19 07:36:07 -04:00
Anthony Green a0b14eea2b Merge pull request #291 from ramon-garcia/visual-studio-build
Build with Visual C++ (64 bits)
2017-03-17 09:20:40 -04:00
Ole André Vadla Ravnås d42ce7b95c Fix error path so mutex is unlocked before returning
In the unusual case where ffi_trampoline_table_alloc() fails.
2017-03-15 01:27:43 +01:00
Ramón García Fernández 1e0d107b4b Modify configure.host to detect compilation with Microsoft Visual C++ and use assembly with Intel syntax in that case 2017-01-08 20:34:44 +01:00
Richard Henderson 256ce51c40 Merge pull request #273 from wbx-github/master
m68k: support ISA-A Coldfire CPUs
2016-09-01 13:54:51 -07:00
Richard Henderson 2ded2a4f49 Merge pull request #272 from yousong/mips64-soft-float
Mips64 soft float
2016-09-01 13:30:45 -07:00
Yuriy Kolerov b545ff81f5 ARC: Remove unused variable
Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
2016-08-23 20:23:37 +03:00
Waldemar Brodkorb 52a11f6d91 m68k: support ISA-A Coldfire CPUs
Fix compilation for m68k/coldfire CPUs like mcf5208.

Signed-off-by: Thorsten Glaser <tg@mirbsd.de>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-08-20 01:05:32 +02:00
Yousong Zhou 7a0d2c83bf mips: fix MIPS softfloat build issue
The patch for o32.S is taken from OpenWrt packages repo 3a7a4bf "libffi:
fix MIPS softfloat build issue with current binutils"

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2016-08-15 15:14:54 +08:00
Tom Tromey 06d7c5190e Merge pull request #269 from frida/fix/aarch64-variadic-closures-on-ios
aarch64: Fix handling of variadic closures on iOS
2016-08-10 15:06:16 -06:00
Tom Tromey aa7ed78c0e Merge pull request #268 from frida/fix/aarch64-large-aggregates
aarch64: Fix handling of aggregates larger than 16 bytes
2016-08-10 15:03:37 -06:00
Ole André Vadla Ravnås 4da814b18a aarch64: Fix handling of aggregates larger than 16 bytes
Instead of allocating stack space for a pointer we would allocate stack
space for the actual aggregate size.
2016-08-10 22:48:09 +02:00
Ole André Vadla Ravnås 5e9ac7e252 aarch64: Fix warning about unused function on iOS 2016-08-10 17:07:17 +02:00
Ole André Vadla Ravnås 4d1f11f6a9 aarch64: Fix operand size warning reported by Clang 2016-08-10 17:07:11 +02:00
Ole André Vadla Ravnås 301166b11e aarch64: Fix handling of variadic closures on iOS 2016-08-10 17:05:00 +02:00
Tom Tromey cf4b2a5041 Don't dereference "ecif" before NULL check
Fixes #260
2016-06-17 10:09:44 +01:00
Richard Henderson 794a54d4a6 Mark win64.S with GNU-stack note 2016-06-05 14:57:00 -07:00
Iain Sandoe 52fbd12dca [Darwin-ppc, build] Fixes for clang build.
clang is experimental on powerpc-darwin, but the changes are appropriate to cctools as as well.

Use the 'official' simplified cmpwi insn, rather than the implied one accepted by cctools.
Do not re-use a set value.
2016-05-26 09:06:35 +01:00
Iain Sandoe 92810b4bc1 [Darwin-x86, build] Fix up label prefixes, remove .purgem
Darwin uses a label prefix of _.
cctools assembler will not accept .purgem as a directive.
2016-05-26 09:06:35 +01:00
Berker Peksag 74b3f52014 Remove unused FFI_CLOSURE_TEST
It was here since the first commit c6dddbd (warning: huge diff) and
it wasn't defined by the configure script. It was probably used
manually during development.
2016-05-19 18:05:36 +03:00
Tom Tromey 0969a1c1b3 Merge pull request #232 from berkerpeksag/signcompare
Fix -Wsign-compare warnings in x86/ffi64.c
2016-05-18 10:09:28 -06:00
Berker Peksag 1e82e1cda4 Define _GNU_SOURCE on Linux for mremap()
This was committed to CPython's libffi copy in
https://bugs.python.org/issue10309

mremap() documentation says _GNU_SOURCE needs to
be defined in order to use mremap(): see the
synopsis section at http://linux.die.net/man/2/mremap

Original commit: https://hg.python.org/cpython/rev/9986fff720a2

Original patch was written by Hallvard B Furuseth.
2016-05-18 10:42:38 +03:00
Berker Peksag 4a677a425c Fix -Wsign-compare warnings in x86/ffi64.c
This was originally reported on the Python tracker:

  httpa://bugs.python.org/issue23958

The original patch was written by Steve R. Hastings.

I've updated it to current master of libffi.
2016-05-18 10:35:20 +03:00
Tom Tromey 9443eaeda8 Merge pull request #242 from somasis/master
Fix usage on musl libc
2016-05-17 17:04:50 -06:00
Richard Henderson 48bfae1f37 Merge pull request #236 from andreas-schwab/master
Define FFI_SIZEOF_JAVA_RAW for aarch64 ILP32
2016-05-02 20:58:57 -10:00
Kylie McClain e169ba2b83 Fix usage on musl libc
A gcc compiled on musl does not define __gnu_linux__, it defines __linux__.
Only on glibc does __gnu_linux__ get defined, but both define __linux__, so
we should check for that instead.

With this patch, libffi works perfectly, and passes its testsuite entirely
on musl libc systems.
2016-04-29 21:31:59 -04:00
Richard Henderson e5843a3a09 x86: Fix calling convention for ffi_closure_win64_inner
Also enable testing for the cross-abi calls.
2016-04-29 14:17:36 -07:00
Richard Henderson d06751979b x86: Copy fix for clang .org from unix64.S
Clang doesn't understand .org with symbolic operands.
2016-04-15 16:10:28 -07:00
Andreas Schwab d76975dbd2 Define FFI_SIZEOF_JAVA_RAW for aarch64 ILP32
Like x32, aarch64 ILP32 needs to define FFI_SIZEOF_JAVA_RAW.  This fixes
the java interpreter.
2016-03-16 12:23:07 +01:00
Tom Tromey 38a4d72c95 add ffi_get_struct_offsets 2016-02-22 16:07:55 -07:00
Anthony Green 49b95edafd Merge pull request #194 from amodra/master
Correct powerpc sysv stack argument accounting
2016-02-20 06:49:40 -05:00
Anthony Green 415723b40b Merge pull request #104 from joshtriplett/efi64
Support the Windows/EFI calling convention on all x86-64 targets
2016-02-20 06:49:19 -05:00
Anthony Green 69143d06c6 Merge pull request #197 from foxsen/mips_go_closure
Mips go closure support
2016-02-20 06:44:28 -05: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
Zhang Fuxin 505346e18f fix type error in unwind code 2015-08-26 09:57:10 +08:00
foxsen 5953c66bd7 add unwind infor for *go_closure;
reorder the labels to make thing more clear
2015-08-20 20:28:13 +08:00
Zhang Fuxin f0ecd5d403 fix O32 stack unwind code
add missing 1: label
2015-08-11 12:47:36 +08:00
foxsen 6f0201c803 various fixes for go closure support. Now all n64 tests passed. 2015-08-04 18:25:34 +08:00
foxsen 697dd4e8a0 add support for go closure support on mips 2015-08-04 12:53:33 +08:00
Alan Modra 43fc5bca48 Correct powerpc sysv stack argument accounting
ppc32 starts using the stack for integer arg passing when we run out
of integer arg passing registers.  Similarly, we start using the stack
for floating point args when we run out of floating point registers.
The decision on where an integer arg goes does not depend on number of
floating point args, nor does the decision on where a floating point
arg goes depend on number of integer args.  Alignment of stack args
also simply depends on number of stack args.

This patch untangles the horrible mess we had, with intarg_count being
wrongly used to count both integer args and stack words.

	* src/powerpc/ffi_sysv.c (ffi_prep_cif_sysv_core): Count fprs,
	gprs, and stack words separately.
	(ffi_prep_args_SYSV): Similarly.
2015-08-03 23:34:05 +09:30
Josh Triplett 1f6b5a91f4 Support the WIN64/EFI64 calling convention on all X86_64 platforms
Add a new calling convention FFI_EFI64, alias FFI_WIN64, on all X86_64
platforms.  This allows libffi compiled on a 64-bit x86 platform to call
EFI functions.

Compile in ffiw64.c and win64.S on all X86_64 platforms.  When compiled
for a platform other than X86_WIN64, ffiw64.c suffixes its functions
with _efi64, to avoid conflict with the platform's actual
implementations of those functions.
2015-07-26 17:18:16 -07:00
Josh Triplett 6de51f3e04 src/x86/ffiw64.c: Don't assign a "char *" to an "unsigned char *"
Declare a local variable to match the type of the struct field assigned
to it, rather than adding unsigned to the type.  Fixes a -Wpointer-sign
warning.
2015-07-26 17:18:16 -07:00
Josh Triplett eaa59755fc src/x86/win64.S: Handle name mangling and PIC
Move the macros from unix64.S into a shared header asmnames.h and use
them in win64.S too.
2015-07-26 17:18:16 -07:00
Josh Triplett c8e82d9fbf src/x86/win64.S: Support compiling on non-WIN64 platforms
Non-WIN64 versions of the GNU assembler don't support the .seh_*
directives for structured exception handling, so wrap them in a macro
that compiles to nothing.

Handle the registers used for the non-Windows x86-64 calling convention
when on a non-Windows platform.  Distinguish between cases that should
refer to the native argument registers (defined as arg0, arg1, arg2, and
arg3) and cases that should always refer to the Windows argument
registers.
2015-07-26 16:18:57 -07:00
Russell Keith-Magee e3d2812ce4 Modified arm/sysv.S to remove directives not allowed by clang. 2015-04-25 19:03:03 +08:00
Andrew Pinski 95df379193 aarch64: Handle ILP32 ABI 2015-02-11 08:31:48 -08:00
Richard Henderson 2104b2a4fc sparc: Re-introduce hand-written unwind info
Fixes the build with the Solaris assembler.
2015-01-28 09:41:07 -08:00
Anthony Green 31a6185307 Merge pull request #170 from fealebenpae/aarch64-trampoline-table
Support closures on ARM64 iOS
2015-01-21 05:55:47 -05:00