[Vm-dev] playing with threaded ffi as external plugin...

Igor Stasenko siguctua at gmail.com
Thu Mar 24 02:59:52 UTC 2011


On 24 March 2011 02:57, Esteban Lorenzano <estebanlm at gmail.com> wrote:
>
> Hi,
> I found that ThreadedIA32FFIPlugin wasn't being loaded at all... so I started debugging until I saw some details (btw... xcode4 debugger is even worst than before):
> I changed this declaration:
> #ifdef SQUEAK_BUILTIN_PLUGIN
> #undef EXPORT
> // was #undef EXPORT(returnType) but screws NorCroft cc
> #define EXPORT(returnType) static returnType
> #endif
> with:
> #ifndef SQUEAK_BUILTIN_PLUGIN
> ...
> #endif
>
> also I changed:
> #ifdef SQUEAK_BUILTIN_PLUGIN
> extern
> #endif
> with:
> #ifndef SQUEAK_BUILTIN_PLUGIN
> extern
> #endif
> and then everything start working.

> I still does not know how to test the threads or callbacks for FFI, but a simple "MacOSShell new system: 'ls'." was working fine :)
> but here is my concern: the change I made looks like a heavy change... what I did is correct? should I change VMMaker code to generate plugins with my change?


An external plugins should be built without -DSQUEAK_BUILTIN_PLUGIN.
See in
CMakePluginGenerator>>generate
   ...
	internal ifTrue: [
		self puts: 'add_definitions(-DSQUEAK_BUILTIN_PLUGIN)'].
   ...

So, check the generated <root>/build/SqueakFFIPrims/CMakeLists.txt

if you build plugin as external, it should not include this flag.

And if you build it as internal, then of course it won't work :)
There are an associated code which assuming that you building dynamic library
 (see  platforms/Cross/plugins/SqueakFFIPrims/sqFFITestFuncs.c)


> cheers,
> Esteban
>
>



-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list