This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Libffi problem on darwin (MacOSX)
- From: Andreas Tobler <toa at pop dot agri dot ch>
- To: Dale Johannesen <dalej at apple dot com>
- Cc: Ronald Oussoren <oussoren at cistron dot nl>, gcc at gcc dot gnu dot org
- Date: Sat, 17 May 2003 07:52:13 +0200
- Subject: Re: Libffi problem on darwin (MacOSX)
- References: <EC43A080-87E3-11D7-BAEF-000393D76DAA@apple.com>
Dale Johannesen wrote:
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.
Hey great, people are using libffi on darwin-ppc. I guess this is born
on my camp. I'll have a look at, as soon as time allows here.
It is possible that I didn't finish the libffi regarding structures
since I didn't need it for libjava work. So, you could be right.
Thank you for the report.
Andreas