Teaching libffi to stdcall

Anthony Green green@redhat.com
Fri Nov 8 06:09:00 GMT 2002


On Thu, 2002-11-07 at 21:43, Ranjit Mathew wrote:
> All right - I took a shot at it and it seems to be working
> in the libffi in GCJ 3.2 - I shall post a patch as soon as
> I migrate it to GCJ 3.3. The smoke tests pass on Linux
> as well as Win32 (see note #5 below though).

That's great!

> 1. For the sake of completeness, we should also teach libffi
>     to call fastcall functions. fastcall functions are like
>     stdcall except that the first two arguments are passed in
>     ECX and EDX respectively.

If you just want to put a comment in the source about it, that would be
fine.  We don't need fastcall for JNI compatability, do we?

> 2. In x86/sysv.S, I could not update the DW2 CIEs and FDEs as
>     I have no clue on how to go about doing it.

Post your patch and I'll see if I can remember how to do this.

> 3. I have not touched any of the "closure" functions as I do
>     not know what these do and whether adding support for stdcall
>     here would make any sense.

IIRC, nothing needs to be done.  But post your patch and I'll have a
look.

> 4. GCC 2.95.x and 3.x seem to go to great lengths to ensure a
>     default stack alignment of 128 bits. At least the
>     ffi_call_SYSV in x86/win32.S does not seem to give an
>     aligned stack to the called function.

We should probably fix this.  Do you see how to change this?

> 5. On Win32, the ffitest program fails while testing closures.
>     Is this an expected failure?

Do the same tests pass on Linux?

Thanks,

AG




More information about the Java mailing list