From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22801 invoked by alias); 18 Feb 2015 22:41:10 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 22790 invoked by uid 89); 18 Feb 2015 22:41:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: limerock02.mail.cornell.edu Received: from limerock02.mail.cornell.edu (HELO limerock02.mail.cornell.edu) (128.84.13.242) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Feb 2015 22:41:08 +0000 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock02.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id t1IMf6i9012063 for ; Wed, 18 Feb 2015 17:41:06 -0500 Received: from [192.168.1.4] (cpe-67-249-176-138.twcny.res.rr.com [67.249.176.138]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id t1IMf5sN008733 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Wed, 18 Feb 2015 17:41:06 -0500 Message-ID: <54E51500.8070200@cornell.edu> Date: Wed, 18 Feb 2015 22:41:00 -0000 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: cygwin-apps@cygwin.com Subject: Re: ffcall References: <54E4DEC2.2060400@cornell.edu> <1424287689.3460.19.camel@cygwin.com> <20150218200825.GB22849@calimero.vinschen.de> In-Reply-To: <20150218200825.GB22849@calimero.vinschen.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00251.txt.bz2 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 >>> there. >> >> 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: > http://en.wikipedia.org/wiki/X86_calling_conventions#Microsoft_x64_calling_convention > > 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. Ken