Anthony Green
a0bdc5250c
Fix typo
2014-11-11 09:43:01 -05:00
Anthony Green
6695983d2f
Add complex type support. Mostly broken right now
2014-09-20 07:44:37 -04:00
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
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
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
Samuli Suominen
978c954015
Add missing GNU stack markings in win32.S
2014-05-31 08:53:10 -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
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
Ole André Vadla Ravnås
3e2b84d295
Fix Windows regression
...
Introduced by b5fed60194 .
2014-04-12 01:06:09 +02: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
Anthony Green
afee53738a
Merge pull request #106 from joshtriplett/darwin-award
...
[3.1 blocker] Update OS X build system to include win32.S on 32-bit
2014-03-25 16:12:35 -04:00
Anthony Green
7d2478568e
Merge pull request #110 from joshtriplett/w64
...
Fix 64-bit Windows support
2014-03-25 16:12:17 -04:00
Josh Triplett
be50b87a49
Always use configure to detect whether global symbols need underscores
...
64-bit Windows already used this check; make it universal, and use it in
place of an ifdef on X86_WIN32, to handle non-Windows platforms that use
the underscore, such as Darwin.
2014-03-24 21:45:47 -07:00
Josh Triplett
56be47f876
Fix a warning on 64-bit Windows
...
When sizeof(size_t) != sizeof(unsigned), adding a size_t to cif->bytes
produces a "possible loss of data" warning. However, the size_t in
question refers to the size of a single parameter. Use a cast to avoid
the warning.
2014-03-24 21:24:53 -07:00
Josh Triplett
48a8eda74a
Avoid referencing undefined ABIs on 64-bit Windows builds
...
64-bit Windows does not have FFI_STDCALL, FFI_THISCALL, or FFI_FASTCALL.
2014-03-24 21:21:12 -07:00
Josh Triplett
f0f4138f90
win32.S: Add handling for position-independent code on Darwin
...
Newer versions of Darwin generate the necessary stub functions
automatically and just need a call instruction, but accomodating older
versions as well requires adding the stub.
2014-03-22 10:04:11 -07:00
Josh Triplett
ef5890ebaf
win32.S: Use shifting for multiplication rather than repeated addition
...
The jump table code added a register to itself twice to multiply by 4;
shift the register left by 2 instead.
2014-03-21 11:02:50 -07:00
Josh Triplett
4fca48901e
win32.S: Make the jump tables position-independent
...
Now that non-Windows platforms include win32.S, it needs to support
building as position-independent code. This fixes build failures on
target platforms that do not allow text relocations.
2014-03-21 11:00:41 -07:00
Josh Triplett
2087dcf736
win32.S: Make calls to ffi_closure_SYSV_inner position-independent
...
Now that non-Windows platforms include win32.S, it needs to support
building as position-independent code. This fixes one source of build
failures on target platforms that do not allow text relocations.
2014-03-21 10:57:06 -07:00
Josh Triplett
e1911f78df
Add support for stdcall, thiscall, and fastcall on non-Windows x86-32
...
Linux supports the stdcall calling convention, either via functions
explicitly declared with the stdcall attribute, or via code compiled
with -mrtd which effectively makes stdcall the default.
This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on
non-Windows x86-32 platforms, as non-default calling conventions.
2014-03-16 05:05:06 -07:00
Anthony Green
edf29c5169
Merge pull request #75 from joshtriplett/longdouble
...
Fix build error on x86 without distinct long double
2014-02-28 00:50:25 -05:00
Josh Triplett
3998d2604b
Fix build error on x86 without distinct long double
...
src/x86/ffi64.c: In function 'classify_argument':
src/x86/ffi64.c:205:5: error: duplicate case value
case FFI_TYPE_LONGDOUBLE:
^
src/x86/ffi64.c:202:5: error: previously used here
case FFI_TYPE_DOUBLE:
^
2014-02-17 11:20:33 -08:00
Zachary Waldowski
9da28b4427
Darwin/x86_64: Fix 64-bit type shortening warnings
2014-02-05 14:28:58 -05:00
Zachary Waldowski
1367534158
Darwin/i386: Inhibit Clang previous prototype warnings
2014-02-05 14:28:53 -05:00
Anthony Green
3dc3f32c35
Undo iOS ARM64 changes.
2013-12-05 16:23:25 -05:00
Zachary Waldowski
33c46ce568
Darwin/Mac: Fix 64/32 shortening warnings
2013-11-30 04:14:10 -05:00
Zachary Waldowski
16ba1b8002
Darwin: Silence Clang warnings.
2013-11-30 03:47:58 -05:00
Mark Kettenis
becd754434
Align the stack pointer to 16-bytes.
2013-11-06 06:43:49 -05:00
Konstantin Belousov
05c3109340
Mark executable as not requiring executable stack.
2013-11-06 06:40:58 -05:00
Vitaly Budovski
6aa15900ac
Don't use 16 byte aligned stack for WIN32
...
This fixes a crash when accessing __stdcall functions in Python ctypes.
2013-09-05 12:05:06 +10:00
Jens Timmerman
b8a91d81be
added include for xmmintrin.h
2013-07-02 10:57:37 +02:00
Alex Gaynor
ee18766b16
Fix for a crasher due to misaligned stack on x86-32.
...
Full information on reproduction (using Python's ctypes available here: http://bugs.python.org/issue17423 )
2013-03-14 15:00:33 -07:00
Anthony Green
fd07c9e404
Add cache flushing routine for sun compiler on sparc solaris 2.8
2013-02-07 18:00:36 -05:00
Anthony Green
6a79012942
Work around LLVM ABI problem on x86-64
2013-02-06 17:37:15 -05:00
Anthony Green
8bf987d4df
Fix for sunpro compiler on Solaris
2013-01-10 17:24:51 -05:00
Anthony Green
2d9b393975
Fix for closures with sunpro compiler
2013-01-09 21:14:54 -05:00
Anthony Green
35ddb69c2b
Only emit DWARF unwind info when building with GCC
2013-01-08 07:53:37 -05:00
Anthony Green
048d2f41c3
Rebase
2012-10-11 10:55:25 -04:00
Anthony Green
a044a56b1c
Linux/x32 libtool fix
2012-04-06 10:39:10 -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
Peter Rosin
3afaa9a34a
Fix return_uc.c test case on windows.
2012-04-03 07:40:31 -04:00
Peter Rosin
0a1ab12a8d
Various MSVC-related changes.
2012-03-30 08:14:08 -04:00
Anthony Green
7c5e60b5f4
Rebase on fixed GCC sources
2012-03-29 08:48:22 -04:00
Anthony Green
bd78c9c331
More cygwin fixes
2012-03-21 08:09:30 -04:00
Anthony Green
964c5b93f8
abi check fixes and Linux/x32 support
2012-03-03 14:46:20 -05:00
Anthony Green
8360bf1cd0
Ensure that users don't include ffitarget.h directly
2012-02-23 07:01:13 -05:00
Anthony Green
dee20f8e45
Rebased from gcc
2012-02-10 13:06:46 -05:00
Anthony Green
1ff9c604bb
Rebase from GCC
2012-02-01 16:34:30 -06:00