RFA: libjava seems to miss some files for win32

Kai Tietz ktietz70@googlemail.com
Sun Jul 19 11:13:00 GMT 2009


2009/7/18 Andrew Pinski <pinskia@gmail.com>:
> On Sat, Jul 18, 2009 at 12:22 PM, Kai Tietz<ktietz70@googlemail.com> wrote:
>> Well, uintptr_t/intptr_t are available to most (but not all hosts).
>> IIRC there is a gcc version of stdint.h (gstdint.h), which could be
>> used here. The mode version is fine too, as long as we can assume that
>> libjava isn't build by any other compiler then gcc.
>
> It is provided by GCC even without gstdint.h.  See bug 448.  Since
> __UINTPTR_TYPE__ is provided to be able to use stdint.h :).
>
> Thanks,
> Andrew PInski
>

So, I was able to build libjave (using the upstream boehm-gc source as
the version in gcc at the moment doesn't support x64) for x64 windows.
There are a lot of issues about casting HANDLE values into jint types,
which is for x86 valid, but for x64 can lead potential to pointer
truncations. Those part need some review by libjava maintainers. My
patch simply casts those kind of pointers via __UINTPTR_TYPE__ into
integer scalar before casting it into jint. I put comments at those
places, where some rework is necessary.
Additionally I removed the use of srand()/rand () and just throw an
exception in the Win32 specific implementation of
gnu::java::security::jce::prng::VMSecureRandom::natGenerateSeed.

ChangeLog

2009-07-19  Kai Tietz  <kai.tietz@onevision.com>

	* gnu/java/security/jce/prng/natVMSecureRandomWin32.cc: New Win32
	specific implementation.
	* nclude/win32.h (_Jv_platform_ffi_abi): Use for _WIN64 case
	FFI_DEFAULT_ABI.
	* java/lang/natString.cc (UNMASK_PTR, MASK_PTR, PTR_MASKED): Use
	__UINTPTR_TYPE__ instead of unsigned long for pointer casts.
	* gnu/java/net/natPlainDatagramSocketImplWin32.cc: Likewise.
	* gnu/java/net/natPlainSocketImplWin32.cc: Likwise.
	* gnu/java/nio/channels/natFileChannelWin32.cc: Likewise.
	* include/jvm.h: Likewise.
	* java/lang/natClass.cc: Likewise.
	* java/lang/natClassLoader.cc: Likewise.
	* java/lang/natWin32Process.cc: Likewise.
	* link.cc: Likewise.


Regression tested for i686-pc-mingw32. Ok, for apply?

Cheers,
Kai

-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libjave_win.diff
Type: text/x-c
Size: 11661 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20090719/4af6c40b/attachment.bin>


More information about the Java mailing list