This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Libffi problem on darwin (MacOSX)
- From: Dale Johannesen <dalej at apple dot com>
- To: Ronald Oussoren <oussoren at cistron dot nl>
- Cc: Dale Johannesen <dalej at apple dot com>, gcc at gcc dot gnu dot org
- Date: Fri, 16 May 2003 14:18:22 -0700
- Subject: Re: Libffi problem on darwin (MacOSX)
On Friday, May 16, 2003, at 01:55 PM, Ronald Oussoren wrote:
We're using libffi closures in the Objective-C method tables to
forward calls from Objective-C to python. This is working fine for
basic calls, but gives wrong results when structs are passed. It looks
like a mismatch between the compiler and libffi:
ffi_closure_helper_DARWIN in libffi_darwin.c seems to assume that
structs are passed "by reference" (line 615), while the compiler
passes small structs entirely in registers (see assembly code emited
by the following C snippet):
I'm not familiar with libffi, but I can confirm that the compiler is
doing the
right thing, and it's the same thing it's always done. It looks like
ffi_prep_args
and ffi_prep_cif_machdep correctly understand that structs are passed
by value, so
this is just a bug in ffi_closure_helper_DARWIN.