Commit Graph

734 Commits

Author SHA1 Message Date
Bernd Edlinger
bfcbf329c5 2014-05-11 Bernd Edlinger <bernd.edlinger@hotmail.de>
Fix current cygwin-64 build problems.
	* src/java_raw_api.c: Remove if !defined(FFI_NO_RAW_API).
	* src/x86/ffi.c: Add if defined(__CYGWIN__).
	* src/x86/win64.S (ffi_closure_win64, ffi_call_win64): Added
	handling for FFI_TYPE_UINT64, FFI_TYPE_POINTER and FFI_TYPE_INT.
	Added SEH information.  Fixed formatting.
2014-09-20 06:51:45 -04:00
Jakub Jelinek
32cb2ce81d 2014-09-10 Jakub Jelinek <jakub@redhat.com>
* src/powerpc/linux64.S: Emit .note.GNU-stack even when
	POWERPC64 is not defined.
	* src/powerpc/linux64_closure.S: Likewise.  Also test _CALL_ELF == 2.
2014-09-20 06:39:55 -04:00
Matthias Klose
aaf3101ba8 Fix -Werror=declaration-after-statement problem 2014-09-20 06:37:04 -04:00
Dominik Vogt
6e8a446083 2014-07-22 Dominik Vogt <vogt@linux.vnet.ibm.com>
* src/types.c (FFI_TYPEDEF, FFI_NONCONST_TYPEDEF): Merge the macros by
	adding another argument that controls whether the result is const or not
	(FFI_LDBL_CONST): Temporary macro to reduce ifdef confusion
	* src/prep_cif.c (ffi_prep_cif_core): Replace list of systems with new
	macro FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION
	* src/pa/ffitarget.h (FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION):
	Define.
	* src/s390/ffitarget.h (FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION):
	Define.
	* src/x86/ffitarget.h (FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION):
	Define.

2014-07-22  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* doc/libffi.texi (Primitive Types): Document ffi_type_complex_float,
	ffi_type_complex_double and ffi_type_complex_longdouble
	(Complex Types): New subsection.
	(Complex Type Example): Ditto.
	* testsuite/libffi.call/cls_align_complex_double.c: New
	FFI_TYPE_COMPLEX test.
	* testsuite/libffi.call/cls_align_complex_float.c: Ditto.
	* testsuite/libffi.call/cls_align_complex_longdouble.c: Ditto.
	* testsuite/libffi.call/cls_complex_double.c: Ditto.
	* testsuite/libffi.call/cls_complex_float.c: Ditto.
	* testsuite/libffi.call/cls_complex_longdouble.c: Ditto.
	* testsuite/libffi.call/cls_complex_struct_double.c: Ditto.
	* testsuite/libffi.call/cls_complex_struct_float.c: Ditto.
	* testsuite/libffi.call/cls_complex_struct_longdouble.c: Ditto.
	* testsuite/libffi.call/cls_complex_va_double.c: Ditto.
	* testsuite/libffi.call/cls_complex_va_float.c: Ditto.
	* testsuite/libffi.call/cls_complex_va_longdouble.c: Ditto.
	* testsuite/libffi.call/complex_double.c: Ditto.
	* testsuite/libffi.call/complex_defs_double.c: Ditto.
	* testsuite/libffi.call/complex_float.c: Ditto.
	* testsuite/libffi.call/complex_defs_float.c: Ditto.
	* testsuite/libffi.call/complex_longdouble.c: Ditto.
	* testsuite/libffi.call/complex_defs_longdouble.c: Ditto.
	* testsuite/libffi.call/complex_int.c: Ditto.
	* testsuite/libffi.call/many_complex_double.c: Ditto.
	* testsuite/libffi.call/many_complex_float.c: Ditto.
	* testsuite/libffi.call/many_complex_longdouble.c: Ditto.
	* testsuite/libffi.call/return_complex1_double.c: Ditto.
	* testsuite/libffi.call/return_complex1_float.c: Ditto.
	* testsuite/libffi.call/return_complex1_longdouble.c: Ditto.
	* testsuite/libffi.call/return_complex2_double.c: Ditto.
	* testsuite/libffi.call/return_complex2_float.c: Ditto.
	* testsuite/libffi.call/return_complex2_longdouble.c: Ditto.
	* testsuite/libffi.call/return_complex_double.c: Ditto.
	* testsuite/libffi.call/return_complex_float.c: Ditto.
	* testsuite/libffi.call/return_complex_longdouble.c: Ditto.
	* src/raw_api.c (ffi_raw_to_ptrarray): Handle FFI_TYPE_COMPLEX
	(ffi_ptrarray_to_raw): Ditto.
	* src/prep_cif.c (ffi_prep_cif_core): Abort if FFI_TYPE_COMPLEX is not
	implemented in libffi for the target.
	* src/java_raw_api.c (ffi_java_raw_size): FFI_TYPE_COMPLEX not supported
	yet (abort).
	(ffi_java_raw_to_ptrarray): Ditto.
	(ffi_java_rvalue_to_raw): Ditto.
	(ffi_java_raw_to_rvalue):  Ditto.
	* src/debug.c (ffi_type_test): Add debug tests for complex types.
	* include/ffi.h.in (FFI_TYPE_COMPLEX): Add new FFI_TYPE_COMPLEX.
	(FFI_TYPE_LAST): Bump.
	(ffi_type_complex_float): Add new ffi_type_....
	(ffi_type_complex_double): Ditto.
	(ffi_type_complex_longdouble): Ditto.

2014-07-22  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	* src/s390/ffitarget.h (FFI_TARGET_HAS_COMPLEX_TYPE): Define to provide
	FFI_TYPE_COMPLEX support.
	* src/s390/ffi.c (ffi_check_struct_type): Implement FFI_TYPE_COMPLEX
	(ffi_prep_args): Ditto.
	(ffi_prep_cif_machdep): Ditto.
	(ffi_closure_helper_SYSV): Ditto.
2014-09-20 06:24:41 -04:00
Anthony Green
4c5c4088aa Merge pull request #132 from nielsAD/master
Pascal and Register calling convention support on x86
2014-09-18 19:10:54 -04:00
Anthony Green
862f53de04 Merge pull request #130 from frida/fix/darwin-aarch64-float-alignment
Fix alignment of FFI_TYPE_FLOAT for Apple's ARM64 ABI
2014-09-18 19:06:08 -04:00
Anthony Green
5df384077f Merge pull request #129 from frida/fix/darwin-aarch64-cif-prep
Fix non-variadic CIF initialization for Apple/ARM64
2014-09-18 19:05:35 -04:00
Anthony Green
7b7a5284de Merge pull request #124 from knuesel/master
Fix issue with builddir when calling configure with absolute path
2014-09-18 18:28:05 -04:00
Anthony Green
4cd5e84012 Merge pull request #123 from ehsan/clang-cl
Add support for building with clang-cl
2014-09-18 18:27:15 -04:00
nielsAD
5d6340ef2c Determine whether register arguments (THISCALL/FASTCALL/REGISTER) are really passed via register to closures. Use stack if not. 2014-08-25 17:42:07 +02:00
nielsAD
6e346487b8 Fixed THISCALL/FASTCALL closures and added basic support for PASCAL/REGISTER closures. 2014-08-25 12:23:29 +02:00
nielsAD
098dca6b31 Support for calling functions with PASCAL and REGISTER calling conventions on x86 Windows/Linux.
Also changed indentation to be more consistent throughout the (adjusted) files.
2014-08-24 14:29:38 +02:00
Ehsan Akhgari
08853e32fb Enable forcing the usage of the static CRT in libffi's msvc wrapper
This is required for AddressSanitizer builds with clang-cl.
2014-07-31 20:35:49 -04:00
Ole André Vadla Ravnås
aebf2c3023 Fix alignment of FFI_TYPE_FLOAT for Apple's ARM64 ABI 2014-07-26 00:17:47 +02:00
Ole André Vadla Ravnås
0f4e09d27d Fix non-variadic CIF initialization for Apple/ARM64
Turns out `aarch64_nfixedargs` wasn't initialized in the non-variadic
case, resulting in undefined behavior when allocating arguments.
2014-07-26 00:17:07 +02:00
Jeremie Knuesel
6172a995e1 Fix issue with builddir when calling configure with absolute path 2014-06-25 12:36:20 +02:00
Ehsan Akhgari
fb25cd08ed Add support for building with clang-cl 2014-06-12 20:42:18 -04:00
Anthony Green
1cee07be47 Remove compiler warning 2014-06-12 06:30:59 -04:00
Samuli Suominen
ad0d1d239a Fix paths in libffi.pc.in 2014-06-12 06:30:21 -04:00
Anthony Green
df31a85103 Merge pull request #122 from rvandermeulen/1014976
Don't make --enable-debug imply using the debug CRT in libffi
2014-06-06 08:24:35 -04:00
Mike Hommey
360aa8ca1e Bug 1014976 - Don't make --enable-debug imply using the debug CRT in libffi. 2014-06-02 09:21:10 -04:00
Anthony Green
69289c10b0 Prepare for libffi 3.1.1 2014-05-31 08:54:08 -04:00
Samuli Suominen
978c954015 Add missing GNU stack markings in win32.S 2014-05-31 08:53:10 -04:00
Ryan Hill
cbc5a3c020 Fix typo 2014-05-31 08:26:34 -04:00
Anthony Green
9d8e3018ac Update current version. 2014-05-24 23:28:42 -04:00
Anthony Green
18d56cca5a Increment libtool version number 2014-05-19 18:05:33 -04:00
Anthony Green
629f1029c4 Merge pull request #120 from l0kod/tmpfile
Create temporary file with O_TMPFILE and O_CLOEXEC when available
2014-05-19 18:04:28 -04:00
Mickaël Salaün
c1166d4f65 closures: Check for mkostemp(3) 2014-05-19 23:11:33 +02:00
Mickaël Salaün
8daeed9570 closures: Create temporary file with O_TMPFILE and O_CLOEXEC when available
The open_temp_exec_file_dir function can create a temporary file without
file system accessible link. If the O_TMPFILE flag is not defined (old
Linux kernel or libc) the behavior is unchanged.

The open_temp_exec_file_name function now need a new argument "flags"
(like O_CLOEXEC) used for temporary file creation.

The O_TMPFILE flag allow temporary file creation without race condition.
This feature/fix prevent another process to access the (future)
executable file from the file system.

The O_CLOEXEC flag automatically close the temporary file for any
execve. This avoid transmitting (executable) file descriptor to a child
process.
2014-05-19 23:11:33 +02:00
Anthony Green
0403f332b1 Update date. Annoucing 3.1 today. 2014-05-19 09:41:32 -04:00
Anthony Green
94ac0c168e Increment libtool library revision number 2014-05-19 09:37:21 -04:00
Anthony Green
57465744b6 Update to version 3.1 2014-05-11 10:30:22 -04:00
Anthony Green
0c2251a42d Support versions of git older than 1.8.5 2014-05-11 10:22:30 -04:00
Anthony Green
70c303cb88 Fix testsuite for GCC 4.9.0 2014-05-11 09:56:40 -04:00
Magnus Granberg
52b3457093 Check /proc/self/status for PaX status. 2014-05-11 09:55:28 -04:00
Dominik Vogt
7ba4c5d72a Use to get correct dir 2014-05-11 09:52:47 -04:00
Anthony Green
31e0d4ecff Merge pull request #119 from joshtriplett/fastcall-fastball
src/x86/win32.S: Define ffi_closure_FASTCALL in the MASM section, too
2014-04-23 19:24:47 -04:00
Josh Triplett
99909eb618 src/x86/win32.S: Define ffi_closure_FASTCALL in the MASM section, too 2014-04-22 21:17:52 -07:00
Anthony Green
1c0e9a7297 Merge pull request #101 from joshtriplett/fastcall-closures
Support closures for fastcall
2014-04-21 12:41:56 -04:00
Josh Triplett
d36952273d Support fastcall closures
libffi on 32-bit x86 now supports closures for all supported ABIs.
Thus, rewrite the last remaining duplicated-by-ABI test (closure_stdcall
and closure_thiscall) to use the generic ABI_NUM/ABI_ATTR mechanism.
2014-04-20 17:08:37 -07:00
Anthony Green
93a24f216b Merge pull request #80 from ueno/devel
Fix typo in doc
2014-04-12 19:38:07 -04:00
Anthony Green
dd11a04061 Merge pull request #86 from joshtriplett/testsuite-CC-CXX
testsuite ignores CC parameter supplied to configure or make
2014-04-12 19:37:21 -04:00
Anthony Green
8fa2812355 Merge pull request #116 from frida/fix/darwin-aarch64-variadic
Fix handling of variadic calls on Darwin/AArch64
2014-04-12 19:32:08 -04:00
Anthony Green
8a58e6b780 Merge pull request #115 from frida/fix/darwin-aarch64-alignment
Fix alignment of AArch64 assembler functions
2014-04-12 19:30:18 -04:00
Anthony Green
30b77c56f9 Merge pull request #117 from frida/fix/windows-regression
Fix Windows regression
2014-04-12 19:29:13 -04:00
Ole André Vadla Ravnås
3e2b84d295 Fix Windows regression
Introduced by b5fed60194.
2014-04-12 01:06:09 +02:00
Ole André Vadla Ravnås
419503f409 Fix handling of variadic calls on Darwin/AArch64 2014-04-06 20:59:25 +02:00
Ole André Vadla Ravnås
a539f7ffd6 Fix alignment of AArch64 assembler functions 2014-04-06 20:57:32 +02:00
Anthony Green
dc33cb3c99 Merge pull request #114 from joshtriplett/bounce-on-a-tiny-trampoline
Fix ABI on 32-bit non-Windows x86: go back to trampoline size 10
2014-04-05 23:41:22 -04:00
Josh Triplett
b5fed60194 Fix ABI on 32-bit non-Windows x86: go back to trampoline size 10
The trampoline size is part of the ABI, so it cannot change.  Move the
logic from the stdcall and thiscall trampolines to the functions they
call, to reduce them both to 10 bytes.

This drops the previously added support for raw THISCALL closures on
non-Windows.  (Non-raw THISCALL closures still work.)
2014-04-05 17:33:42 -07:00