This is the mail archive of the
mailing list for the Cygwin project.
- From: Ken Brown <kbrown at cornell dot edu>
- To: cygwin-apps at cygwin dot com
- Date: Wed, 18 Feb 2015 17:41:04 -0500
- Subject: Re: ffcall
- Authentication-results: sourceware.org; auth=none
- References: <54E4DEC2 dot 2060400 at cornell dot edu> <1424287689 dot 3460 dot 19 dot camel at cygwin dot com> <20150218200825 dot GB22849 at calimero dot vinschen dot de>
On 2/18/2015 3:08 PM, Corinna Vinschen wrote:
On Feb 18 13:28, Yaakov Selkowitz wrote:
On Wed, 2015-02-18 at 13:49 -0500, Ken Brown wrote:
I've been trying to adopt Reini's packages that have not yet been ported to
64-bit Cygwin and that have some connection to packages I already maintain. The
next one on my list is ffcall.
I'm guessing this is for clisp? (In Fedora, clisp is the only package
which BR: ffcall).
Unfortunately, the source has a lot of assembler code in it, so I will almost
certainly need help from someone well versed in x86_64 assembly language. And
the libffcall project appears to be dead upstream, so I'm not going to get help
Unless you can find a patch somewhere for Win64 support.
I have no idea how hard this will be. The code has been ported to x86_64 Linux,
so there's at least a starting point.
What is ffcall doing? What functions does it call?
I don't know much about it yet. Here's an overview:
ffcall - foreign function call libraries
This is a collection of four libraries which can be used to build
foreign function call interfaces in embedded interpreters.
The four packages are:
avcall - calling C functions with variable arguments
vacall - C functions accepting variable argument prototypes
trampoline - closures as first-class C functions
callback - closures with variable arguments as first-class C functions
(a reentrant combination of vacall and trampoline)
All except callback are written in assembler.
Help with basic x86_64 assembler is ok, I did it for Cygwin with help
from Kai Tietz.
The main difference to Linux you have to look out for is the different
calling convention and how the registers are used:
So the job is typically to rearrange the register usage and to
account for the only four registers used for the first arguments
to a function, rather than the 6 registers in the SYSV ABI.
I might give it a try at some point, but I'm not highly motivated unless someone
who really cares about clisp steps forward to help. I'll concentrate first on
seeing if I can get some 64-bit version of clisp built without ffcall.