This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: OpenGL works! Was: Re: GCJ and OpenGL under Win32
- From: Ranjit Mathew <rmathew at gmail dot com>
- To: gcj at svf dot dreamhost dot com
- Cc: java at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Wed, 12 Jan 2005 12:42:36 +0530
- Subject: Re: OpenGL works! Was: Re: GCJ and OpenGL under Win32
- References: <41DB99FB.9050301@svf.dreamhost.com> <41E11640.6000200@svf.dreamhost.com> <m3u0pn90lg.fsf@localhost.localdomain> <41E47956.205@svf.dreamhost.com>
Sal wrote:
> Tom Tromey wrote:
>
>
>>Sal> I finally figured the problem out. I rebuilt the SWT OpenGL dll with
>>Sal> mingw32, for some reason Sun's VM loads mangled names in JNI dlls and
>>Sal> GCJ doesn't.
>>
>>That is strange, since we have special Windows code in our JNI
>>implementation to do the mangling. That is, if you mean mangling like
>>appending "@NNN" to the function name. Can you describe more what is
>>going wrong? What you expected, what the symbol names are, and what
>>they are after you recompiled?
I *think* I know what the problem is - the arguments'
size is not being computed correctly - it does not
affect Linux, but it does Win32.
The relevant code in gcc/java/expr.c is:
for (tem = method_args; tem != NULL_TREE; tem = TREE_CHAIN (tem))
{
int arg_bits = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (tem)));
#ifdef PARM_BOUNDARY
arg_bits = (((arg_bits + PARM_BOUNDARY - 1) / PARM_BOUNDARY)
* PARM_BOUNDARY);
#endif
args_size += (arg_bits / BITS_PER_UNIT);
args = tree_cons (NULL_TREE, tem, args);
}
I had written this a long time ago (GCC 3.2/3.3-ish)
when it *did* work correctly. In the current mainline,
I see that for an integer argument (i686-pc-linux-gnu),
TYPE_SIZE is 32, but TYPE_SIZE_UNIT is 4.
Have TYPE_SIZE and TYPE_SIZE_UNIT reversed their meanings
in recent times or was the original code wrong to
begin with?
I was an utter newbie to GCC at that time, so I could
very well have been grossly mistaken:
http://gcc.gnu.org/ml/java/2002-11/msg00373.html
Thanks,
Ranjit.
--
Ranjit Mathew Email: rmathew AT gmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.hostingzero.com/