aboutsummaryrefslogtreecommitdiffstats
path: root/src/x86
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary win32.S source file.Stephen Hines2020-08-051-1351/+0
| | | | | | Bug: http://b/162610242 Test: mmma external/libffi Change-Id: I9f1f980af1545a0de8f7897291b1c5206bf17b02
* Revert "Support building as shared library and remove win32.S"Stephen Hines2020-08-051-0/+1351
| | | | | | | | | | This reverts commit e19d12e6c863f084576006328570cfccf0c51e6a. Reason for revert: Broke x86 build Bug: http://b/162905794 Bug: http://b/162610242 Change-Id: I6a1373ad0cd269c1734176c202d0514d6efc1673
* Support building as shared library and remove win32.SStephen Hines2020-08-041-1351/+0
| | | | | | | | | | | It turns out that this win32.S file is not part of the upstream repository, and it thus has duplicate definitions (as libffi has evolved proper ones over time it seems). This allows libffi to also now build as a shared library as well, so I went ahead and enabled that as well. Bug: http://b/162610242 Test: mmma . (in external/libffi) Change-Id: Iee7ea2435817718b626edb8a0582f37c7eb7d110
* Fix mac buildsDan Willemsen2020-03-312-860/+0
| | | | | | | | | These files aren't upstream, and using the same files as linux at least builds (and seems to work so far...) Fixes: 152920678 Test: prebuilts/build-tools/build-prebuilt.sh on an aosp build-tools branch on mac Change-Id: I0bf4919df802fd3ee769accab95c3350789ca1f9
* Upgrade to upstream v3.3 and add METADATA.Elliott Hughes2020-03-3012-2155/+4313
|\ | | | | | | | | Change-Id: I6a61dabe01ca74452a73185ff0e78d9ac2b7812e Test: treehugger
| * Fix FFI_STDCALL ABI (#514)Andreas Schwab2019-10-261-8/+10
| | | | | | | | | | | | | | Even for a stdcall function, the stack alignment is still the responsibility of the caller. Remember the original, not stack-aligned argument size, but align when setting up a stack frame. In ffi_closure_inner, return the true argument size, so that ffi_[go_]closure_STDCALL doesn't adjust too much.
| * Add long double test (#492)zhanhb2019-10-091-0/+2
| | | | | | Required to fix build error on macos with gcc-9
| * fix x86/x64 MSVC build (#487)driver19982019-04-272-2/+2
| |
| * Cleanup symbol exports on darwin and add architecture preprocessor checks to ↵Jeremy Huddleston Sequoia2019-02-195-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * changes for win32 on windows (#468)Paul Monson2019-02-192-0/+1000
| |
| * Update FFI_HIDDEN() to use .private_extern on Apple platforms and use the ↵Jeremy Huddleston Sequoia2018-07-211-1/+1
| | | | | | | | | | | | | | | | macro where appropriate Fix issue #439 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
| * Add compact unwind for darwin/i386 (#440)Jeremy Huddleston Sequoia2018-06-252-2/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * x86: Add implementation of compact unwind for ffi_call_i386, et al. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org> * x86: Use __text as the section name to avoid deprecated section name warnings. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org> * darwin: Add missing regular,debug attributes for compact unwind sections Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
| * Mark sysv.S as SafeSEH compatible (#438)Shoaib Meenai2018-06-171-0/+9
| | | | | | | | | | | | | | | | It contains no exception handler, so we can just emit the special @feat.00 symbol to indicate that it's trivially SafeSEH compatible. SafeSEH only applies to x86 and not x86-64, hence its inclusion in the x86-specific block. See [1] for details. [1] https://msdn.microsoft.com/en-us/library/windows/desktop/ms680547(v=vs.85).aspx#the_.sxdata_section_
| * i386: Fix missing break; in case statement leading to incorrectly returned ↵Jeremy Huddleston Sequoia2018-06-172-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Handle FFI_GNUW64 on non-Windows systems (EFI)Anthony Green2018-05-091-7/+7
| |
| * Revert "Remove some symbol exports and cleanup newline warnings (#433)"Anthony Green2018-05-053-17/+0
| | | | | | | | This reverts commit a5a0f3cf36dfb4d64316414a872288c3170e6c1d.
| * Remove some symbol exports and cleanup newline warnings (#433)Jeremy Huddleston Sequoia2018-05-053-0/+17
| | | | | | | | | | | | | | | | | | | | * build: Ensure darwin generated sources end with a new line Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org> * build: Use .private_extern where missing to prevent exporting symbols that are not API Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
| * Re-enable msabi testing (#436)hjl-tools2018-05-021-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Revert "disable msabi testing for now" This reverts commit 7b7638eb0eac2adfa72f7ec9f254ba287c9947e2. * x86: Correct testing for 64-bit x86-64 Since passing -m32 to x86-64 compiler will generate i386 code, we need to check both __ILP32__ and __i386__ for 64-bit x86-64. * x86: Check __i386__ instead of i?86-*-* targets Since passing -m32 to x86-64 compiler will generate i386 code, we need to check __i386__ instead of i?86-*-* targets for i386 targets. * i386: Properly passing integer parameters in registers For thiscall and fastcall, if the paramter passed as 64-bit integer or struct, all following integer paramters will be passed on stack. * test: Add ABI_ATTR to callback_code Add ABI_ATTR to callback_code to properly test different ABIs.
| * Fix two "return" issues in x86/ffi64.c (#431)Tom Tromey2018-04-281-2/+8
| | | | | | | | | | | | | | | | | | | | | | Issue #70 pointed out that at least one compiler didn't like: return ffi_call_efi64(cif, fn, rvalue, avalue); ... where the return type is "void". This patch splits the statement into two. I also noticed that ffi_call_go here seems to do a double call. I suspect a "return" is missing here, so this patch adds it as well.
| * Add missing FFI_GNUW64 enumAnthony Green2018-03-181-0/+1
| |
| * Add FFI_GNUW64 ABI for GNU 80-bit long double supportAnthony Green2018-03-182-11/+37
| |
| * Fix x86 SysV closure in PIC modeOle André Vadla Ravnås2018-01-211-2/+2
| | | | | | | | | | | | | | 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.
| * Updating calls to ffi_closure_unix64_inner and ffi_closure_win64_inner to ↵jon2017-12-012-2/+2
| | | | | | | | 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)'
| * Merge pull request #323 from compnerd/x86-alloca-alignmentAnthony Green2017-10-251-1/+3
| |\ | | | | | | x86: align alloca to 16-byte boundary
| | * x86: align alloca to 16-byte boundarySaleem Abdulrasool2017-10-221-1/+3
| | | | | | | | | | | | | | | | | | 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.
| * | Merge pull request #379 from jlj/masterAnthony Green2017-10-251-3/+4
| |\ \ | | | | | | | | Xcode build improvements
| | * \ Merge branch 'master' based on ksjogo/libffiJean-Luc Jumpertz2017-10-231-3/+4
| | |\ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | 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
| | | * Fix macOS build target in Xcode project.Jean-Luc Jumpertz2017-09-041-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | - 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.
| * | | Skip WIN64/EFI64 support for x32H.J. Lu2017-10-251-0/+20
| |/ / | | | | | | | | | Since x32 doesn't support WIN64/EFI64, skip it if __ILP32__ is defined.
| * | Fix misaligned memory access in ffi_call_intFrancis Ricci2017-08-031-2/+2
| | |
| * | Prefix ALIGN macros with FFI_Gregory Pakosz2017-04-272-14/+14
| |/
| * Handle fastcall declaration differently for some Microsoft compilersAnthony Green2017-03-192-11/+18
| |
| * Modify configure.host to detect compilation with Microsoft Visual C++ and ↵Ramón García Fernández2017-01-081-0/+237
| | | | | | | | use assembly with Intel syntax in that case
| * Mark win64.S with GNU-stack noteRichard Henderson2016-06-051-0/+4
| |
| * [Darwin-x86, build] Fix up label prefixes, remove .purgemIain Sandoe2016-05-261-8/+8
| | | | | | | | | | Darwin uses a label prefix of _. cctools assembler will not accept .purgem as a directive.
| * Fix -Wsign-compare warnings in x86/ffi64.cBerker Peksag2016-05-181-4/+5
| | | | | | | | | | | | | | | | | | | | 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.
| * x86: Fix calling convention for ffi_closure_win64_innerRichard Henderson2016-04-292-8/+12
| | | | | | | | Also enable testing for the cross-abi calls.
| * x86: Copy fix for clang .org from unix64.SRichard Henderson2016-04-151-23/+28
| | | | | | | | Clang doesn't understand .org with symbolic operands.
| * Support the WIN64/EFI64 calling convention on all X86_64 platformsJosh Triplett2015-07-263-7/+43
| | | | | | | | | | | | | | | | | | | | | | 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.
| * src/x86/ffiw64.c: Don't assign a "char *" to an "unsigned char *"Josh Triplett2015-07-261-1/+1
| | | | | | | | | | | | 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.
| * src/x86/win64.S: Handle name mangling and PICJosh Triplett2015-07-263-31/+35
| | | | | | | | | | Move the macros from unix64.S into a shared header asmnames.h and use them in win64.S too.
| * src/x86/win64.S: Support compiling on non-WIN64 platformsJosh Triplett2015-07-261-19/+28
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * x86: Fix cygwin32 buildRichard Henderson2015-01-191-0/+2
| | | | | | | | The section syntax is just that little bit different.
| * x86: Solaris fixesRainer Orth2015-01-162-5/+5
| | | | | | | | | | | | | | | | | | * 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.
| * x86: Fix thinko in ffi_raw_callRichard Henderson2015-01-131-0/+4
| | | | | | | | | | Missed structure initialization for raw path. Apparently there are no tests for this outside gcc.
| * Merge pull request #165 from rth7680/pccAnthony Green2015-01-104-84/+124
| |\ | | | | | | Support PCC as producer and consumer
| | * x86: Avoid fastcall when building with pccRichard Henderson2015-01-053-39/+71
| | | | | | | | | | | | | | | | | | 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.
| | * x86: Load structure return address into eaxRichard Henderson2015-01-053-48/+56
| | |
| * | Merge pull request #164 from rth7680/darwinAnthony Green2015-01-105-1274/+889
| |\| | | | | | | Fix build on darwin
| | * x86: Reinstate hand-written unwind info for sysv.SRichard Henderson2015-01-051-82/+334
| | |