[Vm-dev] Status of FFI/Alien for X64 Win64

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sun Aug 21 10:21:57 UTC 2016

here are my findings:

FFI works on Win64 X64 squeak.stack.spur IF AND ONLY IF compiled with clang.
gcc 4.9.3 omit to reserve 32-bytes space for saving the four parameters
passed by register, this might be a gcc bug.

Basic Alien tests work, but beware, use the unsplit Alien package from
Eliot which contains essential changes for X64.
The ConfigurationOfAlien for Pharo based on split packages does not have
these important changes and will crash the VM.

Callback does not work yet. We got an incorrect thunkp passed back in the
thunkEntry does not receive the correct value for thunkp.
I think the problem is located in FFICallbackThunk initializeX64. For Win64
ABI, caller has to reserve the 32bytes on top of stack for saving the
registers parameters.
So we are going to need initializeX64Win64, and a CallbackX64Win64 abi ^

That's my understanding so far...

This should not require VM changes, but only Alien image side changes.
1) I don't feel like generating the binary machine code for
2) I'm not even sure that it's possible in 64 bytes.

So, I will send the X64 Win64 squeak.stack.spur VM to Marcel and commit a
LLP64_v2 branch on github containing all the necessary source to generate

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160821/75a1ed14/attachment.htm

More information about the Vm-dev mailing list