<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Well actually the assembler for PPC exists as I wrote it for Alien, but not the part that does the callbacks.&nbsp;<div><br><div>Although people *might* think PPC is dead, the &nbsp;United States of America's school systems are firmly entrenched in dead technology.</div><div>Something about funding...&nbsp;</div><div><br></div><div><div><div>On 2010-12-27, at 11:46 AM, Eliot Miranda wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Igor,<div><br></div><div>&nbsp;&nbsp; &nbsp;that's all legacy. &nbsp;The Cog sources require only ReentrantFFIPlugin (at least on x86). &nbsp;As far as other processors I've written ReentrantFFIPlugin to allow straight-forward porting to other platforms. &nbsp;I can consult if anyone is motivated to try and port to PowerPC, ARM etc. &nbsp;The essential idea is to use C's alloca to allocate the space for the outgoing arguments on the stack and hence do all the marshalling in C. &nbsp;Passing register arguments is done by explicitly passing the register args, leavign the rest to be passed on teh stack throguh the alloca'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't need to compile ppc* files, because<br>
Cog doesn'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's code generator don'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 &nbsp;FFI is broken for Mac+Cog.<br>
<br>
P.S. Eliot'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>
</blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">--</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">===========================================================================</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">John M. McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com">johnmci@smalltalkconsulting.com</a>&gt; &nbsp; Twitter: &nbsp;squeaker68882</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Corporate Smalltalk Consulting Ltd.&nbsp;&nbsp;<a href="http://www.smalltalkconsulting.com">http://www.smalltalkconsulting.com</a></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">===========================================================================</font></div><div><br></div></div></div></div></div></div></span></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br></div></div></body></html>