JDK-6488751 : hotspot should be compatible with VS2005 build
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows
  • CPU: x86
  • Submitted: 2006-11-01
  • Updated: 2012-10-08
  • Resolved: 2006-12-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u4Fixed 7Fixed hs10Fixed
Numerous errors prevent building of the hotspot using the MS VS2005 C++ compiler (included in the free MS VS 2005 Express Edition).

1. src/share/vm/adlc/main.cpp(393):
It was necessary to comment out the void *operator new( size_t size, int, const char *, int ) definition, as the C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\crtdbg.h already provides an implementation for this operator. It should probably be put under the #if statement depending on the VS version used.

2. src\os\win32\vm\perfMemory_win32.cpp(525)
The variable first_colon defined on this line (in the is_filesystem_secure() function) should be 'const char*', not just 'char *'.

3. src\share\vm\code\compressedstream.cpp(182)  
Compiler reported the following error message while compiling the fastdebug version of the hotspot (as the block the error appears in is guarded with the #ifndef PRODUCT statement):
fatal error C1063: compiler limit : compiler stack overflow
Internal Compiler Error in c:\Progra~1\MID05A~1\VC\bin\cl.exe.  You will be 
prompted to send an error report to Microsoft later.
No idea how this issue could be fixed...

4. There're lots of the following warnings generated:
see declaration of 'sprintf'
        Message: 'This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.' 
As the hotspot is to be built with the /WX option on, these warnings cause the build to fail. It's supposed that these CRT function calls should be changed to use more secure CRT functions.

The CR may be divided into separate sub-CRs to make the changes more atomic if it makes any sense.

EVALUATION Fix per description.

WORK AROUND 1. Throw away the /WX option from the makefile. 2. Perform the changes suggested in the description (the issue #3 was poorly solved commenting out the problematic code as the fastdebug version was not required for the 'proof of concept' build). With these changes the hotspot builds ok using the VS 2005 Express Edition.