diff --git a/make/windows/makefiles/compile.make b/make/windows/makefiles/compile.make index ea16fca3ddea92f23d7c1300787b39a814d3e336..6f8dcce3406a0b72560350dad7c10575dbcc3896 100644 --- a/make/windows/makefiles/compile.make +++ b/make/windows/makefiles/compile.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2013, 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 @@ -110,6 +110,7 @@ CXX_FLAGS=$(CXX_FLAGS) /D TARGET_COMPILER_visCPP # 1400 is for VS2005 # 1500 is for VS2008 # 1600 is for VS2010 +# 1700 is for VS2012 # Do not confuse this MSC_VER with the predefined macro _MSC_VER that the # compiler provides, when MSC_VER==1399, _MSC_VER will be 1400. # Normally they are the same, but a pre-release of the VS2005 compilers @@ -142,6 +143,9 @@ COMPILER_NAME=VS2008 !if "$(MSC_VER)" == "1600" COMPILER_NAME=VS2010 !endif +!if "$(MSC_VER)" == "1700" +COMPILER_NAME=VS2012 +!endif !endif # By default, we do not want to use the debug version of the msvcrt.dll file @@ -151,9 +155,13 @@ MS_RUNTIME_OPTION = /MD MS_RUNTIME_OPTION = /MTd /D "_DEBUG" !endif +# VS2012 and later won't work with: +# /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB +!if "$(MSC_VER)" < "1700" # Always add the _STATIC_CPPLIB flag STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB MS_RUNTIME_OPTION = $(MS_RUNTIME_OPTION) $(STATIC_CPPLIB_OPTION) +!endif CXX_FLAGS=$(CXX_FLAGS) $(MS_RUNTIME_OPTION) # How /GX option is spelled @@ -221,6 +229,22 @@ LD_FLAGS = /SAFESEH $(LD_FLAGS) !endif !endif +!if "$(COMPILER_NAME)" == "VS2012" +PRODUCT_OPT_OPTION = /O2 /Oy- +FASTDEBUG_OPT_OPTION = /O2 /Oy- +DEBUG_OPT_OPTION = /Od +GX_OPTION = /EHsc +LD_FLAGS = /manifest $(LD_FLAGS) +# Manifest Tool - used in VS2005 and later to adjust manifests stored +# as resources inside build artifacts. +!if "x$(MT)" == "x" +MT=mt.exe +!endif +!if "$(BUILDARCH)" == "i486" +LD_FLAGS = /SAFESEH $(LD_FLAGS) +!endif +!endif + # If NO_OPTIMIZATIONS is defined in the environment, turn everything off !ifdef NO_OPTIMIZATIONS PRODUCT_OPT_OPTION = $(DEBUG_OPT_OPTION) diff --git a/make/windows/makefiles/sanity.make b/make/windows/makefiles/sanity.make index 86c6b59aefed21aca674e7ffde3a89064b0a159d..b502cfaa65f956baee28c684234ad69899ebcc5d 100644 --- a/make/windows/makefiles/sanity.make +++ b/make/windows/makefiles/sanity.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2013, 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 @@ -27,9 +27,9 @@ all: checkCL checkLink checkCL: - @ if "$(MSC_VER)" NEQ "1310" if "$(MSC_VER)" NEQ "1399" if "$(MSC_VER)" NEQ "1400" if "$(MSC_VER)" NEQ "1500" if "$(MSC_VER)" NEQ "1600" \ + @ if "$(MSC_VER)" NEQ "1310" if "$(MSC_VER)" NEQ "1399" if "$(MSC_VER)" NEQ "1400" if "$(MSC_VER)" NEQ "1500" if "$(MSC_VER)" NEQ "1600" if "$(MSC_VER)" NEQ "1700" \ echo *** WARNING *** unrecognized cl.exe version $(MSC_VER) ($(RAW_MSC_VER)). Use FORCE_MSC_VER to override automatic detection. checkLink: - @ if "$(LD_VER)" NEQ "710" if "$(LD_VER)" NEQ "800" if "$(LD_VER)" NEQ "900" if "$(LD_VER)" NEQ "1000" \ + @ if "$(LD_VER)" NEQ "710" if "$(LD_VER)" NEQ "800" if "$(LD_VER)" NEQ "900" if "$(LD_VER)" NEQ "1000" if "$(LD_VER)" NEQ "1100" \ echo *** WARNING *** unrecognized link.exe version $(LD_VER) ($(RAW_LD_VER)). Use FORCE_LD_VER to override automatic detection. diff --git a/make/windows/makefiles/vm.make b/make/windows/makefiles/vm.make index 54ba1eef5b8286963bcb0b9e70d29390a6e50da7..b76443774de1ee4d7c98e497a22991b3265d8d30 100644 --- a/make/windows/makefiles/vm.make +++ b/make/windows/makefiles/vm.make @@ -132,6 +132,10 @@ CXX_DONT_USE_PCH=/D DONT_USE_PRECOMPILED_HEADER !if "$(USE_PRECOMPILED_HEADER)" != "0" CXX_USE_PCH=/Fp"vm.pch" /Yu"precompiled.hpp" +!if "$(COMPILER_NAME)" == "VS2012" +# VS2012 requires this object file to be listed: +LD_FLAGS=$(LD_FLAGS) _build_pch_file.obj +!endif !else CXX_USE_PCH=$(CXX_DONT_USE_PCH) !endif diff --git a/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp b/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp index 00b9b6c305dc8bee659780d9a774c2caf856940c..f4ea83debf42a8828afe392126bdbef142572e65 100644 --- a/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp +++ b/src/os_cpu/windows_x86/vm/unwind_windows_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, 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 @@ -29,10 +29,15 @@ #ifdef AMD64 typedef unsigned char UBYTE; +#if _MSC_VER < 1700 + +/* Not needed for VS2012 compiler, comes from winnt.h. */ #define UNW_FLAG_EHANDLER 0x01 #define UNW_FLAG_UHANDLER 0x02 #define UNW_FLAG_CHAININFO 0x04 +#endif + // This structure is used to define an UNWIND_INFO that // only has an ExceptionHandler. There are no UnwindCodes // declared. @@ -59,6 +64,9 @@ typedef struct _RUNTIME_FUNCTION { } RUNTIME_FUNCTION, *PRUNTIME_FUNCTION; */ +#if _MSC_VER < 1700 + +/* Not needed for VS2012 compiler, comes from winnt.h. */ typedef struct _DISPATCHER_CONTEXT { ULONG64 ControlPc; ULONG64 ImageBase; @@ -71,6 +79,8 @@ typedef struct _DISPATCHER_CONTEXT { PVOID HandlerData; } DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT; +#endif + #if _MSC_VER < 1500 /* Not needed for VS2008 compiler, comes from winnt.h. */