This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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: [PATCH] win64 support for libffi (2/2)


Timothy Wall wrote:
> 
> On May 18, 2009, at 6:11 AM, Andrew Haley wrote:
> 
>>
>> Some of your patch seems odd to me, and perhaps changes are needed.
>>
>> For example, why this change?
>>
>> @@ -62,41 +71,59 @@
>>       size_t z;
>>
>>       /* Align if necessary */
>> -      if ((sizeof(int) - 1) & (unsigned) argp)
>> -       argp = (char *) ALIGN(argp, sizeof(int));
>> +      if ((sizeof(void*) - 1) & (size_t) argp)
>> +        argp = (char *) ALIGN(argp, sizeof(void*));
>>
> 
> sizeof(void*) would probably be more accurately represented by
> sizeof(ffi_arg), although the effect is the same.  win64 is looking for
> a 64-bit alignment, versus the original 32-bit alignment.

But this is in 32-bit generic code.  I take it that the file ffi.c, which
is used for 32-bit code on Linux, is also to be used for 64-bit code on
Windows, which is still using the old calling convention of passing args
via memory rather than registers.

OK, I think I get it now.

A warning to that effect for Linux maintainers might be a good idea.

> The (size_t) cast should probably be intptr_t.

I see.

This looks fine.  Can you prepare a patch for the libffi that's in gcc?
I'll look at doing a merge upstream.

Andrew.


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