[Vm-dev] Using FFI on MacOSX

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue Jul 20 20:22:31 UTC 2010


Its not obvious for a Mac newbie like me to get FFI running on MacOSX.
What I (re?) discovered is below. Please correct me if I'm wrong.

To vm maintainers : wouldn't it be a good idea to pass the flag ffiLoad to
ioLoadModule() instead of relying only on a single global variable whether
it is a plugin that is requested or not ?
This way we could have both secured/fast plugin loading and opened FFI (if
distributed in the bundle). Unless there are other reasons unknown of me...

Nicolas

-----------------------------------------------------
Ah, some news!
In order to track and debug the problem with FFI, I built a VM.
(uneasy because latest svn xcodeproj is not exactly configured for a one
click build...).

The problem is that most vm are configured to search for plugin only in
squeak bundle
(global variable gSqueakPluginsBuiltInOrLocalOnly in files sqMain.c and
sqMacUnixExternalPrims.c)
I guess this is to save time at startup (and batteries for iPhone...)
And also to get some more secure VM (can't load an invalid plugin from an
older squeak vm).

Unfortunately, no difference is made between loading a squeak plugin and
loading a FFI library...
There is a ffiLoad flag passed to findAndLoadModule() in sqNamedPrims.c
but not to subfunction ioLoadModule() in sqMacUnixExternalPrims.c... (a
mistake IMHO)
So this setting is preventing FFI to work.

What you should do is change this setting:
- select your squeak vm in the finder.
- Then choose a menu item like "display package content" (it's a guess, my
version is configured in french).
- Then edit the contents/info.plist with a property editor.
- Then uncheck the box corresponding to SqueakPluginsBuiltInOrLocalOnly and
save properties

Then FFI should be operational again...
(But Smallapack may well crash, at least that's what happens here...)

I think I will CC squeak-dev/vm-dev to check If I this is the expected
solution.

Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20100720/f77b8068/attachment-0001.htm


More information about the Vm-dev mailing list