Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH luajit 0/5] Various FFI ABI calling conventions fixes
@ 2026-05-30 16:04 Sergey Kaplun via Tarantool-patches
  2026-05-30 16:04 ` [Tarantool-patches] [PATCH luajit 1/5] FFI: Unify stack setup for C calls in interpreter Sergey Kaplun via Tarantool-patches
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2026-05-30 16:04 UTC (permalink / raw)
  To: Sergey Bronnikov, Evgeniy Temirgaleev; +Cc: tarantool-patches

This patch set provides the various improvements to the FFI interface.
The first two patches add support for OSX calling conventions for
varargs functions and fix the JIT-compiled code for varargs functions on
macOS arm64. The next patch adds handling for HFA structures with an
array in them. The fourth patch adds many fixups for x64/arm64 calling
conventions. The last one patch is a follow-up to it to fix the macOS
regression introduced in the fourth patch.

Branch: https://github.com/tarantool/luajit/tree/skaplun/ffi-c-call-conventions

Related issues:
* https://github.com/tarantool/tarantool/issues/12480
* https://github.com/tarantool/tarantool/issues/6097
* https://github.com/LuaJIT/LuaJIT/issues/205
* https://github.com/LuaJIT/LuaJIT/issues/1357
* https://github.com/LuaJIT/LuaJIT/issues/1455

Mike Pall (5):
  FFI: Unify stack setup for C calls in interpreter.
  FFI/ARM64/OSX: Handle non-standard OSX C calling conventions.
  ARM64: Fix pass-by-value struct calling conventions.
  FFI: Various ABI and calling convention fixes.
  FFI/MacOS: Fix calling convention for enums.

 src/lj_asm_arm64.h                            |  75 +-
 src/lj_ccall.c                                | 133 ++--
 src/lj_ccall.h                                |  13 +-
 src/lj_cparse.c                               |   9 +-
 src/lj_crecord.c                              |  27 +
 src/lj_ctype.h                                |   2 +-
 src/vm_arm.dasc                               |   8 +-
 src/vm_arm64.dasc                             |   8 +-
 src/vm_mips.dasc                              |   1 -
 src/vm_mips64.dasc                            |   1 -
 src/vm_ppc.dasc                               |   3 +-
 src/vm_x64.dasc                               |   8 +-
 src/vm_x86.dasc                               |  22 +-
 .../ffi-call-empty-struct.test.lua            |  47 ++
 test/tarantool-tests/ffi-ccall/CMakeLists.txt |  13 +-
 test/tarantool-tests/ffi-ccall/libfficcall.c  | 650 ++++++++++++++++++
 .../ffi-vector-arguments.test.lua             |  62 ++
 .../gh-6097-arm64-osx-ffi-vararg.test.lua     |  43 ++
 ...57-arm64-struct-array-pass-by-val.test.lua |  23 +
 .../lj-1455-arm64-ffi-ccall-hfa.test.lua      |  82 +++
 .../lj-1455-bitfield0-a16.test.lua            |  27 +
 .../lj-1455-ffi-conventions.test.lua          | 441 ++++++++++++
 .../lj-205-arm64-osx-ffi-enum-arg.test.lua    |  63 ++
 .../lj-205-arm64-osx-ffi-small-arg.test.lua   |  29 +
 24 files changed, 1703 insertions(+), 87 deletions(-)
 create mode 100644 test/tarantool-tests/ffi-call-empty-struct.test.lua
 create mode 100644 test/tarantool-tests/ffi-vector-arguments.test.lua
 create mode 100644 test/tarantool-tests/gh-6097-arm64-osx-ffi-vararg.test.lua
 create mode 100644 test/tarantool-tests/lj-1357-arm64-struct-array-pass-by-val.test.lua
 create mode 100644 test/tarantool-tests/lj-1455-arm64-ffi-ccall-hfa.test.lua
 create mode 100644 test/tarantool-tests/lj-1455-bitfield0-a16.test.lua
 create mode 100644 test/tarantool-tests/lj-1455-ffi-conventions.test.lua
 create mode 100644 test/tarantool-tests/lj-205-arm64-osx-ffi-enum-arg.test.lua
 create mode 100644 test/tarantool-tests/lj-205-arm64-osx-ffi-small-arg.test.lua

-- 
2.54.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-06-01 13:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-30 16:04 [Tarantool-patches] [PATCH luajit 0/5] Various FFI ABI calling conventions fixes Sergey Kaplun via Tarantool-patches
2026-05-30 16:04 ` [Tarantool-patches] [PATCH luajit 1/5] FFI: Unify stack setup for C calls in interpreter Sergey Kaplun via Tarantool-patches
2026-05-30 16:04 ` [Tarantool-patches] [PATCH luajit 2/5] FFI/ARM64/OSX: Handle non-standard OSX C calling conventions Sergey Kaplun via Tarantool-patches
2026-06-01 11:40   ` Sergey Bronnikov via Tarantool-patches
2026-05-30 16:04 ` [Tarantool-patches] [PATCH luajit 3/5] ARM64: Fix pass-by-value struct " Sergey Kaplun via Tarantool-patches
2026-06-01 12:27   ` Sergey Bronnikov via Tarantool-patches
2026-05-30 16:04 ` [Tarantool-patches] [PATCH luajit 4/5] FFI: Various ABI and calling convention fixes Sergey Kaplun via Tarantool-patches
2026-06-01 13:02   ` Sergey Bronnikov via Tarantool-patches
2026-05-30 16:04 ` [Tarantool-patches] [PATCH luajit 5/5] FFI/MacOS: Fix calling convention for enums Sergey Kaplun via Tarantool-patches
2026-06-01 13:07   ` Sergey Bronnikov via Tarantool-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox