src/x86


Log

Author Commit Date CI Message
Anthony Green 369ef49f 2018-03-18T12:53:42 Add missing FFI_GNUW64 enum
Anthony Green 43980dd1 2018-03-18T12:32:10 Add FFI_GNUW64 ABI for GNU 80-bit long double support
Anthony Green 9bc40d87 2018-03-18T12:32:10 Add FFI_GWIN64 ABI for GNU 80-bit long double support
Ole André Vadla Ravnås 28d3b61b 2018-01-20T23:56:17 Fix x86 SysV closure in PIC mode The assembly single-line comments swallowed up the remaining assembly code of the macros due to lack of line-endings. This is a regression introduced in b7f6d7a.
jon d15581c6 2017-12-01T00:34:30 Updating calls to ffi_closure_unix64_inner and ffi_closure_win64_inner to use PLT. Without this fix, statically linking libffi causes the linker error i.e. 'requires dynamic R_X86_64_PC32 reloc against ffi_closure_unix64_inner which may overflow at runtime; recompile with -fPIC)'
Anthony Green dc2ff5ba 2017-10-25T13:11:40 Merge pull request #323 from compnerd/x86-alloca-alignment x86: align alloca to 16-byte boundary
Anthony Green 927da716 2017-10-25T13:05:53 Merge pull request #379 from jlj/master Xcode build improvements
H.J. Lu 9d9d92b4 2017-10-25T04:59:31 Skip WIN64/EFI64 support for x32 Since x32 doesn't support WIN64/EFI64, skip it if __ILP32__ is defined.
Jean-Luc Jumpertz 181fc4cc 2017-10-23T15:02:29 Merge branch 'master' based on ksjogo/libffi Added a tvOS target in Xcode project. Misc Xcode project cleanup. Fix macOS build target in Xcode project. # Conflicts: # src/aarch64/ffi.c # src/x86/ffi64.c
Saleem Abdulrasool 79d1509c 2017-10-10T11:39:45 x86: align alloca to 16-byte boundary Align the stack allocation to a 16-byte boundary. This ensures that the stack parameters are 16-byte aligned which is needed for some instructions.
Jean-Luc Jumpertz a78da739 2017-09-04T15:55:34 Fix macOS build target in Xcode project. - Add missing files for desktop platforms in generate-darwin-source-and-headers.py, and in the Xcode project. - Add a static library target for macOS. - Fix "implicit conversion loses integer precision" warnings for iOS mad macOS targets.
Francis Ricci 9c12209d 2017-08-03T10:46:28 Fix misaligned memory access in ffi_call_int
Gregory Pakosz bd72848c 2017-04-27T13:20:36 Prefix ALIGN macros with FFI_
Anthony Green a94c999b 2017-03-19T07:36:07 Handle fastcall declaration differently for some Microsoft compilers
Ramón García Fernández 1e0d107b 2017-01-08T20:12:59 Modify configure.host to detect compilation with Microsoft Visual C++ and use assembly with Intel syntax in that case
Richard Henderson 794a54d4 2016-06-05T14:57:00 Mark win64.S with GNU-stack note
Iain Sandoe 92810b4b 2016-05-26T08:56:51 [Darwin-x86, build] Fix up label prefixes, remove .purgem Darwin uses a label prefix of _. cctools assembler will not accept .purgem as a directive.
Berker Peksag 4a677a42 2016-03-05T09:58:38 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.
Richard Henderson e5843a3a 2016-04-15T16:10:08 x86: Fix calling convention for ffi_closure_win64_inner Also enable testing for the cross-abi calls.
Richard Henderson d0675197 2016-03-07T12:14:22 x86: Copy fix for clang .org from unix64.S Clang doesn't understand .org with symbolic operands.
Josh Triplett 1f6b5a91 2015-07-26T16:27:34 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.
Josh Triplett 6de51f3e 2015-07-26T16:23:55 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.
Josh Triplett eaa59755 2015-07-26T17:17:16 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.
Josh Triplett c8e82d9f 2015-07-26T16:18:57 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.
Richard Henderson 3ac1610a 2015-01-19T20:48:40 x86: Fix cygwin32 build The section syntax is just that little bit different.
Rainer Orth f1560b7b 2015-01-16T11:31:37 x86: Solaris fixes * Solaris/x86 /bin/as doesn't support .org, so I've just disabled the uses in src/x86/{sysv, unix64}.S, as on Darwin. * Solaris/x86 needs to use EH_FRAME_FLAGS so manually and compiler generated .eh_frame sections match, otherwise libffi.so fails to link: * Solaris/x86 /bin/as has different COMDAT syntax; I've disabled it for the moment.
Richard Henderson f27c4e46 2015-01-13T07:22:07 x86: Fix thinko in ffi_raw_call Missed structure initialization for raw path. Apparently there are no tests for this outside gcc.
Anthony Green 1c61e73a 2015-01-10T09:23:30 Merge pull request #165 from rth7680/pcc Support PCC as producer and consumer
Anthony Green dd0b59a5 2015-01-10T09:22:55 Merge pull request #164 from rth7680/darwin Fix build on darwin
Anthony Green 9131039c 2015-01-10T09:22:42 Merge pull request #160 from nobu/msvc-no-complex x86: MSVC does not support Complex type
Richard Henderson 3fa5d70c 2015-01-05T13:03:06 x86: Avoid fastcall when building with pcc Apparently, PCC doesn't support the fastcall calling convention. Nor does it issue a warning or error for the attribute that it does not understand.
Richard Henderson a03d2310 2014-12-24T16:03:34 x86: Load structure return address into eax
Richard Henderson b7f6d7aa 2014-12-10T13:37:36 x86: Reinstate hand-written unwind info for sysv.S
Richard Henderson 6cedf81c 2014-12-10T09:43:58 x86: Expand FFI_GO_CLOSURE If we're going to have to hand-write unwind info for darwin, these macros make the job harder.
Iain Sandoe ae842a51 2014-11-25T11:43:40 x86: More Darwin unwind fixups EHFrame{N} IIRC is a special cue to ld64 that it should treat the unwind in the object as "special/legacy" .. [these days everything is .cfi_xxxx (except, cctools-as, as you noted)] .. without that much confusion arises with ld64's atom-isation of the eh_frame section. xxxx.eh labels are not needed for darwin ld64 >= 85.2.1 (i.e. darwin9, xcode 3.1.4) to all intents and purposes, that's all that matters now, since I think that anyone trying to build on 10.4/darwin8/xcode2.5 would have to use a later ld64 (from odcctools) for other reasons.
Richard Henderson 8fa3c9f2 2014-11-25T09:27:54 x86: Reinstate hand-written unwind info for unix64.S One more try to get default Darwin to work.
Richard Henderson 5f35e0ff 2014-11-24T16:26:50 x86: Avoid using gas local labels Which are unsupported by Darwin cctools as. Thankfully this doesn't uglify the source too much.
Richard Henderson ed1ca277 2014-11-24T13:02:03 x86: Remove use of .cfi_escape The unwind info isn't 100% correct at all points during the epilogue, and not annotating is just as incorrect as the annotation. This works better on systems that do not support DW_OP_call_frame_cfa.
Richard Henderson 1b12593d 2014-11-24T12:55:43 x86: Honor alignment of arguments Darwin aligns long-double to 16, and thus all of the long double tests were failing due to not honoring that. We ought to be able to devise a test case for GCC using __attribute__((aligned)) that would have failed too.
Richard Henderson 042b8daf 2014-11-24T11:24:02 x86: Use .balign not .align The Apple assembler defaults to power of two alignment, rather than byte alignment like everyone else. Force byte alignment by using the proper directive.
Richard Henderson 0172bc02 2014-11-24T10:42:02 x86: Disable .org for Darwin
Richard Henderson 9f112619 2014-11-22T20:02:43 x86: Best guess at update for Darwin
Nobuyoshi Nakada 7282d328 2014-12-22T17:14:40 x86: MSVC does not support Complex type
Nobuyoshi Nakada 5f8881a5 2014-12-22T17:08:08 x86: Fix void pointer arithmetic
Richard Henderson 2f652469 2014-12-11T14:16:00 x86: Handle void arguments as if an empty structure Since libffi currently doesn't allow empty structures, libgo currently maps them to ffi_type_void. Given that we'll abort on this case, handle it gracefully.
Richard Henderson 097ccfd6 2014-12-10T13:25:14 x86: Fix some unwind errors
Richard Henderson dea49e20 2014-11-14T13:05:14 x86: Fix typo in ffi_prep_go_closure Used the wrong register for THISCALL and FASTCALL.
Richard Henderson 0e303c06 2014-11-12T03:58:58 x86: Work around clang bugs http://llvm.org/bugs/show_bug.cgi?21500 http://llvm.org/bugs/show_bug.cgi?21501 http://llvm.org/bugs/show_bug.cgi?21515
Richard Henderson 2650f47f 2014-11-06T10:57:04 x86: Use win32 name mangling for fastcall functions
Richard Henderson f8c64e24 2014-11-05T17:04:29 x86: Add support for Go closures
Richard Henderson 198f469e 2014-11-05T16:34:41 x86: Add support for Complex
Richard Henderson b21ec1ce 2014-11-05T10:15:25 x86: Rewrite closures Move everything into sysv.S, removing win32.S and freebsd.S. Handle all abis with a single ffi_closure_inner function. Move complexity of the raw THISCALL trampoline into assembly instead of the trampoline itself. Only push the context for the REGISTER abi; let the rest receive it in a register.
Richard Henderson b9ac94f3 2014-11-01T15:10:34 x86: Rewrite ffi_call Decouple the assembly from FFI_TYPE_*. Merge prep_args with ffi_call, passing the frame and the stack to the assembly. Note that this patch isn't really standalone, as this breaks closures.
Richard Henderson 159d3788 2014-10-31T12:07:02 x86: Convert to gas generated unwind info
Richard Henderson e7b0056d 2014-10-30T13:57:39 x86: Force FFI_TYPE_LONGDOUBLE different from FFI_TYPE_DOUBLE There are few abis that set double = long double. Eliminate the conditional compilation and let this code simply be unused there.
Richard Henderson 4b2fad8f 2014-10-30T12:41:31 x86: Remove some conditional compilation Removal of ifdefs made possible to due to ffi_abi unification.
Richard Henderson ef762056 2014-10-30T12:13:31 x86: Tidy ffi_abi The x86_64 unix port only handles one ABI; don't define all of the other symbols. The UNIX64 symbol retains the same value. The i386 ports ought to have the same symbols, even if we can't yet unify the values without incrementing the libffi soname.
Richard Henderson 610c90bf 2014-10-28T11:21:50 x86_64: Add support for complex types
Richard Henderson 32c56831 2014-10-28T11:17:35 x86_64: Decouple return types from FFI_TYPE constants We can better support structure returns, and as prep for complex types.
Richard Henderson 2e9dc165 2014-10-27T13:41:39 x86_64: Fixups for x32
Richard Henderson ebd82769 2014-10-23T23:57:06 win64: Remove support from ffi.c
Richard Henderson 99db4d42 2014-10-23T14:12:18 win64: Rewrite It's way too different from the 32-bit ABIs with which it is currently associated. As seen from all of the existing XFAILs.
Richard Henderson 6b62fb4a 2014-10-17T11:11:58 x86-64: Support go closures Dumps all of the hand-coded unwind info for gas generated. Move jump table data into .rodata. Adjust ffi_call_unix64 to load the static chain. Split out sse portions of ffi_closure_unix64 to ffi_closure_unix64_sse rather than test cif->flags at runtime.
Anthony Green a0bdc525 2014-11-11T09:43:01 Fix typo
Anthony Green 6695983d 2014-09-20T07:44:37 Add complex type support. Mostly broken right now
Bernd Edlinger bfcbf329 2014-09-20T06:51:45 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.
Dominik Vogt 6e8a4460 2014-09-20T06:21:19 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.
nielsAD 5d6340ef 2014-08-25T17:29:44 Determine whether register arguments (THISCALL/FASTCALL/REGISTER) are really passed via register to closures. Use stack if not.
nielsAD 6e346487 2014-08-25T12:23:29 Fixed THISCALL/FASTCALL closures and added basic support for PASCAL/REGISTER closures.
nielsAD 098dca6b 2014-08-23T00:18:47 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.
Samuli Suominen 978c9540 2014-05-31T08:53:10 Add missing GNU stack markings in win32.S
Josh Triplett 99909eb6 2014-04-22T21:17:52 src/x86/win32.S: Define ffi_closure_FASTCALL in the MASM section, too
Josh Triplett d3695227 2014-04-20T12:03:25 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.
Ole André Vadla Ravnås 3e2b84d2 2014-04-12T01:04:04 Fix Windows regression Introduced by b5fed601948237037513a9b7f967c8fc6c9ff1f6.
Josh Triplett b5fed601 2014-04-05T17:33:42 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.)
Anthony Green afee5373 2014-03-25T16:12:35 Merge pull request #106 from joshtriplett/darwin-award [3.1 blocker] Update OS X build system to include win32.S on 32-bit
Anthony Green 7d247856 2014-03-25T16:12:17 Merge pull request #110 from joshtriplett/w64 Fix 64-bit Windows support
Josh Triplett be50b87a 2014-03-24T21:44:13 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.
Josh Triplett 56be47f8 2014-03-24T21:24:53 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.
Josh Triplett 48a8eda7 2014-03-24T21:21:12 Avoid referencing undefined ABIs on 64-bit Windows builds 64-bit Windows does not have FFI_STDCALL, FFI_THISCALL, or FFI_FASTCALL.
Josh Triplett f0f4138f 2014-03-22T10:00:53 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.
Josh Triplett ef5890eb 2014-03-21T11:01:39 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.
Josh Triplett 4fca4890 2014-03-21T11:00:41 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.
Josh Triplett 2087dcf7 2014-03-21T10:57:06 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.
Josh Triplett e1911f78 2014-03-16T03:25:53 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.
Anthony Green edf29c51 2014-02-28T00:50:25 Merge pull request #75 from joshtriplett/longdouble Fix build error on x86 without distinct long double
Josh Triplett 3998d260 2014-02-17T11:20:33 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: ^
Zachary Waldowski 9da28b44 2013-12-30T16:23:21 Darwin/x86_64: Fix 64-bit type shortening warnings
Zachary Waldowski 13675341 2014-01-09T13:42:08 Darwin/i386: Inhibit Clang previous prototype warnings
Anthony Green 3dc3f32c 2013-12-05T16:23:25 Undo iOS ARM64 changes.
Zachary Waldowski 33c46ce5 2013-11-30T04:13:42 Darwin/Mac: Fix 64/32 shortening warnings
Zachary Waldowski 16ba1b80 2012-04-11T23:26:04 Darwin: Silence Clang warnings.
Mark Kettenis becd7544 2013-11-06T06:43:49 Align the stack pointer to 16-bytes.
Konstantin Belousov 05c31093 2013-11-06T06:40:58 Mark executable as not requiring executable stack.
Vitaly Budovski 6aa15900 2013-09-05T12:05:06 Don't use 16 byte aligned stack for WIN32 This fixes a crash when accessing __stdcall functions in Python ctypes.
Jens Timmerman b8a91d81 2013-07-02T10:57:37 added include for xmmintrin.h
Alex Gaynor ee18766b 2013-03-14T15:00:33 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)
Anthony Green fd07c9e4 2013-02-07T18:00:36 Add cache flushing routine for sun compiler on sparc solaris 2.8
Anthony Green 6a790129 2013-02-06T17:37:15 Work around LLVM ABI problem on x86-64
Anthony Green 8bf987d4 2013-01-10T17:24:51 Fix for sunpro compiler on Solaris