This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [Gcl-devel] Re: portable cdecl 'elliptic' function calls
- From: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- To: Mike Thomas <miketh at brisbane dot paradigmgeo dot com>
- Cc: Camm Maguire <camm at enhanced dot com>, gcc at gcc dot gnu dot org, axiom-developer at nongnu dot org, maxima at mail dot ma dot utexas dot edu, acl2 at lists dot cc dot utexas dot edu, gcl-devel at gnu dot org
- Date: Thu, 31 Jul 2003 23:52:52 +1000
- Subject: Re: [Gcl-devel] Re: portable cdecl 'elliptic' function calls
- References: <54vftj1xzl.fsf@intech19.enhanced.com> <MFEIIPBIPCKFPICNGIJNOENDDIAA.miketh@brisbane.paradigmgeo.com>
On 31-Jul-2003, Mike Thomas <miketh@brisbane.paradigmgeo.com> wrote:
> Fergus, did you use it [libffi] in the Cygwin port of Mercury?
No.
Camm Maguire <camm@enhanced.com> wrote:
> | Greetings, and thank you for this tip! I now think I see how to do
> | this in GCL, and would like to build in dependency on libffi. Is this
> | available on everyone's systems? I'm assuming its packaged at least
> | everywhere gcc is available. What about solaris, Mac OS X?
You should not assume that libffi is implemented everywhere that gcc is
available. The reason that libffi is included in the GCC distribution
is, I think, because it is used by the Java interpreter. That is a lot
less widely ported than the GNU C compiler, I would imagine.
The libffi implementation is by its nature not portable;
its implementation depends on the platform's calling convention.
However, the interface is portable, and by using libffi,
the work of implementing this interface for a bunch of different
calling conventions can be shared between all the different
projects that need this functionality.
The difficulty of porting libffi to a different OS will depend on
whether that OS uses the same calling convention as one that libffi
already supports. If so, as is the case with Cygwin, then it should
be very little work. If not, it might be a lot of work.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.