[Vm-dev] Confused by FFI at Mac & Cog
eliot.miranda at gmail.com
Mon Dec 27 19:46:56 UTC 2010
that's all legacy. The Cog sources require only ReentrantFFIPlugin (at
least on x86). As far as other processors I'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'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'ed space.
In short, all that assembler support code is obsolete.
On Mon, Dec 27, 2010 at 7:20 AM, Igor Stasenko <siguctua at gmail.com> wrote:
> I am trying to figure out, how to build FFI plugin on macs for cog vm.
> the platforms/Mac\ OS/plugins/SqueakFFIPrims contains following files:
> something tells me that i don't need to compile ppc* files, because
> Cog doesn't works on that arch anyways..
> so, i tried to use
> and failed.. then tried to use
> and it fails to compile with same error(s):
> /platforms/Mac OS/plugins/SqueakFFIPrims/x86-sysv-MacIntel.c:127:
> error: ‘FFICallTypeCDecl’ undeclared (first use in this function)
> /platforms/Mac OS/plugins/SqueakFFIPrims/x86-sysv-MacIntel.c:128:
> error: ‘FFICallTypeApi’ undeclared (first use in this function)
> These constants are defined only in FFIConstants shared pool.. and
> somehow they should be made available to
> these .c files..
> But our beloved VMMaker's code generator don't generating headers
> which can be included by other .c files,
> and all class var constants are just printed inside a body of
> generated .c file , like SqueakFFIPrims.c
> which means that these constants should be defined externally manually
> So, it seems like FFI is broken for Mac+Cog.
> P.S. Eliot's default .xcodeproj for FFI plugin are not builds because
> its not including one of the files above, which making a build
> complete (otherwise you got undefined symbols).
> Please shed a light, if FFI for Mac + Cog were in working state at
> some day? Or i doing something completely wrong?
> Of course i can disable it from build and forget about it, since we
> have new stuff coming (of course if Santa decide that we were good
> but still..
> Best regards,
> Igor Stasenko AKA sig.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vm-dev