playing with threaded ffi as external plugin...

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

playing with threaded ffi as external plugin...

EstebanLM
 
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?

cheers,
Esteban
 
Reply | Threaded
Open this post in threaded view
|

Re: playing with threaded ffi as external plugin...

Igor Stasenko

On 24 March 2011 02:57, Esteban Lorenzano <[hidden email]> 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.
Reply | Threaded
Open this post in threaded view
|

Re: playing with threaded ffi as external plugin...

EstebanLM

stupid me...

thanks Igor

now it has 22/23 FFI tests in green :P

cheers,
Esteban

El 23/03/2011, a las 11:59p.m., Igor Stasenko escribió:

>
> On 24 March 2011 02:57, Esteban Lorenzano <[hidden email]> 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.

Reply | Threaded
Open this post in threaded view
|

Re: playing with threaded ffi as external plugin...

Eliot Miranda-2
 
Hi Esteban,

On Thu, Mar 24, 2011 at 5:19 AM, Esteban Lorenzano <[hidden email]> wrote:

stupid me...

thanks Igor

now it has 22/23 FFI tests in green :P

what's the failing test?
 

cheers,
Esteban

El 23/03/2011, a las 11:59p.m., Igor Stasenko escribió:

>
> On 24 March 2011 02:57, Esteban Lorenzano <[hidden email]> 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.


Reply | Threaded
Open this post in threaded view
|

Re: playing with threaded ffi as external plugin...

Igor Stasenko

On 24 March 2011 18:01, Eliot Miranda <[hidden email]> wrote:

>
> Hi Esteban,
>
> On Thu, Mar 24, 2011 at 5:19 AM, Esteban Lorenzano <[hidden email]> wrote:
>>
>> stupid me...
>>
>> thanks Igor
>>
>> now it has 22/23 FFI tests in green :P
>
> what's the failing test?
>
nothing related to FFI.
It fails because test using #makeStar, which is wiped out from Pharo :)

testBlitToAndFromExternalForm
        "Ensure that we can blit to/from all 4 permutatations of Form and
ExternalForm."
        | source external1 external2 destination |
        source := Form makeStar asFormOfDepth: 32.


>>
>> cheers,
>> Esteban
>>
>> El 23/03/2011, a las 11:59p.m., Igor Stasenko escribió:
>>
>> >
>> > On 24 March 2011 02:57, Esteban Lorenzano <[hidden email]> 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.
>>
>
>
>



--
Best regards,
Igor Stasenko AKA sig.