This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: libffi limitation causes bad behavior in JNI on Sparc
- To: mgd at swarm dot org (Marcus G. Daniels)
- Subject: Re: libffi limitation causes bad behavior in JNI on Sparc
- From: Tom Tromey <tromey at redhat dot com>
- Date: 15 Jun 2001 18:24:29 -0600
- Cc: java at gcc dot gnu dot org, green at cygnus dot com
- References: <m2vgn6nyxc.fsf@marcus.santafe.edu>
- Reply-To: tromey at redhat dot com
>>>>> "Marcus" == Marcus G Daniels <mgd@swarm.org> writes:
Hi Marcus. Sorry this sat unanswered for so long.
Marcus> On Sparc, libffi doesn't handle integer return types of size 8 or 16.
Marcus> This causes problems for JNI calls like CallBooleanMethod because the
Marcus> return value is in the wrong bits of the returned integer.
Marcus> For example, a hack that worked for me was to change ffi_call in
Marcus> libffi/src/sparc/ffi.c to check for FFI_TYPE_UINT8 and FFI_TYPE_SINT8
Marcus> and do a *(unsigned *)rvalue << = 24 in that case.
I'm afraid I don't know enough about libffi or Sparc to comment on
this. Can somebody who does step up here? For instance, is this
suggested fix really a hack, or is it a reasonable approach to fixing
the bug?
Tom