This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: RFC: variadic closures in x86/x86_64
- From: Alan Modra <amodra at gmail dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, "Hogan, D. (GE Power & Water)" <D dot Hogan at ge dot com>, "libffi-discuss at sourceware dot org" <libffi-discuss at sourceware dot org>
- Date: Wed, 27 Nov 2013 00:57:23 +1030
- Subject: Re: RFC: variadic closures in x86/x86_64
- Authentication-results: sourceware.org; auth=none
- References: <F023C084BCC16446BDA5B664305741E8090811 at ALPMBAPA05 dot e2k dot ad dot ge dot com> <52931854 dot 6080007 at redhat dot com> <20131125093715 dot GU892 at tucnak dot redhat dot com> <5293221D dot 4010505 at redhat dot com>
On Mon, Nov 25, 2013 at 10:10:37AM +0000, Andrew Haley wrote:
> Sure, but we don't need a new libffi interface to do that. We need
> only to set %rax. And we can just do that anyway; it doesn't hurt.
>
> I must be missing something.
The claim to fame looks to be the ability to call variadic functions
without describing the arguments via ffi_prep_cif_var at the point of
call. Instead you do so in the function consuming the args. I'm not
sure what that gains you..
The patch suffers from the same flaw as my first attempt at adding
variadic argument support for PowerPC64 ELFv2, namely that you cannot
add fields to ffi_cif without breaking ABI compatibility.
Applications linked against an older version of libffi.so will supply
the old ffi_cif to a new shared library..
Oh, and gcc still contains the first attempt since no one has yet
approved an import from libffi to cure the problem.
--
Alan Modra
Australia Development Lab, IBM