This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Libffi problem on darwin (MacOSX)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]