Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Bronnikov <sergeyb@tarantool.org>,
	Evgeniy Temirgaleev <e.temirgaleev@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH luajit 0/5] Various FFI ABI calling conventions fixes
Date: Sat, 30 May 2026 19:04:04 +0300	[thread overview]
Message-ID: <20260530160409.4043089-1-skaplun@tarantool.org> (raw)

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


             reply	other threads:[~2026-05-30 16:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-30 16:04 Sergey Kaplun via Tarantool-patches [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260530160409.4043089-1-skaplun@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=e.temirgaleev@tarantool.org \
    --cc=sergeyb@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit 0/5] Various FFI ABI calling conventions fixes' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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