[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


Hi,
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
callbackContext...
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 ^
'X64Win64'...

That's my understanding so far...

This should not require VM changes, but only Alien image side changes.
However:
1) I don't feel like generating the binary machine code for
initializeX64Win64
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
it.

cheers
-------------- 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