OpenJDK / graal / graal-jvmci-8
changeset 24608:068ddd707f15 tip
[GR-9490] make jvmci build work on windows.
PullRequest: graal-jvmci-8/47
author | Bob Vandette <bob.vandette@oracle.com> |
---|---|
date | Tue, 24 Apr 2018 10:58:37 -0700 |
parents | 05795f95d893 f3e9af9cf874 |
children | |
files | |
diffstat | 4 files changed, 132 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/make/windows/makefiles/jvmti.make Tue Apr 24 10:58:37 2018 -0700 @@ -0,0 +1,114 @@ +# +# Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# + +# This makefile (jvmti.make) is included from the jvmti.make in the +# build directories. +# +# It knows how to build and run the tools to generate jvmti. + +!include $(WorkSpace)/make/windows/makefiles/rules.make + +# ######################################################################### + +JvmtiSrcDir = $(WorkSpace)/src/share/vm/prims +InterpreterSrcDir = $(WorkSpace)/src/share/vm/interpreter + +JvmtiGeneratedNames = \ + jvmtiEnv.hpp \ + jvmtiEnter.cpp \ + jvmtiEnterTrace.cpp \ + jvmtiEnvRecommended.cpp \ + bytecodeInterpreterWithChecks.cpp \ + jvmti.h \ + +JvmtiEnvFillSource = $(JvmtiSrcDir)/jvmtiEnvFill.java +JvmtiEnvFillClass = $(JvmtiOutDir)/jvmtiEnvFill.class + +JvmtiGenSource = $(JvmtiSrcDir)/jvmtiGen.java +JvmtiGenClass = $(JvmtiOutDir)/jvmtiGen.class + +#Note: JvmtiGeneratedFiles must be kept in sync with JvmtiGeneratedNames by hand. +#Should be equivalent #to "JvmtiGeneratedFiles = $(JvmtiGeneratedNames:%=$(JvmtiOutDir)/%)" +JvmtiGeneratedFiles = \ + $(JvmtiOutDir)/jvmtiEnv.hpp \ + $(JvmtiOutDir)/jvmtiEnter.cpp \ + $(JvmtiOutDir)/jvmtiEnterTrace.cpp \ + $(JvmtiOutDir)/jvmtiEnvRecommended.cpp\ + $(JvmtiOutDir)/bytecodeInterpreterWithChecks.cpp\ + $(JvmtiOutDir)/jvmti.h \ + +XSLT = $(RUN_JAVA) -classpath $(JvmtiOutDir) jvmtiGen + +# ######################################################################### + +both = $(JvmtiGenClass) $(JvmtiSrcDir)/jvmti.xml $(JvmtiSrcDir)/jvmtiLib.xsl + +default:: + @if not exist $(JvmtiOutDir) mkdir $(JvmtiOutDir) + +$(JvmtiGenClass): $(JvmtiGenSource) + $(COMPILE_JAVAC) -d $(JvmtiOutDir) $(JvmtiGenSource) + +$(JvmtiEnvFillClass): $(JvmtiEnvFillSource) + @$(COMPILE_JAVAC) -d $(JvmtiOutDir) $(JvmtiEnvFillSource) + +$(JvmtiOutDir)/jvmtiEnter.cpp: $(both) $(JvmtiSrcDir)/jvmtiEnter.xsl + @echo Generating $@ + @$(XSLT) -IN $(JvmtiSrcDir)/jvmti.xml -XSL $(JvmtiSrcDir)/jvmtiEnter.xsl -OUT $(JvmtiOutDir)/jvmtiEnter.cpp -PARAM interface jvmti + +$(JvmtiOutDir)/bytecodeInterpreterWithChecks.cpp: $(JvmtiGenClass) $(InterpreterSrcDir)/bytecodeInterpreter.cpp $(InterpreterSrcDir)/bytecodeInterpreterWithChecks.xml $(InterpreterSrcDir)/bytecodeInterpreterWithChecks.xsl + @echo Generating $@ + @$(XSLT) -IN $(InterpreterSrcDir)/bytecodeInterpreterWithChecks.xml -XSL $(InterpreterSrcDir)/bytecodeInterpreterWithChecks.xsl -OUT $(JvmtiOutDir)/bytecodeInterpreterWithChecks.cpp + +$(JvmtiOutDir)/jvmtiEnterTrace.cpp: $(both) $(JvmtiSrcDir)/jvmtiEnter.xsl + @echo Generating $@ + @$(XSLT) -IN $(JvmtiSrcDir)/jvmti.xml -XSL $(JvmtiSrcDir)/jvmtiEnter.xsl -OUT $(JvmtiOutDir)/jvmtiEnterTrace.cpp -PARAM interface jvmti -PARAM trace Trace + +$(JvmtiOutDir)/jvmtiEnvRecommended.cpp: $(both) $(JvmtiSrcDir)/jvmtiEnv.xsl $(JvmtiSrcDir)/jvmtiEnv.cpp $(JvmtiEnvFillClass) + @echo Generating $@ + @$(XSLT) -IN $(JvmtiSrcDir)/jvmti.xml -XSL $(JvmtiSrcDir)/jvmtiEnv.xsl -OUT $(JvmtiOutDir)/jvmtiEnvStub.cpp + @$(RUN_JAVA) -classpath $(JvmtiOutDir) jvmtiEnvFill $(JvmtiSrcDir)/jvmtiEnv.cpp $(JvmtiOutDir)/jvmtiEnvStub.cpp $(JvmtiOutDir)/jvmtiEnvRecommended.cpp + +$(JvmtiOutDir)/jvmtiEnv.hpp: $(both) $(JvmtiSrcDir)/jvmtiHpp.xsl + @echo Generating $@ + @$(XSLT) -IN $(JvmtiSrcDir)/jvmti.xml -XSL $(JvmtiSrcDir)/jvmtiHpp.xsl -OUT $(JvmtiOutDir)/jvmtiEnv.hpp + +$(JvmtiOutDir)/jvmti.h: $(both) $(JvmtiSrcDir)/jvmtiH.xsl + @echo Generating $@ + @$(XSLT) -IN $(JvmtiSrcDir)/jvmti.xml -XSL $(JvmtiSrcDir)/jvmtiH.xsl -OUT $(JvmtiOutDir)/jvmti.h + +jvmtidocs: $(JvmtiOutDir)/jvmti.html + +$(JvmtiOutDir)/jvmti.html: $(both) $(JvmtiSrcDir)/jvmti.xsl + @echo Generating $@ + @$(XSLT) -IN $(JvmtiSrcDir)/jvmti.xml -XSL $(JvmtiSrcDir)/jvmti.xsl -OUT $(JvmtiOutDir)/jvmti.html + +# ######################################################################### + +cleanall : + rm $(JvmtiGenClass) $(JvmtiEnvFillClass) $(JvmtiGeneratedFiles) + +# ######################################################################### + +.PHONY: jvmtidocs cleanall
--- a/mx.jvmci/mx_jvmci.py Mon Apr 23 17:14:47 2018 -0700 +++ b/mx.jvmci/mx_jvmci.py Tue Apr 24 10:58:37 2018 -0700 @@ -675,16 +675,16 @@ startToken = 'RUNINDEBUGSHELL_STARTSEQUENCE' endToken = 'RUNINDEBUGSHELL_ENDSEQUENCE' - winSDK = mx.get_env('WIN_SDK', 'C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\') + winSDK = mx.get_env('VSINSTALLDIR', 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\') if not exists(mx._cygpathW2U(winSDK)): mx.abort("Could not find Windows SDK : '" + winSDK + "' does not exist") - winSDKSetEnv = mx._cygpathW2U(join(winSDK, 'Bin', 'SetEnv.cmd')) + winSDKSetEnv = mx._cygpathW2U(join(winSDK, 'VC', 'vcvarsall.bat')) if not exists(winSDKSetEnv): - mx.abort("Invalid Windows SDK path (" + winSDK + ") : could not find Bin/SetEnv.cmd (you can use the WIN_SDK environment variable to specify an other path)") + mx.abort("Invalid Windows SDK path (" + winSDK + ") : could not find vcvarsall.bat (you can use the WIN_SDK environment variable to specify an other path to Visual Studio)") - wincmd = 'cmd.exe /E:ON /V:ON /K "' + mx._cygpathU2W(winSDKSetEnv) + '"' + wincmd = 'cmd.exe /E:ON /V:ON /K "' + mx._cygpathU2W(winSDKSetEnv) + '" amd64' p = subprocess.Popen(wincmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout = p.stdout stdin = p.stdin
--- a/src/share/vm/runtime/vm_version.cpp Mon Apr 23 17:14:47 2018 -0700 +++ b/src/share/vm/runtime/vm_version.cpp Tue Apr 24 10:58:37 2018 -0700 @@ -42,11 +42,11 @@ # include "vm_version_ppc.hpp" #endif + const char* Abstract_VM_Version::_s_vm_release = NULL; const char* Abstract_VM_Version::_s_vm_name = NULL; -int Abstract_VM_Version::_vm_properties_initialized_from_file = - Abstract_VM_Version::init_vm_properties(Abstract_VM_Version::_s_vm_name, Abstract_VM_Version::_s_vm_release); -const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Version::init_internal_vm_info_string(); +int Abstract_VM_Version::_vm_properties_initialized_from_file = 0; +const char* Abstract_VM_Version::_s_internal_vm_info_string = NULL; bool Abstract_VM_Version::_supports_cx8 = false; bool Abstract_VM_Version::_supports_atomic_getset4 = false; bool Abstract_VM_Version::_supports_atomic_getset8 = false; @@ -81,6 +81,12 @@ int Abstract_VM_Version::_parallel_worker_threads = 0; bool Abstract_VM_Version::_parallel_worker_threads_initialized = false; +void Abstract_VM_Version::early_initialize() { + Abstract_VM_Version::initialize(); + _vm_properties_initialized_from_file = Abstract_VM_Version::init_vm_properties(Abstract_VM_Version::_s_vm_name, Abstract_VM_Version::_s_vm_release); + _s_internal_vm_info_string = Abstract_VM_Version::init_internal_vm_info_string(); +} + void Abstract_VM_Version::initialize() { if (_initialized) { return; @@ -146,14 +152,14 @@ if (end == NULL) { warning("Could not find '%c' in %s", *os::file_separator(), filename); } else { - snprintf(end, JVM_MAXPATHLEN - (end - filename), "%svm.properties", os::file_separator()); + jio_snprintf(end, JVM_MAXPATHLEN - (end - filename), "%svm.properties", os::file_separator()); struct stat statbuf; if (os::stat(filename, &statbuf) == 0) { FILE* stream = fopen(filename, "r"); if (stream != NULL) { char* buffer = NEW_C_HEAP_ARRAY(char, statbuf.st_size + 1, mtInternal); - int num_read = fread(buffer, 1, statbuf.st_size, stream); + int num_read = (int)fread(buffer, 1, statbuf.st_size, stream); int err = ferror(stream); fclose(stream); if (num_read != statbuf.st_size) { @@ -367,8 +373,8 @@ " by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER if (_s_vm_name != VMNAME || _s_vm_release != VM_RELEASE) { - int len = strlen(VM_INTERNAL_INFO_FORMAT(VMNAME, VM_RELEASE)) - strlen(VMNAME VM_RELEASE) + - strlen(_s_vm_name) + strlen(_s_vm_release); + int len = (int) (strlen(VM_INTERNAL_INFO_FORMAT(VMNAME, VM_RELEASE)) - strlen(VMNAME VM_RELEASE) + + strlen(_s_vm_name) + strlen(_s_vm_release)); char* buffer = NEW_C_HEAP_ARRAY(char, len + 1, mtInternal); sprintf(buffer, VM_INTERNAL_INFO_FORMAT("%s", "%s"), _s_vm_name, _s_vm_release); return buffer;
--- a/src/share/vm/runtime/vm_version.hpp Mon Apr 23 17:14:47 2018 -0700 +++ b/src/share/vm/runtime/vm_version.hpp Tue Apr 24 10:58:37 2018 -0700 @@ -79,7 +79,7 @@ // full VM_Version initialization is possible. It can not depend on any // other part of the VM being initialized when called. Platforms that // need to specialize this define VM_Version::early_initialize(). - static void early_initialize() { } + static void early_initialize(); // Called to initialize VM variables needing initialization // after command line parsing. Platforms that need to specialize