Re: [Sablevm-developer] powerpc port status
Brought to you by:
egagnon
From: David P. B. <db...@CS...> - 2002-12-14 01:32:49
|
Hello, I will send a bug report to the libffi2 maintainers. I found another bug about libffi2. It does not passed properly args of type ffi_type_uint8. I will patch the code temporarily as suggested by Etienne to get around these bugs. David On Fri, Dec 13, 2002 at 05:49:16PM -0500, Etienne M. Gagnon wrote: > On Fri, Dec 13, 2002 at 05:18:42PM -0500, David Paul BELANGER wrote: > > Accessing the value simply with: > > params[0].jint =3D result[0].jint; > >... > > The other possible fix is to take byte at offset 3 for big endian > > machines: > > *(((unsigned char*) &v) + 3) > > this does not rely on the layout of the union in memory. >=20 > Yes, it actually does! So, this would be wrong, as libffi was given > ((unsigned char*) &v) as the location to store a "char", not and > "int". So, SableVM's source code is correct. >=20 > "params[0].jint =3D result[0].jint;" should fail on a big-endian > machine! (It makes sense for this code *not* to work on both big and > little-endian machines, if a "char" value was stored at &result). >=20 > Maybe we should add an "#if defined(LIBFFIBUG) ... #endif" clause with > the temporary bug evasion for now, and submit a bug against libffi > (try "reportbug libffi2" on Debian, assuming reportbug is installed). >=20 > Etienne >=20 > --=20 > Etienne M. Gagnon http://www.info.uqam.ca/~egagnon/ > SableVM: http://www.sablevm.org/ > SableCC: http://www.sablecc.org/ --=20 --- David B=E9langer Graduate Student School of Computer Science McGill University Office: MC226 Web page: http://www.cs.mcgill.ca/~dbelan2/ Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt |