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

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sun Aug 21 13:35:34 UTC 2016


Hi Esteban,
I wanted to load Alien in Squeak.
It was not obvious which version should be loaded because there's no
instruction for squeak in the project page
http://www.squeaksource.com/Alien.html , nor in the wiki page, and the
ConfigurationOfAlien is obsolete.
In such context, I was just reporting my guess here.

2016-08-21 12:51 GMT+02:00 Esteban Lorenzano <estebanlm at gmail.com>:

>
>
> > On 21 Aug 2016, at 12:21, Nicolas Cellier <nicolas.cellier.aka.nice@
> gmail.com> wrote:
> >
> > 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.
>
> but Pharo contains Alien in his latest version… no need to load it. Why
> are you trying?
>
> For older Pharos (4.0 and older), you can always use
> “ConfigurationOfOldAlien”, but this is not maintained anymore.
>
> > 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/826e8d39/attachment-0001.htm


More information about the Vm-dev mailing list