Hi Igor,<div><br></div><div>    that&#39;s all legacy.  The Cog sources require only ReentrantFFIPlugin (at least on x86).  As far as other processors I&#39;ve written ReentrantFFIPlugin to allow straight-forward porting to other platforms.  I can consult if anyone is motivated to try and port to PowerPC, ARM etc.  The essential idea is to use C&#39;s alloca to allocate the space for the outgoing arguments on the stack and hence do all the marshalling in C.  Passing register arguments is done by explicitly passing the register args, leavign the rest to be passed on teh stack throguh the alloca&#39;ed space.</div>
<div><br></div><div>In short, all that assembler support code is obsolete.<br><br></div><div>best</div><div>Eliot</div><div><br><div class="gmail_quote">On Mon, Dec 27, 2010 at 7:20 AM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Hi,<br>
I am trying to figure out, how to build FFI plugin on macs for cog vm.<br>
<br>
the platforms/Mac\ OS/plugins/SqueakFFIPrims contains following files:<br>
<br>
<br>
Info-SqueakFFIPlugin__Upgraded_.plist<br>
SqueakFFI.xcodeproj.zip<br>
SqueakFFIPrims.proj.xml<br>
ppc-darwin-Carbon-UI.c<br>
ppc-darwin-asm-MacIntel.S<br>
ppc-global.h<br>
resources<br>
sqMacFFI.s<br>
sqMacFFIPPC.c<br>
sqMacIntel-Win32.c<br>
x86-sysv-MacIntel.c<br>
x86-sysv-asm-MacIntel.S<br>
<br>
<br>
something tells me that i don&#39;t need to compile ppc* files, because<br>
Cog doesn&#39;t works on that arch anyways..<br>
so, i tried to use<br>
sqMacIntel-Win32.c<br>
<br>
and failed.. then tried to use<br>
<br>
x86-sysv-MacIntel.c<br>
<br>
and it fails to compile with same error(s):<br>
<br>
/platforms/Mac OS/plugins/SqueakFFIPrims/x86-sysv-MacIntel.c:127:<br>
error: ‘FFICallTypeCDecl’ undeclared (first use in this function)<br>
/platforms/Mac OS/plugins/SqueakFFIPrims/x86-sysv-MacIntel.c:128:<br>
error: ‘FFICallTypeApi’ undeclared (first use in this function)<br>
<br>
These constants are defined only in FFIConstants shared pool.. and<br>
somehow they should be made available to<br>
these .c files..<br>
But our beloved VMMaker&#39;s code generator don&#39;t generating headers<br>
which can be included by other .c files,<br>
and all class var constants are just printed inside a body of<br>
generated .c file , like SqueakFFIPrims.c<br>
which means that these constants should be defined externally manually<br>
somewhere.<br>
<br>
So, it seems like  FFI is broken for Mac+Cog.<br>
<br>
P.S. Eliot&#39;s default .xcodeproj for FFI plugin are not builds because<br>
its not including one of the files above, which making a build<br>
complete (otherwise you got undefined symbols).<br>
<br>
Please shed a light, if FFI for Mac + Cog were in working state at<br>
some day? Or i doing something completely wrong?<br>
<br>
Of course i can disable it from build and forget about it, since we<br>
have new stuff coming (of course if Santa decide that we were good<br>
boys),<br>
but still..<br>
<font color="#888888"><br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
</font></blockquote></div><br></div>