Using FFI on MacOSX

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using FFI on MacOSX

Nicolas Cellier
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

Reply | Threaded
Open this post in threaded view
|

Re: Using FFI on MacOSX

Sean P. DeNigris
Administrator
See http://forum.world.st/squeak-dev-Alien-Squeak-FFI-issues-on-Snow-Leopard-td85608.html#a2218785\
Same issue?

I agree that this should be explained somewhere where it will be found by new users.

Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Using FFI on MacOSX

Nicolas Cellier
Ah yes, until we fix it, this will bite again.
Anyway, changing an obscure flag in an obfuscated place can't be a long term solution.
Is it Smalltalk or what?

2010/7/21 Sean P. DeNigris <[hidden email]>

See
http://forum.world.st/squeak-dev-Alien-Squeak-FFI-issues-on-Snow-Leopard-td85608.html#a2218785\
Same issue?

I agree that this should be explained somewhere where it will be found by
new users.

Sean
--
View this message in context: http://forum.world.st/Using-FFI-on-MacOSX-tp2296186p2297608.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.