On 1 Mar 2011, at 13:10, Mathieu Suen wrote:

> Hi
> 
> Thanks for you help.
> Now I can successfully link against gnustep libs.
> 
> There is still on issue. On OSX there is the obc_msgSend function that is 
> missing in the gnustep-base runtime.
> I guess gnustep is using the gcc libobjc in other to send a message to an 
> object.

Correct, this function does not exist in the GNU implementation.  Instead, you 
should use objc_msg_lookup() (GCC runtime) or objc_msg_lookup_sender() (GNUstep 
runtime).  These functions return a function pointer, which you should then 
call.

You may want to have a look at the code in the LanguageKit interpreter.  This 
handles message sending in a way that works on both OS X and GNUstep.  

This two-step call is required because it is not possible to implement 
objc_msgSend() in C - it would have to be implemented in assembly for each 
platform and for each set of calling conventions.  Note that your code is 
probably wrong if you are using objc_msgSend() everywhere!  You should be using 
objc_msgSend_sret() or objc_msgSend_fpret() in various cases, and you should be 
calling objc_msgSend() with non-standard calling conventions in some other 
cases.  Constructing the call frame used for objc_msgSend() is not a trivial 
exercise.

David
_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss

Répondre à