make/windows/makefiles/compile.make

Tue, 26 Jul 2016 11:15:09 +0800

author
fujie
date
Tue, 26 Jul 2016 11:15:09 +0800
changeset 38
f0e26f502a50
parent 0
f90c822e73f8
child 6876
710a3c8b516e
permissions
-rw-r--r--

Instruction decoding support: add movn and movz in MIPS disassembler.

aoqi@0 1 #
aoqi@0 2 # Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 #
aoqi@0 5 # This code is free software; you can redistribute it and/or modify it
aoqi@0 6 # under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 # published by the Free Software Foundation.
aoqi@0 8 #
aoqi@0 9 # This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 # version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 # accompanied this code).
aoqi@0 14 #
aoqi@0 15 # You should have received a copy of the GNU General Public License version
aoqi@0 16 # 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 #
aoqi@0 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 # or visit www.oracle.com if you need additional information or have any
aoqi@0 21 # questions.
aoqi@0 22 #
aoqi@0 23 #
aoqi@0 24
aoqi@0 25 # Generic compiler settings
aoqi@0 26 !if "x$(CXX)" == "x"
aoqi@0 27 CXX=cl.exe
aoqi@0 28 !endif
aoqi@0 29
aoqi@0 30 # CXX Flags: (these vary slightly from VC6->VS2003->VS2005 compilers)
aoqi@0 31 # /nologo Supress copyright message at every cl.exe startup
aoqi@0 32 # /W3 Warning level 3
aoqi@0 33 # /Zi Include debugging information
aoqi@0 34 # /WX Treat any warning error as a fatal error
aoqi@0 35 # /MD Use dynamic multi-threaded runtime (msvcrt.dll or msvc*NN.dll)
aoqi@0 36 # /MTd Use static multi-threaded runtime debug versions
aoqi@0 37 # /O1 Optimize for size (/Os), skips /Oi
aoqi@0 38 # /O2 Optimize for speed (/Ot), adds /Oi to /O1
aoqi@0 39 # /Ox Old "all optimizations flag" for VC6 (in /O1)
aoqi@0 40 # /Oy Use frame pointer register as GP reg (in /Ox and /O1)
aoqi@0 41 # /GF Merge string constants and put in read-only memory (in /O1)
aoqi@0 42 # /Gy Func level link (in /O1, allows for link-time func ordering)
aoqi@0 43 # /Gs Inserts stack probes (in /O1)
aoqi@0 44 # /GS Inserts security stack checks in some functions (VS2005 default)
aoqi@0 45 # /Oi Use intrinsics (in /O2)
aoqi@0 46 # /Od Disable all optimizations
aoqi@0 47 # /MP Use multiple cores for compilation
aoqi@0 48 #
aoqi@0 49 # NOTE: Normally following any of the above with a '-' will turn off that flag
aoqi@0 50 #
aoqi@0 51 # 6655385: For VS2003/2005 we now specify /Oy- (disable frame pointer
aoqi@0 52 # omission.) This has little to no effect on performance while vastly
aoqi@0 53 # improving the quality of crash log stack traces involving jvm.dll.
aoqi@0 54
aoqi@0 55 # These are always used in all compiles
aoqi@0 56 CXX_FLAGS=$(EXTRA_CFLAGS) /nologo /W3 /WX
aoqi@0 57
aoqi@0 58 # Let's add debug information when Full Debug Symbols is enabled
aoqi@0 59 !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
aoqi@0 60 CXX_FLAGS=$(CXX_FLAGS) /Zi
aoqi@0 61 !endif
aoqi@0 62
aoqi@0 63 # Based on BUILDARCH we add some flags and select the default compiler name
aoqi@0 64 !if "$(BUILDARCH)" == "ia64"
aoqi@0 65 MACHINE=IA64
aoqi@0 66 DEFAULT_COMPILER_NAME=VS2003
aoqi@0 67 CXX_FLAGS=$(CXX_FLAGS) /D "CC_INTERP" /D "_LP64" /D "IA64"
aoqi@0 68 !endif
aoqi@0 69
aoqi@0 70 !if "$(BUILDARCH)" == "amd64"
aoqi@0 71 MACHINE=AMD64
aoqi@0 72 DEFAULT_COMPILER_NAME=VS2005
aoqi@0 73 CXX_FLAGS=$(CXX_FLAGS) /D "_LP64" /D "AMD64"
aoqi@0 74 LP64=1
aoqi@0 75 !endif
aoqi@0 76
aoqi@0 77 !if "$(BUILDARCH)" == "i486"
aoqi@0 78 MACHINE=I386
aoqi@0 79 DEFAULT_COMPILER_NAME=VS2003
aoqi@0 80 CXX_FLAGS=$(CXX_FLAGS) /D "IA32"
aoqi@0 81 !endif
aoqi@0 82
aoqi@0 83 # Sanity check, this is the default if not amd64, ia64, or i486
aoqi@0 84 !ifndef DEFAULT_COMPILER_NAME
aoqi@0 85 CXX=ARCH_ERROR
aoqi@0 86 !endif
aoqi@0 87
aoqi@0 88 CXX_FLAGS=$(CXX_FLAGS) /D "WIN32" /D "_WINDOWS"
aoqi@0 89 # Must specify this for sharedRuntimeTrig.cpp
aoqi@0 90 CXX_FLAGS=$(CXX_FLAGS) /D "VM_LITTLE_ENDIAN"
aoqi@0 91
aoqi@0 92 # Used for platform dispatching
aoqi@0 93 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_OS_FAMILY_windows
aoqi@0 94 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_ARCH_$(Platform_arch)
aoqi@0 95 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_ARCH_MODEL_$(Platform_arch_model)
aoqi@0 96 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_OS_ARCH_windows_$(Platform_arch)
aoqi@0 97 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model)
aoqi@0 98 CXX_FLAGS=$(CXX_FLAGS) /D TARGET_COMPILER_visCPP
aoqi@0 99
aoqi@0 100
aoqi@0 101 # MSC_VER is a 4 digit number that tells us what compiler is being used
aoqi@0 102 # and is generated when the local.make file is created by build.make
aoqi@0 103 # via the script get_msc_ver.sh
aoqi@0 104 #
aoqi@0 105 # If MSC_VER is set, it overrides the above default setting.
aoqi@0 106 # But it should be set.
aoqi@0 107 # Possible values:
aoqi@0 108 # 1200 is for VC6
aoqi@0 109 # 1300 and 1310 is VS2003 or VC7
aoqi@0 110 # 1399 is our fake number for the VS2005 compiler that really isn't 1400
aoqi@0 111 # 1400 is for VS2005
aoqi@0 112 # 1500 is for VS2008
aoqi@0 113 # 1600 is for VS2010
aoqi@0 114 # 1700 is for VS2012
aoqi@0 115 # Do not confuse this MSC_VER with the predefined macro _MSC_VER that the
aoqi@0 116 # compiler provides, when MSC_VER==1399, _MSC_VER will be 1400.
aoqi@0 117 # Normally they are the same, but a pre-release of the VS2005 compilers
aoqi@0 118 # in the Windows 64bit Platform SDK said it was 1400 when it was really
aoqi@0 119 # closer to VS2003 in terms of option spellings, so we use 1399 for that
aoqi@0 120 # 1400 version that really isn't 1400.
aoqi@0 121 # See the file get_msc_ver.sh for more info.
aoqi@0 122 !if "x$(MSC_VER)" == "x"
aoqi@0 123 COMPILER_NAME=$(DEFAULT_COMPILER_NAME)
aoqi@0 124 !else
aoqi@0 125 !if "$(MSC_VER)" == "1200"
aoqi@0 126 COMPILER_NAME=VC6
aoqi@0 127 !endif
aoqi@0 128 !if "$(MSC_VER)" == "1300"
aoqi@0 129 COMPILER_NAME=VS2003
aoqi@0 130 !endif
aoqi@0 131 !if "$(MSC_VER)" == "1310"
aoqi@0 132 COMPILER_NAME=VS2003
aoqi@0 133 !endif
aoqi@0 134 !if "$(MSC_VER)" == "1399"
aoqi@0 135 # Compiler might say 1400, but if it's 14.00.30701, it isn't really VS2005
aoqi@0 136 COMPILER_NAME=VS2003
aoqi@0 137 !endif
aoqi@0 138 !if "$(MSC_VER)" == "1400"
aoqi@0 139 COMPILER_NAME=VS2005
aoqi@0 140 !endif
aoqi@0 141 !if "$(MSC_VER)" == "1500"
aoqi@0 142 COMPILER_NAME=VS2008
aoqi@0 143 !endif
aoqi@0 144 !if "$(MSC_VER)" == "1600"
aoqi@0 145 COMPILER_NAME=VS2010
aoqi@0 146 !endif
aoqi@0 147 !if "$(MSC_VER)" == "1700"
aoqi@0 148 COMPILER_NAME=VS2012
aoqi@0 149 !endif
aoqi@0 150 !endif
aoqi@0 151
aoqi@0 152 # By default, we do not want to use the debug version of the msvcrt.dll file
aoqi@0 153 # but if MFC_DEBUG is defined in the environment it will be used.
aoqi@0 154 MS_RUNTIME_OPTION = /MD
aoqi@0 155 !if "$(MFC_DEBUG)" == "true"
aoqi@0 156 MS_RUNTIME_OPTION = /MTd /D "_DEBUG"
aoqi@0 157 !endif
aoqi@0 158
aoqi@0 159 # VS2012 and later won't work with:
aoqi@0 160 # /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB
aoqi@0 161 !if "$(MSC_VER)" < "1700"
aoqi@0 162 # Always add the _STATIC_CPPLIB flag
aoqi@0 163 STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB /D _DISABLE_DEPRECATE_STATIC_CPPLIB
aoqi@0 164 MS_RUNTIME_OPTION = $(MS_RUNTIME_OPTION) $(STATIC_CPPLIB_OPTION)
aoqi@0 165 !endif
aoqi@0 166 CXX_FLAGS=$(CXX_FLAGS) $(MS_RUNTIME_OPTION)
aoqi@0 167
aoqi@0 168 # How /GX option is spelled
aoqi@0 169 GX_OPTION = /GX
aoqi@0 170
aoqi@0 171 # Optimization settings for various versions of the compilers and types of
aoqi@0 172 # builds. Three basic sets of settings: product, fastdebug, and debug.
aoqi@0 173 # These get added into CXX_FLAGS as needed by other makefiles.
aoqi@0 174 !if "$(COMPILER_NAME)" == "VC6"
aoqi@0 175 PRODUCT_OPT_OPTION = /Ox /Os /Gy /GF
aoqi@0 176 FASTDEBUG_OPT_OPTION = /Ox /Os /Gy /GF
aoqi@0 177 DEBUG_OPT_OPTION = /Od
aoqi@0 178 !endif
aoqi@0 179
aoqi@0 180 !if "$(COMPILER_NAME)" == "VS2003"
aoqi@0 181 PRODUCT_OPT_OPTION = /O2 /Oy-
aoqi@0 182 FASTDEBUG_OPT_OPTION = /O2 /Oy-
aoqi@0 183 DEBUG_OPT_OPTION = /Od
aoqi@0 184 SAFESEH_FLAG = /SAFESEH
aoqi@0 185 !endif
aoqi@0 186
aoqi@0 187 !if "$(COMPILER_NAME)" == "VS2005"
aoqi@0 188 PRODUCT_OPT_OPTION = /O2 /Oy-
aoqi@0 189 FASTDEBUG_OPT_OPTION = /O2 /Oy-
aoqi@0 190 DEBUG_OPT_OPTION = /Od
aoqi@0 191 GX_OPTION = /EHsc
aoqi@0 192 # This VS2005 compiler has /GS as a default and requires bufferoverflowU.lib
aoqi@0 193 # on the link command line, otherwise we get missing __security_check_cookie
aoqi@0 194 # externals at link time. Even with /GS-, you need bufferoverflowU.lib.
aoqi@0 195 # NOTE: Currently we decided to not use /GS-
aoqi@0 196 BUFFEROVERFLOWLIB = bufferoverflowU.lib
aoqi@0 197 LD_FLAGS = /manifest $(LD_FLAGS) $(BUFFEROVERFLOWLIB)
aoqi@0 198 # Manifest Tool - used in VS2005 and later to adjust manifests stored
aoqi@0 199 # as resources inside build artifacts.
aoqi@0 200 !if "x$(MT)" == "x"
aoqi@0 201 MT=mt.exe
aoqi@0 202 !endif
aoqi@0 203 SAFESEH_FLAG = /SAFESEH
aoqi@0 204 !endif
aoqi@0 205
aoqi@0 206 !if "$(COMPILER_NAME)" == "VS2008"
aoqi@0 207 PRODUCT_OPT_OPTION = /O2 /Oy-
aoqi@0 208 FASTDEBUG_OPT_OPTION = /O2 /Oy-
aoqi@0 209 DEBUG_OPT_OPTION = /Od
aoqi@0 210 GX_OPTION = /EHsc
aoqi@0 211 LD_FLAGS = /manifest $(LD_FLAGS)
aoqi@0 212 MP_FLAG = /MP
aoqi@0 213 # Manifest Tool - used in VS2005 and later to adjust manifests stored
aoqi@0 214 # as resources inside build artifacts.
aoqi@0 215 !if "x$(MT)" == "x"
aoqi@0 216 MT=mt.exe
aoqi@0 217 !endif
aoqi@0 218 SAFESEH_FLAG = /SAFESEH
aoqi@0 219 !endif
aoqi@0 220
aoqi@0 221 !if "$(COMPILER_NAME)" == "VS2010"
aoqi@0 222 PRODUCT_OPT_OPTION = /O2 /Oy-
aoqi@0 223 FASTDEBUG_OPT_OPTION = /O2 /Oy-
aoqi@0 224 DEBUG_OPT_OPTION = /Od
aoqi@0 225 GX_OPTION = /EHsc
aoqi@0 226 LD_FLAGS = /manifest $(LD_FLAGS)
aoqi@0 227 MP_FLAG = /MP
aoqi@0 228 # Manifest Tool - used in VS2005 and later to adjust manifests stored
aoqi@0 229 # as resources inside build artifacts.
aoqi@0 230 !if "x$(MT)" == "x"
aoqi@0 231 MT=mt.exe
aoqi@0 232 !endif
aoqi@0 233 !if "$(BUILDARCH)" == "i486"
aoqi@0 234 LD_FLAGS = /SAFESEH $(LD_FLAGS)
aoqi@0 235 !endif
aoqi@0 236 !endif
aoqi@0 237
aoqi@0 238 !if "$(COMPILER_NAME)" == "VS2012"
aoqi@0 239 PRODUCT_OPT_OPTION = /O2 /Oy-
aoqi@0 240 FASTDEBUG_OPT_OPTION = /O2 /Oy-
aoqi@0 241 DEBUG_OPT_OPTION = /Od
aoqi@0 242 GX_OPTION = /EHsc
aoqi@0 243 LD_FLAGS = /manifest $(LD_FLAGS)
aoqi@0 244 MP_FLAG = /MP
aoqi@0 245 # Manifest Tool - used in VS2005 and later to adjust manifests stored
aoqi@0 246 # as resources inside build artifacts.
aoqi@0 247 !if "x$(MT)" == "x"
aoqi@0 248 MT=mt.exe
aoqi@0 249 !endif
aoqi@0 250 SAFESEH_FLAG = /SAFESEH
aoqi@0 251 !endif
aoqi@0 252
aoqi@0 253 !if "$(BUILDARCH)" == "i486"
aoqi@0 254 LD_FLAGS = $(SAFESEH_FLAG) $(LD_FLAGS)
aoqi@0 255 !endif
aoqi@0 256
aoqi@0 257 CXX_FLAGS = $(CXX_FLAGS) $(MP_FLAG)
aoqi@0 258
aoqi@0 259 # If NO_OPTIMIZATIONS is defined in the environment, turn everything off
aoqi@0 260 !ifdef NO_OPTIMIZATIONS
aoqi@0 261 PRODUCT_OPT_OPTION = $(DEBUG_OPT_OPTION)
aoqi@0 262 FASTDEBUG_OPT_OPTION = $(DEBUG_OPT_OPTION)
aoqi@0 263 !endif
aoqi@0 264
aoqi@0 265 # Generic linker settings
aoqi@0 266 !if "x$(LD)" == "x"
aoqi@0 267 LD=link.exe
aoqi@0 268 !endif
aoqi@0 269 LD_FLAGS= $(LD_FLAGS) kernel32.lib user32.lib gdi32.lib winspool.lib \
aoqi@0 270 comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
aoqi@0 271 uuid.lib Wsock32.lib winmm.lib /nologo /machine:$(MACHINE) /opt:REF \
aoqi@0 272 /opt:ICF,8
aoqi@0 273 !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
aoqi@0 274 LD_FLAGS= $(LD_FLAGS) /map /debug
aoqi@0 275 !endif
aoqi@0 276
aoqi@0 277
aoqi@0 278 !if $(MSC_VER) >= 1600
aoqi@0 279 LD_FLAGS= $(LD_FLAGS) psapi.lib
aoqi@0 280 !endif
aoqi@0 281
aoqi@0 282 # Resource compiler settings
aoqi@0 283 !if "x$(RC)" == "x"
aoqi@0 284 RC=rc.exe
aoqi@0 285 !endif
aoqi@0 286 RC_FLAGS=/D "HS_VER=$(HS_VER)" \
aoqi@0 287 /D "HS_DOTVER=$(HS_DOTVER)" \
aoqi@0 288 /D "HS_BUILD_ID=$(HS_BUILD_ID)" \
aoqi@0 289 /D "JDK_VER=$(JDK_VER)" \
aoqi@0 290 /D "JDK_DOTVER=$(JDK_DOTVER)" \
aoqi@0 291 /D "HS_COMPANY=$(HS_COMPANY)" \
aoqi@0 292 /D "HS_FILEDESC=$(HS_FILEDESC)" \
aoqi@0 293 /D "HS_COPYRIGHT=$(HS_COPYRIGHT)" \
aoqi@0 294 /D "HS_FNAME=$(HS_FNAME)" \
aoqi@0 295 /D "HS_INTERNAL_NAME=$(HS_INTERNAL_NAME)" \
aoqi@0 296 /D "HS_NAME=$(HS_NAME)"
aoqi@0 297
aoqi@0 298 # Need this to match the CXX_FLAGS settings
aoqi@0 299 !if "$(MFC_DEBUG)" == "true"
aoqi@0 300 RC_FLAGS = $(RC_FLAGS) /D "_DEBUG"
aoqi@0 301 !endif
aoqi@0 302

mercurial