FFI will fail when calling C function with varadic parameters on apple silicon machine
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.4k
- Forks
- 252
- Avg merge
- 7d 11h
- Merged PRs (30d)
- 3
Description
On my macpro book with m1 processor (arm64), the FFI call to printf will output random garbage characters for all varadic args.
local ffi=require'ffi'
ffi.cdef[[
int printf(const char *fmt,...);
]]
ffi.C.printf("hello %s\n","world")
Apple has mentioned the ABI difference here. I think that's the reason. Is it complicate to support this new ABI in LuaJIT?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by reproducing the LuaJIT FFI printf example on Apple silicon and read Apple's linked arm64 ABI notes; done means variadic printf arguments render correctly rather than producing garbage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, lua
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100