Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/make/windows/makefiles/compile.make
32285 views
#1# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#22#2324# Generic compiler settings25!if "x$(CXX)" == "x"26CXX=cl.exe27!endif2829# CXX Flags: (these vary slightly from VC6->VS2003->VS2005 compilers)30# /nologo Supress copyright message at every cl.exe startup31# /W3 Warning level 332# /Zi Include debugging information33# /WX Treat any warning error as a fatal error34# /MD Use dynamic multi-threaded runtime (msvcrt.dll or msvc*NN.dll)35# /MTd Use static multi-threaded runtime debug versions36# /O1 Optimize for size (/Os), skips /Oi37# /O2 Optimize for speed (/Ot), adds /Oi to /O138# /Ox Old "all optimizations flag" for VC6 (in /O1)39# /Oy Use frame pointer register as GP reg (in /Ox and /O1)40# /GF Merge string constants and put in read-only memory (in /O1)41# /Gy Func level link (in /O1, allows for link-time func ordering)42# /Gs Inserts stack probes (in /O1)43# /GS Inserts security stack checks in some functions (VS2005 default)44# /Oi Use intrinsics (in /O2)45# /Od Disable all optimizations46# /MP Use multiple cores for compilation47#48# NOTE: Normally following any of the above with a '-' will turn off that flag49#50# 6655385: For VS2003/2005 we now specify /Oy- (disable frame pointer51# omission.) This has little to no effect on performance while vastly52# improving the quality of crash log stack traces involving jvm.dll.5354# These are always used in all compiles55CXX_FLAGS=$(EXTRA_CFLAGS) /nologo /W3 /WX5657# Let's add debug information when Full Debug Symbols is enabled58!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"59CXX_FLAGS=$(CXX_FLAGS) /Zi60!endif6162# Based on BUILDARCH we add some flags and select the default compiler name63!if "$(BUILDARCH)" == "ia64"64MACHINE=IA6465DEFAULT_COMPILER_NAME=VS200366CXX_FLAGS=$(CXX_FLAGS) /D "CC_INTERP" /D "_LP64" /D "IA64"67!endif6869!if "$(BUILDARCH)" == "amd64"70MACHINE=AMD6471DEFAULT_COMPILER_NAME=VS200572CXX_FLAGS=$(CXX_FLAGS) /D "_LP64" /D "AMD64"73LP64=174!endif7576!if "$(BUILDARCH)" == "i486"77MACHINE=I38678DEFAULT_COMPILER_NAME=VS200379CXX_FLAGS=$(CXX_FLAGS) /D "IA32"80!endif8182# Sanity check, this is the default if not amd64, ia64, or i48683!ifndef DEFAULT_COMPILER_NAME84CXX=ARCH_ERROR85!endif8687CXX_FLAGS=$(CXX_FLAGS) /D "WIN32" /D "_WINDOWS"88# Must specify this for sharedRuntimeTrig.cpp89CXX_FLAGS=$(CXX_FLAGS) /D "VM_LITTLE_ENDIAN"9091# Used for platform dispatching92CXX_FLAGS=$(CXX_FLAGS) /D TARGET_OS_FAMILY_windows93CXX_FLAGS=$(CXX_FLAGS) /D TARGET_ARCH_$(Platform_arch)94CXX_FLAGS=$(CXX_FLAGS) /D TARGET_ARCH_MODEL_$(Platform_arch_model)95CXX_FLAGS=$(CXX_FLAGS) /D TARGET_OS_ARCH_windows_$(Platform_arch)96CXX_FLAGS=$(CXX_FLAGS) /D TARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model)97CXX_FLAGS=$(CXX_FLAGS) /D TARGET_COMPILER_visCPP9899100# MSC_VER is a 4 digit number that tells us what compiler is being used101# and is generated when the local.make file is created by build.make102# via the script get_msc_ver.sh103#104# If MSC_VER is set, it overrides the above default setting.105# But it should be set.106# Possible values:107# 1200 is for VC6108# 1300 and 1310 is VS2003 or VC7109# 1399 is our fake number for the VS2005 compiler that really isn't 1400110# 1400 is for VS2005111# 1500 is for VS2008112# 1600 is for VS2010113# 1700 is for VS2012114# Do not confuse this MSC_VER with the predefined macro _MSC_VER that the115# compiler provides, when MSC_VER==1399, _MSC_VER will be 1400.116# Normally they are the same, but a pre-release of the VS2005 compilers117# in the Windows 64bit Platform SDK said it was 1400 when it was really118# closer to VS2003 in terms of option spellings, so we use 1399 for that119# 1400 version that really isn't 1400.120# See the file get_msc_ver.sh for more info.121!if "x$(MSC_VER)" == "x"122COMPILER_NAME=$(DEFAULT_COMPILER_NAME)123!else124!if "$(MSC_VER)" == "1200"125COMPILER_NAME=VC6126!endif127!if "$(MSC_VER)" == "1300"128COMPILER_NAME=VS2003129!endif130!if "$(MSC_VER)" == "1310"131COMPILER_NAME=VS2003132!endif133!if "$(MSC_VER)" == "1399"134# Compiler might say 1400, but if it's 14.00.30701, it isn't really VS2005135COMPILER_NAME=VS2003136!endif137!if "$(MSC_VER)" == "1400"138COMPILER_NAME=VS2005139!endif140!if "$(MSC_VER)" == "1500"141COMPILER_NAME=VS2008142!endif143!if "$(MSC_VER)" == "1600"144COMPILER_NAME=VS2010145!endif146!if "$(MSC_VER)" == "1700"147COMPILER_NAME=VS2012148!endif149!if "$(MSC_VER)" == "1800"150COMPILER_NAME=VS2013151!endif152!if "$(MSC_VER)" == "1900"153COMPILER_NAME=VS2015154!endif155!if "$(MSC_VER)" == "1912"156COMPILER_NAME=VS2017157!endif158!if "$(MSC_VER)" == "1913"159COMPILER_NAME=VS2017160!endif161!if "$(MSC_VER)" == "1914"162COMPILER_NAME=VS2017163!endif164!if "$(MSC_VER)" == "1915"165COMPILER_NAME=VS2017166!endif167!if "$(MSC_VER)" == "1916"168COMPILER_NAME=VS2017169!endif170!endif171172# By default, we do not want to use the debug version of the msvcrt.dll file173# but if MFC_DEBUG is defined in the environment it will be used.174MS_RUNTIME_OPTION = /MD175!if "$(MFC_DEBUG)" == "true"176MS_RUNTIME_OPTION = /MTd /D "_DEBUG"177!endif178179# VS2012 and later won't work with:180# /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB181!if "$(MSC_VER)" < "1700"182# Always add the _STATIC_CPPLIB flag183STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB184MS_RUNTIME_OPTION = $(MS_RUNTIME_OPTION) $(STATIC_CPPLIB_OPTION)185!endif186CXX_FLAGS=$(CXX_FLAGS) $(MS_RUNTIME_OPTION)187188# How /GX option is spelled189GX_OPTION = /GX190191# Optimization settings for various versions of the compilers and types of192# builds. Three basic sets of settings: product, fastdebug, and debug.193# These get added into CXX_FLAGS as needed by other makefiles.194!if "$(COMPILER_NAME)" == "VC6"195PRODUCT_OPT_OPTION = /Ox /Os /Gy /GF196FASTDEBUG_OPT_OPTION = /Ox /Os /Gy /GF197DEBUG_OPT_OPTION = /Od198!endif199200!if "$(COMPILER_NAME)" == "VS2003"201PRODUCT_OPT_OPTION = /O2 /Oy-202FASTDEBUG_OPT_OPTION = /O2 /Oy-203DEBUG_OPT_OPTION = /Od204SAFESEH_FLAG = /SAFESEH205!endif206207!if "$(COMPILER_NAME)" == "VS2005"208PRODUCT_OPT_OPTION = /O2 /Oy-209FASTDEBUG_OPT_OPTION = /O2 /Oy-210DEBUG_OPT_OPTION = /Od211GX_OPTION = /EHsc212# This VS2005 compiler has /GS as a default and requires bufferoverflowU.lib213# on the link command line, otherwise we get missing __security_check_cookie214# externals at link time. Even with /GS-, you need bufferoverflowU.lib.215# NOTE: Currently we decided to not use /GS-216BUFFEROVERFLOWLIB = bufferoverflowU.lib217LD_FLAGS = /manifest $(LD_FLAGS) $(BUFFEROVERFLOWLIB)218# Manifest Tool - used in VS2005 and later to adjust manifests stored219# as resources inside build artifacts.220!if "x$(MT)" == "x"221MT=mt.exe222!endif223SAFESEH_FLAG = /SAFESEH224!endif225226!if "$(COMPILER_NAME)" == "VS2008"227PRODUCT_OPT_OPTION = /O2 /Oy-228FASTDEBUG_OPT_OPTION = /O2 /Oy-229DEBUG_OPT_OPTION = /Od230GX_OPTION = /EHsc231LD_FLAGS = /manifest $(LD_FLAGS)232MP_FLAG = /MP233# Manifest Tool - used in VS2005 and later to adjust manifests stored234# as resources inside build artifacts.235!if "x$(MT)" == "x"236MT=mt.exe237!endif238SAFESEH_FLAG = /SAFESEH239!endif240241!if "$(COMPILER_NAME)" == "VS2010"242PRODUCT_OPT_OPTION = /O2 /Oy-243FASTDEBUG_OPT_OPTION = /O2 /Oy-244DEBUG_OPT_OPTION = /Od245GX_OPTION = /EHsc246LD_FLAGS = /manifest $(LD_FLAGS)247MP_FLAG = /MP248# Manifest Tool - used in VS2005 and later to adjust manifests stored249# as resources inside build artifacts.250!if "x$(MT)" == "x"251MT=mt.exe252!endif253!if "$(BUILDARCH)" == "i486"254LD_FLAGS = /SAFESEH $(LD_FLAGS)255!endif256!endif257258!if "$(COMPILER_NAME)" == "VS2012"259PRODUCT_OPT_OPTION = /O2 /Oy-260FASTDEBUG_OPT_OPTION = /O2 /Oy-261DEBUG_OPT_OPTION = /Od262GX_OPTION = /EHsc263LD_FLAGS = /manifest $(LD_FLAGS)264MP_FLAG = /MP265# Manifest Tool - used in VS2005 and later to adjust manifests stored266# as resources inside build artifacts.267!if "x$(MT)" == "x"268MT=mt.exe269!endif270SAFESEH_FLAG = /SAFESEH271!endif272273!if "$(COMPILER_NAME)" == "VS2013"274PRODUCT_OPT_OPTION = /O2 /Oy-275FASTDEBUG_OPT_OPTION = /O2 /Oy-276DEBUG_OPT_OPTION = /Od277GX_OPTION = /EHsc278LD_FLAGS = /manifest $(LD_FLAGS)279MP_FLAG = /MP280# Manifest Tool - used in VS2005 and later to adjust manifests stored281# as resources inside build artifacts.282!if "x$(MT)" == "x"283MT=mt.exe284!endif285SAFESEH_FLAG = /SAFESEH286!endif287288289!if "$(COMPILER_NAME)" == "VS2015"290PRODUCT_OPT_OPTION = /O2 /Oy-291FASTDEBUG_OPT_OPTION = /O2 /Oy-292DEBUG_OPT_OPTION = /Od293GX_OPTION = /EHsc294LD_FLAGS = /manifest $(LD_FLAGS)295MP_FLAG = /MP296# Manifest Tool - used in VS2005 and later to adjust manifests stored297# as resources inside build artifacts.298!if "x$(MT)" == "x"299MT=mt.exe300!endif301SAFESEH_FLAG = /SAFESEH302!endif303304!if "$(COMPILER_NAME)" == "VS2017"305PRODUCT_OPT_OPTION = /O2 /Oy-306FASTDEBUG_OPT_OPTION = /O2 /Oy-307DEBUG_OPT_OPTION = /Od308GX_OPTION = /EHsc309LD_FLAGS = /manifest $(LD_FLAGS)310MP_FLAG = /MP311# Manifest Tool - used in VS2005 and later to adjust manifests stored312# as resources inside build artifacts.313!if "x$(MT)" == "x"314MT=mt.exe315!endif316SAFESEH_FLAG = /SAFESEH317!endif318319!if "$(BUILDARCH)" == "i486"320LD_FLAGS = $(SAFESEH_FLAG) $(LD_FLAGS)321!endif322323CXX_FLAGS = $(CXX_FLAGS) $(MP_FLAG)324325!if "$(ENABLE_JFR)" == "true"326INCLUDE_JFR=1327!else328INCLUDE_JFR=0329!endif330CXX_FLAGS=$(CXX_FLAGS) /D INCLUDE_JFR=$(INCLUDE_JFR)331332# If NO_OPTIMIZATIONS is defined in the environment, turn everything off333!ifdef NO_OPTIMIZATIONS334PRODUCT_OPT_OPTION = $(DEBUG_OPT_OPTION)335FASTDEBUG_OPT_OPTION = $(DEBUG_OPT_OPTION)336!endif337338# Generic linker settings339!if "x$(LD)" == "x"340LD=link.exe341!endif342LD_FLAGS= $(LD_FLAGS) kernel32.lib user32.lib gdi32.lib winspool.lib \343comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \344uuid.lib Wsock32.lib winmm.lib version.lib /nologo /machine:$(MACHINE) /opt:REF \345/opt:ICF,8346!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"347LD_FLAGS= $(LD_FLAGS) /map /debug348!endif349350351!if $(MSC_VER) >= 1600352LD_FLAGS= $(LD_FLAGS) psapi.lib353!endif354355# Resource compiler settings356!if "x$(RC)" == "x"357RC=rc.exe358!endif359RC_FLAGS=/D "HS_VER=$(HS_VER)" \360/D "HS_DOTVER=$(HS_DOTVER)" \361/D "HS_BUILD_ID=$(HS_BUILD_ID)" \362/D "JDK_VER=$(JDK_VER)" \363/D "JDK_DOTVER=$(JDK_DOTVER)" \364/D "HS_COMPANY=$(COMPANY_NAME)" \365/D "HS_FILEDESC=$(HS_FILEDESC)" \366/D "HS_COPYRIGHT=$(HS_COPYRIGHT)" \367/D "HS_FNAME=$(HS_FNAME)" \368/D "HS_INTERNAL_NAME=$(HS_INTERNAL_NAME)" \369/D "HS_NAME=$(HS_NAME)"370371# Need this to match the CXX_FLAGS settings372!if "$(MFC_DEBUG)" == "true"373RC_FLAGS = $(RC_FLAGS) /D "_DEBUG"374!endif375376377