Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1 | # Copyright 2013 the V8 project authors. All rights reserved. |
| 2 | # Redistribution and use in source and binary forms, with or without |
| 3 | # modification, are permitted provided that the following conditions are |
| 4 | # met: |
| 5 | # |
| 6 | # * Redistributions of source code must retain the above copyright |
| 7 | # notice, this list of conditions and the following disclaimer. |
| 8 | # * Redistributions in binary form must reproduce the above |
| 9 | # copyright notice, this list of conditions and the following |
| 10 | # disclaimer in the documentation and/or other materials provided |
| 11 | # with the distribution. |
| 12 | # * Neither the name of Google Inc. nor the names of its |
| 13 | # contributors may be used to endorse or promote products derived |
| 14 | # from this software without specific prior written permission. |
| 15 | # |
| 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 19 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 20 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 21 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | |
| 28 | # Shared definitions for all V8-related targets. |
| 29 | |
| 30 | { |
| 31 | 'variables': { |
| 32 | 'msvs_use_common_release': 0, |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 33 | 'clang%': 0, |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 34 | 'asan%': 0, |
| 35 | 'lsan%': 0, |
| 36 | 'msan%': 0, |
| 37 | 'tsan%': 0, |
| 38 | 'ubsan%': 0, |
| 39 | 'ubsan_vptr%': 0, |
Ben Murdoch | 61f157c | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 40 | 'has_valgrind%': 0, |
| 41 | 'coverage%': 0, |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 42 | 'v8_target_arch%': '<(target_arch)', |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 43 | 'v8_host_byteorder%': '<!(python -c "import sys; print sys.byteorder")', |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 44 | # Native Client builds currently use the V8 ARM JIT and |
| 45 | # arm/simulator-arm.cc to defer the significant effort required |
| 46 | # for NaCl JIT support. The nacl_target_arch variable provides |
| 47 | # the 'true' target arch for places in this file that need it. |
| 48 | # TODO(bradchen): get rid of nacl_target_arch when someday |
| 49 | # NaCl V8 builds stop using the ARM simulator |
| 50 | 'nacl_target_arch%': 'none', # must be set externally |
| 51 | |
| 52 | # Setting 'v8_can_use_vfp32dregs' to 'true' will cause V8 to use the VFP |
| 53 | # registers d16-d31 in the generated code, both in the snapshot and for the |
| 54 | # ARM target. Leaving the default value of 'false' will avoid the use of |
| 55 | # these registers in the snapshot and use CPU feature probing when running |
| 56 | # on the target. |
| 57 | 'v8_can_use_vfp32dregs%': 'false', |
| 58 | 'arm_test_noprobe%': 'off', |
| 59 | |
| 60 | # Similar to vfp but on MIPS. |
| 61 | 'v8_can_use_fpu_instructions%': 'true', |
| 62 | |
| 63 | # Similar to the ARM hard float ABI but on MIPS. |
| 64 | 'v8_use_mips_abi_hardfloat%': 'true', |
| 65 | |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 66 | # Force disable libstdc++ debug mode. |
| 67 | 'disable_glibcxx_debug%': 0, |
| 68 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 69 | 'v8_enable_backtrace%': 0, |
| 70 | |
| 71 | # Enable profiling support. Only required on Windows. |
| 72 | 'v8_enable_prof%': 0, |
| 73 | |
| 74 | # Some versions of GCC 4.5 seem to need -fno-strict-aliasing. |
| 75 | 'v8_no_strict_aliasing%': 0, |
| 76 | |
| 77 | # Chrome needs this definition unconditionally. For standalone V8 builds, |
Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 78 | # it's handled in gypfiles/standalone.gypi. |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 79 | 'want_separate_host_toolset%': 1, |
| 80 | |
Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 81 | # Toolset the shell binary should be compiled for. Possible values are |
| 82 | # 'host' and 'target'. |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 83 | # The setting is ignored if want_separate_host_toolset is 0. |
Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 84 | 'v8_toolset_for_shell%': 'target', |
Ben Murdoch | 097c5b2 | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 85 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 86 | 'host_os%': '<(OS)', |
| 87 | 'werror%': '-Werror', |
| 88 | # For a shared library build, results in "libv8-<(soname_version).so". |
| 89 | 'soname_version%': '', |
| 90 | |
| 91 | # Allow to suppress the array bounds warning (default is no suppression). |
| 92 | 'wno_array_bounds%': '', |
| 93 | |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 94 | # Override where to find binutils |
| 95 | 'binutils_dir%': '', |
| 96 | |
| 97 | 'conditions': [ |
| 98 | ['OS=="linux" and host_arch=="x64"', { |
| 99 | 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin', |
| 100 | }], |
| 101 | ['OS=="linux" and host_arch=="ia32"', { |
| 102 | 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin', |
| 103 | }], |
| 104 | |
| 105 | # linux_use_bundled_gold: whether to use the gold linker binary checked |
| 106 | # into third_party/binutils. Force this off via GYP_DEFINES when you |
| 107 | # are using a custom toolchain and need to control -B in ldflags. |
| 108 | # Do not use 32-bit gold on 32-bit hosts as it runs out address space |
| 109 | # for component=static_library builds. |
| 110 | ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', { |
| 111 | 'linux_use_bundled_gold%': 1, |
| 112 | }, { |
| 113 | 'linux_use_bundled_gold%': 0, |
| 114 | }], |
| 115 | # linux_use_bundled_binutils: whether to use the binary binutils |
| 116 | # checked into third_party/binutils. These are not multi-arch so cannot |
| 117 | # be used except on x86 and x86-64 (the only two architectures which |
| 118 | # are currently checke in). Force this off via GYP_DEFINES when you |
| 119 | # are using a custom toolchain and need to control -B in cflags. |
| 120 | ['OS=="linux" and (target_arch=="ia32" or target_arch=="x64")', { |
| 121 | 'linux_use_bundled_binutils%': 1, |
| 122 | }, { |
| 123 | 'linux_use_bundled_binutils%': 0, |
| 124 | }], |
| 125 | # linux_use_gold_flags: whether to use build flags that rely on gold. |
| 126 | # On by default for x64 Linux. |
| 127 | ['OS=="linux" and target_arch=="x64"', { |
| 128 | 'linux_use_gold_flags%': 1, |
| 129 | }, { |
| 130 | 'linux_use_gold_flags%': 0, |
| 131 | }], |
| 132 | ], |
| 133 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 134 | # Link-Time Optimizations |
| 135 | 'use_lto%': 0, |
Ben Murdoch | 61f157c | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 136 | |
| 137 | # Indicates if gcmole tools are downloaded by a hook. |
| 138 | 'gcmole%': 0, |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 139 | }, |
| 140 | 'conditions': [ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 141 | ['host_arch=="ia32" or host_arch=="x64" or \ |
| 142 | host_arch=="ppc" or host_arch=="ppc64" or \ |
| 143 | host_arch=="s390" or host_arch=="s390x" or \ |
| 144 | clang==1', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 145 | 'variables': { |
| 146 | 'host_cxx_is_biarch%': 1, |
| 147 | }, |
| 148 | }, { |
| 149 | 'variables': { |
| 150 | 'host_cxx_is_biarch%': 0, |
| 151 | }, |
| 152 | }], |
| 153 | ['target_arch=="ia32" or target_arch=="x64" or target_arch=="x87" or \ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 154 | target_arch=="ppc" or target_arch=="ppc64" or target_arch=="s390" or \ |
| 155 | target_arch=="s390x" or clang==1', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 156 | 'variables': { |
| 157 | 'target_cxx_is_biarch%': 1, |
| 158 | }, |
| 159 | }, { |
| 160 | 'variables': { |
| 161 | 'target_cxx_is_biarch%': 0, |
| 162 | }, |
| 163 | }], |
| 164 | ], |
| 165 | 'target_defaults': { |
| 166 | 'conditions': [ |
| 167 | ['v8_target_arch=="arm"', { |
| 168 | 'defines': [ |
| 169 | 'V8_TARGET_ARCH_ARM', |
| 170 | ], |
| 171 | 'conditions': [ |
| 172 | [ 'arm_version==7 or arm_version=="default"', { |
| 173 | 'defines': [ |
| 174 | 'CAN_USE_ARMV7_INSTRUCTIONS', |
| 175 | ], |
| 176 | }], |
| 177 | [ 'arm_fpu=="vfpv3-d16" or arm_fpu=="default"', { |
| 178 | 'defines': [ |
| 179 | 'CAN_USE_VFP3_INSTRUCTIONS', |
| 180 | ], |
| 181 | }], |
| 182 | [ 'arm_fpu=="vfpv3"', { |
| 183 | 'defines': [ |
| 184 | 'CAN_USE_VFP3_INSTRUCTIONS', |
| 185 | 'CAN_USE_VFP32DREGS', |
| 186 | ], |
| 187 | }], |
| 188 | [ 'arm_fpu=="neon"', { |
| 189 | 'defines': [ |
| 190 | 'CAN_USE_VFP3_INSTRUCTIONS', |
| 191 | 'CAN_USE_VFP32DREGS', |
| 192 | 'CAN_USE_NEON', |
| 193 | ], |
| 194 | }], |
| 195 | [ 'arm_test_noprobe=="on"', { |
| 196 | 'defines': [ |
| 197 | 'ARM_TEST_NO_FEATURE_PROBE', |
| 198 | ], |
| 199 | }], |
| 200 | ], |
| 201 | 'target_conditions': [ |
| 202 | ['_toolset=="host"', { |
| 203 | 'conditions': [ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 204 | ['v8_target_arch==host_arch', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 205 | # Host built with an Arm CXX compiler. |
| 206 | 'conditions': [ |
| 207 | [ 'arm_version==7', { |
| 208 | 'cflags': ['-march=armv7-a',], |
| 209 | }], |
| 210 | [ 'arm_version==7 or arm_version=="default"', { |
| 211 | 'conditions': [ |
| 212 | [ 'arm_fpu!="default"', { |
| 213 | 'cflags': ['-mfpu=<(arm_fpu)',], |
| 214 | }], |
| 215 | ], |
| 216 | }], |
| 217 | [ 'arm_float_abi!="default"', { |
| 218 | 'cflags': ['-mfloat-abi=<(arm_float_abi)',], |
| 219 | }], |
| 220 | [ 'arm_thumb==1', { |
| 221 | 'cflags': ['-mthumb',], |
| 222 | }], |
| 223 | [ 'arm_thumb==0', { |
| 224 | 'cflags': ['-marm',], |
| 225 | }], |
| 226 | ], |
| 227 | }, { |
| 228 | # 'v8_target_arch!=host_arch' |
| 229 | # Host not built with an Arm CXX compiler (simulator build). |
| 230 | 'conditions': [ |
| 231 | [ 'arm_float_abi=="hard"', { |
| 232 | 'defines': [ |
| 233 | 'USE_EABI_HARDFLOAT=1', |
| 234 | ], |
| 235 | }], |
| 236 | [ 'arm_float_abi=="softfp" or arm_float_abi=="default"', { |
| 237 | 'defines': [ |
| 238 | 'USE_EABI_HARDFLOAT=0', |
| 239 | ], |
| 240 | }], |
| 241 | ], |
| 242 | }], |
| 243 | ], |
| 244 | }], # _toolset=="host" |
| 245 | ['_toolset=="target"', { |
| 246 | 'conditions': [ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 247 | ['v8_target_arch==target_arch', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 248 | # Target built with an Arm CXX compiler. |
| 249 | 'conditions': [ |
| 250 | [ 'arm_version==7', { |
| 251 | 'cflags': ['-march=armv7-a',], |
| 252 | }], |
| 253 | [ 'arm_version==7 or arm_version=="default"', { |
| 254 | 'conditions': [ |
| 255 | [ 'arm_fpu!="default"', { |
| 256 | 'cflags': ['-mfpu=<(arm_fpu)',], |
| 257 | }], |
| 258 | ], |
| 259 | }], |
| 260 | [ 'arm_float_abi!="default"', { |
| 261 | 'cflags': ['-mfloat-abi=<(arm_float_abi)',], |
| 262 | }], |
| 263 | [ 'arm_thumb==1', { |
| 264 | 'cflags': ['-mthumb',], |
| 265 | }], |
| 266 | [ 'arm_thumb==0', { |
| 267 | 'cflags': ['-marm',], |
| 268 | }], |
| 269 | ], |
| 270 | }, { |
| 271 | # 'v8_target_arch!=target_arch' |
| 272 | # Target not built with an Arm CXX compiler (simulator build). |
| 273 | 'conditions': [ |
| 274 | [ 'arm_float_abi=="hard"', { |
| 275 | 'defines': [ |
| 276 | 'USE_EABI_HARDFLOAT=1', |
| 277 | ], |
| 278 | }], |
| 279 | [ 'arm_float_abi=="softfp" or arm_float_abi=="default"', { |
| 280 | 'defines': [ |
| 281 | 'USE_EABI_HARDFLOAT=0', |
| 282 | ], |
| 283 | }], |
| 284 | ], |
| 285 | }], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 286 | # Disable GCC LTO for v8 |
| 287 | # v8 is optimized for speed. Because GCC LTO merges flags at link |
| 288 | # time, we disable LTO to prevent any -O2 flags from taking |
| 289 | # precedence over v8's -Os flag. However, LLVM LTO does not work |
| 290 | # this way so we keep LTO enabled under LLVM. |
| 291 | ['clang==0 and use_lto==1', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 292 | 'cflags!': [ |
| 293 | '-flto', |
| 294 | '-ffat-lto-objects', |
| 295 | ], |
| 296 | }], |
| 297 | ], |
| 298 | }], # _toolset=="target" |
| 299 | ], |
| 300 | }], # v8_target_arch=="arm" |
| 301 | ['v8_target_arch=="arm64"', { |
| 302 | 'defines': [ |
| 303 | 'V8_TARGET_ARCH_ARM64', |
| 304 | ], |
| 305 | }], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 306 | ['v8_target_arch=="s390" or v8_target_arch=="s390x"', { |
| 307 | 'defines': [ |
| 308 | 'V8_TARGET_ARCH_S390', |
| 309 | ], |
| 310 | 'conditions': [ |
| 311 | ['v8_target_arch=="s390x"', { |
| 312 | 'defines': [ |
| 313 | 'V8_TARGET_ARCH_S390X', |
| 314 | ], |
| 315 | }], |
| 316 | ['v8_host_byteorder=="little"', { |
| 317 | 'defines': [ |
| 318 | 'V8_TARGET_ARCH_S390_LE_SIM', |
| 319 | ], |
| 320 | }], |
| 321 | ], |
| 322 | }], # s390 |
| 323 | ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', { |
| 324 | 'defines': [ |
| 325 | 'V8_TARGET_ARCH_PPC', |
| 326 | ], |
| 327 | 'conditions': [ |
| 328 | ['v8_target_arch=="ppc64"', { |
| 329 | 'defines': [ |
| 330 | 'V8_TARGET_ARCH_PPC64', |
| 331 | ], |
| 332 | }], |
| 333 | ['v8_host_byteorder=="little"', { |
| 334 | 'defines': [ |
| 335 | 'V8_TARGET_ARCH_PPC_LE', |
| 336 | ], |
| 337 | }], |
| 338 | ['v8_host_byteorder=="big"', { |
| 339 | 'defines': [ |
| 340 | 'V8_TARGET_ARCH_PPC_BE', |
| 341 | ], |
| 342 | 'conditions': [ |
| 343 | ['OS=="aix"', { |
| 344 | # Work around AIX ceil, trunc and round oddities. |
| 345 | 'cflags': [ '-mcpu=power5+ -mfprnd' ], |
| 346 | }], |
| 347 | ['OS=="aix"', { |
| 348 | # Work around AIX assembler popcntb bug. |
| 349 | 'cflags': [ '-mno-popcntb' ], |
| 350 | }], |
| 351 | ], |
| 352 | }], |
| 353 | ], |
| 354 | }], # ppc |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 355 | ['v8_target_arch=="ia32"', { |
| 356 | 'defines': [ |
| 357 | 'V8_TARGET_ARCH_IA32', |
| 358 | ], |
| 359 | }], # v8_target_arch=="ia32" |
| 360 | ['v8_target_arch=="x87"', { |
| 361 | 'defines': [ |
| 362 | 'V8_TARGET_ARCH_X87', |
| 363 | ], |
| 364 | 'cflags': ['-march=i586'], |
| 365 | }], # v8_target_arch=="x87" |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 366 | ['(v8_target_arch=="mips" or v8_target_arch=="mipsel" \ |
| 367 | or v8_target_arch=="mips64" or v8_target_arch=="mips64el") \ |
| 368 | and v8_target_arch==target_arch', { |
| 369 | 'target_conditions': [ |
| 370 | ['_toolset=="target"', { |
| 371 | # Target built with a Mips CXX compiler. |
| 372 | 'variables': { |
| 373 | 'ldso_path%': '<!(/bin/echo -n $LDSO_PATH)', |
| 374 | 'ld_r_path%': '<!(/bin/echo -n $LD_R_PATH)', |
| 375 | }, |
| 376 | 'conditions': [ |
| 377 | ['ldso_path!=""', { |
| 378 | 'ldflags': ['-Wl,--dynamic-linker=<(ldso_path)'], |
| 379 | }], |
| 380 | ['ld_r_path!=""', { |
| 381 | 'ldflags': ['-Wl,--rpath=<(ld_r_path)'], |
| 382 | }], |
| 383 | [ 'clang==1', { |
| 384 | 'cflags': ['-integrated-as'], |
| 385 | }], |
| 386 | ], |
| 387 | }], |
| 388 | ], |
| 389 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 390 | ['v8_target_arch=="mips"', { |
| 391 | 'defines': [ |
| 392 | 'V8_TARGET_ARCH_MIPS', |
| 393 | ], |
| 394 | 'conditions': [ |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 395 | [ 'v8_can_use_fpu_instructions=="true"', { |
| 396 | 'defines': [ |
| 397 | 'CAN_USE_FPU_INSTRUCTIONS', |
| 398 | ], |
| 399 | }], |
| 400 | [ 'v8_use_mips_abi_hardfloat=="true"', { |
| 401 | 'defines': [ |
| 402 | '__mips_hard_float=1', |
| 403 | 'CAN_USE_FPU_INSTRUCTIONS', |
| 404 | ], |
| 405 | }, { |
| 406 | 'defines': [ |
| 407 | '__mips_soft_float=1' |
| 408 | ] |
| 409 | }], |
| 410 | ], |
| 411 | 'target_conditions': [ |
| 412 | ['_toolset=="target"', { |
| 413 | 'conditions': [ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 414 | ['v8_target_arch==target_arch', { |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 415 | # Target built with a Mips CXX compiler. |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 416 | 'cflags': [ |
| 417 | '-EB', |
| 418 | '-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273 |
| 419 | ], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 420 | 'ldflags': ['-EB'], |
| 421 | 'conditions': [ |
| 422 | [ 'v8_use_mips_abi_hardfloat=="true"', { |
| 423 | 'cflags': ['-mhard-float'], |
| 424 | 'ldflags': ['-mhard-float'], |
| 425 | }, { |
| 426 | 'cflags': ['-msoft-float'], |
| 427 | 'ldflags': ['-msoft-float'], |
| 428 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 429 | ['mips_arch_variant=="r6"', { |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 430 | 'defines': [ |
| 431 | '_MIPS_ARCH_MIPS32R6', |
| 432 | 'FPU_MODE_FP64', |
| 433 | ], |
| 434 | 'cflags!': ['-mfp32', '-mfpxx'], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 435 | 'conditions': [ |
| 436 | [ 'clang==0', { |
| 437 | 'cflags': ['-Wa,-mips32r6'], |
| 438 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 439 | ], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 440 | 'cflags': ['-mips32r6'], |
| 441 | 'ldflags': ['-mips32r6'], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 442 | }], |
| 443 | ['mips_arch_variant=="r2"', { |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 444 | 'conditions': [ |
| 445 | [ 'mips_fpu_mode=="fp64"', { |
| 446 | 'defines': [ |
| 447 | '_MIPS_ARCH_MIPS32R2', |
| 448 | 'FPU_MODE_FP64', |
| 449 | ], |
| 450 | 'cflags': ['-mfp64'], |
| 451 | }], |
| 452 | ['mips_fpu_mode=="fpxx"', { |
| 453 | 'defines': [ |
| 454 | '_MIPS_ARCH_MIPS32R2', |
| 455 | 'FPU_MODE_FPXX', |
| 456 | ], |
| 457 | 'cflags': ['-mfpxx'], |
| 458 | }], |
| 459 | ['mips_fpu_mode=="fp32"', { |
| 460 | 'defines': [ |
| 461 | '_MIPS_ARCH_MIPS32R2', |
| 462 | 'FPU_MODE_FP32', |
| 463 | ], |
| 464 | 'cflags': ['-mfp32'], |
| 465 | }], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 466 | [ 'clang==0', { |
| 467 | 'cflags': ['-Wa,-mips32r2'], |
| 468 | }], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 469 | ], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 470 | 'cflags': ['-mips32r2'], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 471 | 'ldflags': ['-mips32r2'], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 472 | }], |
| 473 | ['mips_arch_variant=="r1"', { |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 474 | 'defines': [ |
| 475 | 'FPU_MODE_FP32', |
| 476 | ], |
| 477 | 'cflags!': ['-mfp64', '-mfpxx'], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 478 | 'conditions': [ |
| 479 | [ 'clang==0', { |
| 480 | 'cflags': ['-Wa,-mips32'], |
| 481 | }], |
| 482 | ], |
| 483 | 'cflags': ['-mips32'], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 484 | 'ldflags': ['-mips32'], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 485 | }], |
| 486 | ['mips_arch_variant=="rx"', { |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 487 | 'defines': [ |
| 488 | '_MIPS_ARCH_MIPS32RX', |
| 489 | 'FPU_MODE_FPXX', |
| 490 | ], |
| 491 | 'cflags!': ['-mfp64', '-mfp32'], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 492 | 'conditions': [ |
| 493 | [ 'clang==0', { |
| 494 | 'cflags': ['-Wa,-mips32'], |
| 495 | }], |
| 496 | ], |
| 497 | 'cflags': ['-mips32', '-mfpxx'], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 498 | 'ldflags': ['-mips32'], |
| 499 | }], |
| 500 | ], |
| 501 | }, { |
| 502 | # 'v8_target_arch!=target_arch' |
| 503 | # Target not built with an MIPS CXX compiler (simulator build). |
| 504 | 'conditions': [ |
| 505 | ['mips_arch_variant=="r6"', { |
| 506 | 'defines': [ |
| 507 | '_MIPS_ARCH_MIPS32R6', |
| 508 | 'FPU_MODE_FP64', |
| 509 | ], |
| 510 | }], |
| 511 | ['mips_arch_variant=="r2"', { |
| 512 | 'conditions': [ |
| 513 | [ 'mips_fpu_mode=="fp64"', { |
| 514 | 'defines': [ |
| 515 | '_MIPS_ARCH_MIPS32R2', |
| 516 | 'FPU_MODE_FP64', |
| 517 | ], |
| 518 | }], |
| 519 | ['mips_fpu_mode=="fpxx"', { |
| 520 | 'defines': [ |
| 521 | '_MIPS_ARCH_MIPS32R2', |
| 522 | 'FPU_MODE_FPXX', |
| 523 | ], |
| 524 | }], |
| 525 | ['mips_fpu_mode=="fp32"', { |
| 526 | 'defines': [ |
| 527 | '_MIPS_ARCH_MIPS32R2', |
| 528 | 'FPU_MODE_FP32', |
| 529 | ], |
| 530 | }], |
| 531 | ], |
| 532 | }], |
| 533 | ['mips_arch_variant=="r1"', { |
| 534 | 'defines': [ |
| 535 | 'FPU_MODE_FP32', |
| 536 | ], |
| 537 | }], |
| 538 | ['mips_arch_variant=="rx"', { |
| 539 | 'defines': [ |
| 540 | '_MIPS_ARCH_MIPS32RX', |
| 541 | 'FPU_MODE_FPXX', |
| 542 | ], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 543 | }], |
| 544 | ], |
| 545 | }], |
| 546 | ], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 547 | }], #_toolset=="target" |
| 548 | ['_toolset=="host"', { |
| 549 | 'conditions': [ |
| 550 | ['mips_arch_variant=="rx"', { |
| 551 | 'defines': [ |
| 552 | '_MIPS_ARCH_MIPS32RX', |
| 553 | 'FPU_MODE_FPXX', |
| 554 | ], |
| 555 | }], |
| 556 | ['mips_arch_variant=="r6"', { |
| 557 | 'defines': [ |
| 558 | '_MIPS_ARCH_MIPS32R6', |
| 559 | 'FPU_MODE_FP64', |
| 560 | ], |
| 561 | }], |
| 562 | ['mips_arch_variant=="r2"', { |
| 563 | 'conditions': [ |
| 564 | ['mips_fpu_mode=="fp64"', { |
| 565 | 'defines': [ |
| 566 | '_MIPS_ARCH_MIPS32R2', |
| 567 | 'FPU_MODE_FP64', |
| 568 | ], |
| 569 | }], |
| 570 | ['mips_fpu_mode=="fpxx"', { |
| 571 | 'defines': [ |
| 572 | '_MIPS_ARCH_MIPS32R2', |
| 573 | 'FPU_MODE_FPXX', |
| 574 | ], |
| 575 | }], |
| 576 | ['mips_fpu_mode=="fp32"', { |
| 577 | 'defines': [ |
| 578 | '_MIPS_ARCH_MIPS32R2', |
| 579 | 'FPU_MODE_FP32' |
| 580 | ], |
| 581 | }], |
| 582 | ], |
| 583 | }], |
| 584 | ['mips_arch_variant=="r1"', { |
| 585 | 'defines': ['FPU_MODE_FP32',], |
| 586 | }], |
| 587 | ] |
| 588 | }], #_toolset=="host" |
| 589 | ], |
| 590 | }], # v8_target_arch=="mips" |
| 591 | ['v8_target_arch=="mipsel"', { |
| 592 | 'defines': [ |
| 593 | 'V8_TARGET_ARCH_MIPS', |
| 594 | ], |
| 595 | 'conditions': [ |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 596 | [ 'v8_can_use_fpu_instructions=="true"', { |
| 597 | 'defines': [ |
| 598 | 'CAN_USE_FPU_INSTRUCTIONS', |
| 599 | ], |
| 600 | }], |
| 601 | [ 'v8_use_mips_abi_hardfloat=="true"', { |
| 602 | 'defines': [ |
| 603 | '__mips_hard_float=1', |
| 604 | 'CAN_USE_FPU_INSTRUCTIONS', |
| 605 | ], |
| 606 | }, { |
| 607 | 'defines': [ |
| 608 | '__mips_soft_float=1' |
| 609 | ], |
| 610 | }], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 611 | ], |
| 612 | 'target_conditions': [ |
| 613 | ['_toolset=="target"', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 614 | 'conditions': [ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 615 | ['v8_target_arch==target_arch', { |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 616 | # Target built with a Mips CXX compiler. |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 617 | 'cflags': [ |
| 618 | '-EL', |
| 619 | '-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273 |
| 620 | ], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 621 | 'ldflags': ['-EL'], |
| 622 | 'conditions': [ |
| 623 | [ 'v8_use_mips_abi_hardfloat=="true"', { |
| 624 | 'cflags': ['-mhard-float'], |
| 625 | 'ldflags': ['-mhard-float'], |
| 626 | }, { |
| 627 | 'cflags': ['-msoft-float'], |
| 628 | 'ldflags': ['-msoft-float'], |
| 629 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 630 | ['mips_arch_variant=="r6"', { |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 631 | 'defines': [ |
| 632 | '_MIPS_ARCH_MIPS32R6', |
| 633 | 'FPU_MODE_FP64', |
| 634 | ], |
| 635 | 'cflags!': ['-mfp32', '-mfpxx'], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 636 | 'conditions': [ |
| 637 | [ 'clang==0', { |
| 638 | 'cflags': ['-Wa,-mips32r6'], |
| 639 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 640 | ], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 641 | 'cflags': ['-mips32r6'], |
| 642 | 'ldflags': ['-mips32r6'], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 643 | }], |
| 644 | ['mips_arch_variant=="r2"', { |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 645 | 'conditions': [ |
| 646 | [ 'mips_fpu_mode=="fp64"', { |
| 647 | 'defines': [ |
| 648 | '_MIPS_ARCH_MIPS32R2', |
| 649 | 'FPU_MODE_FP64', |
| 650 | ], |
| 651 | 'cflags': ['-mfp64'], |
| 652 | }], |
| 653 | ['mips_fpu_mode=="fpxx"', { |
| 654 | 'defines': [ |
| 655 | '_MIPS_ARCH_MIPS32R2', |
| 656 | 'FPU_MODE_FPXX', |
| 657 | ], |
| 658 | 'cflags': ['-mfpxx'], |
| 659 | }], |
| 660 | ['mips_fpu_mode=="fp32"', { |
| 661 | 'defines': [ |
| 662 | '_MIPS_ARCH_MIPS32R2', |
| 663 | 'FPU_MODE_FP32', |
| 664 | ], |
| 665 | 'cflags': ['-mfp32'], |
| 666 | }], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 667 | [ 'clang==0', { |
| 668 | 'cflags': ['-Wa,-mips32r2'], |
| 669 | }], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 670 | ], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 671 | 'cflags': ['-mips32r2'], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 672 | 'ldflags': ['-mips32r2'], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 673 | }], |
| 674 | ['mips_arch_variant=="r1"', { |
Ben Murdoch | c561043 | 2016-08-08 18:44:38 +0100 | [diff] [blame] | 675 | 'defines': [ |
| 676 | 'FPU_MODE_FP32', |
| 677 | ], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 678 | 'cflags!': ['-mfp64', '-mfpxx'], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 679 | 'conditions': [ |
| 680 | [ 'clang==0', { |
| 681 | 'cflags': ['-Wa,-mips32'], |
| 682 | }], |
| 683 | ], |
| 684 | 'cflags': ['-mips32'], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 685 | 'ldflags': ['-mips32'], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 686 | }], |
| 687 | ['mips_arch_variant=="rx"', { |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 688 | 'defines': [ |
| 689 | '_MIPS_ARCH_MIPS32RX', |
| 690 | 'FPU_MODE_FPXX', |
| 691 | ], |
| 692 | 'cflags!': ['-mfp64', '-mfp32'], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 693 | 'conditions': [ |
| 694 | [ 'clang==0', { |
| 695 | 'cflags': ['-Wa,-mips32'], |
| 696 | }], |
| 697 | ], |
| 698 | 'cflags': ['-mips32', '-mfpxx'], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 699 | 'ldflags': ['-mips32'], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 700 | }], |
| 701 | ['mips_arch_variant=="loongson"', { |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 702 | 'defines': [ |
| 703 | '_MIPS_ARCH_LOONGSON', |
| 704 | 'FPU_MODE_FP32', |
| 705 | ], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 706 | 'cflags!': ['-mfp64', '-mfpxx'], |
| 707 | 'conditions': [ |
| 708 | [ 'clang==0', { |
| 709 | 'cflags': ['-Wa,-mips3'], |
| 710 | }], |
| 711 | ], |
| 712 | 'cflags': ['-mips3', '-mfp32'], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 713 | }], |
| 714 | ], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 715 | }, { |
| 716 | # 'v8_target_arch!=target_arch' |
| 717 | # Target not built with an MIPS CXX compiler (simulator build). |
| 718 | 'conditions': [ |
| 719 | ['mips_arch_variant=="r6"', { |
| 720 | 'defines': [ |
| 721 | '_MIPS_ARCH_MIPS32R6', |
| 722 | 'FPU_MODE_FP64', |
| 723 | ], |
| 724 | }], |
| 725 | ['mips_arch_variant=="r2"', { |
| 726 | 'conditions': [ |
| 727 | [ 'mips_fpu_mode=="fp64"', { |
| 728 | 'defines': [ |
| 729 | '_MIPS_ARCH_MIPS32R2', |
| 730 | 'FPU_MODE_FP64', |
| 731 | ], |
| 732 | }], |
| 733 | ['mips_fpu_mode=="fpxx"', { |
| 734 | 'defines': [ |
| 735 | '_MIPS_ARCH_MIPS32R2', |
| 736 | 'FPU_MODE_FPXX', |
| 737 | ], |
| 738 | }], |
| 739 | ['mips_fpu_mode=="fp32"', { |
| 740 | 'defines': [ |
| 741 | '_MIPS_ARCH_MIPS32R2', |
| 742 | 'FPU_MODE_FP32', |
| 743 | ], |
| 744 | }], |
| 745 | ], |
| 746 | }], |
| 747 | ['mips_arch_variant=="r1"', { |
| 748 | 'defines': [ |
| 749 | 'FPU_MODE_FP32', |
| 750 | ], |
| 751 | }], |
| 752 | ['mips_arch_variant=="rx"', { |
| 753 | 'defines': [ |
| 754 | '_MIPS_ARCH_MIPS32RX', |
| 755 | 'FPU_MODE_FPXX', |
| 756 | ], |
| 757 | }], |
| 758 | ['mips_arch_variant=="loongson"', { |
| 759 | 'defines': [ |
| 760 | '_MIPS_ARCH_LOONGSON', |
| 761 | 'FPU_MODE_FP32', |
| 762 | ], |
| 763 | }], |
| 764 | ], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 765 | }], |
| 766 | ], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 767 | }], #_toolset=="target |
| 768 | ['_toolset=="host"', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 769 | 'conditions': [ |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 770 | ['mips_arch_variant=="rx"', { |
| 771 | 'defines': [ |
| 772 | '_MIPS_ARCH_MIPS32RX', |
| 773 | 'FPU_MODE_FPXX', |
| 774 | ], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 775 | }], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 776 | ['mips_arch_variant=="r6"', { |
| 777 | 'defines': [ |
| 778 | '_MIPS_ARCH_MIPS32R6', |
| 779 | 'FPU_MODE_FP64', |
| 780 | ], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 781 | }], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 782 | ['mips_arch_variant=="r2"', { |
| 783 | 'conditions': [ |
| 784 | ['mips_fpu_mode=="fp64"', { |
| 785 | 'defines': [ |
| 786 | '_MIPS_ARCH_MIPS32R2', |
| 787 | 'FPU_MODE_FP64', |
| 788 | ], |
| 789 | }], |
| 790 | ['mips_fpu_mode=="fpxx"', { |
| 791 | 'defines': [ |
| 792 | '_MIPS_ARCH_MIPS32R2', |
| 793 | 'FPU_MODE_FPXX', |
| 794 | ], |
| 795 | }], |
| 796 | ['mips_fpu_mode=="fp32"', { |
| 797 | 'defines': [ |
| 798 | '_MIPS_ARCH_MIPS32R2', |
| 799 | 'FPU_MODE_FP32' |
| 800 | ], |
| 801 | }], |
| 802 | ], |
| 803 | }], |
| 804 | ['mips_arch_variant=="r1"', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 805 | 'defines': ['FPU_MODE_FP32',], |
| 806 | }], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 807 | ['mips_arch_variant=="loongson"', { |
| 808 | 'defines': [ |
| 809 | '_MIPS_ARCH_LOONGSON', |
| 810 | 'FPU_MODE_FP32', |
| 811 | ], |
| 812 | }], |
| 813 | ] |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 814 | }], |
| 815 | ], |
| 816 | }], # v8_target_arch=="mipsel" |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 817 | ['v8_target_arch=="mips64el" or v8_target_arch=="mips64"', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 818 | 'defines': [ |
| 819 | 'V8_TARGET_ARCH_MIPS64', |
| 820 | ], |
| 821 | 'conditions': [ |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 822 | [ 'v8_can_use_fpu_instructions=="true"', { |
| 823 | 'defines': [ |
| 824 | 'CAN_USE_FPU_INSTRUCTIONS', |
| 825 | ], |
| 826 | }], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 827 | [ 'v8_host_byteorder=="little"', { |
| 828 | 'defines': [ |
| 829 | 'V8_TARGET_ARCH_MIPS64_LE', |
| 830 | ], |
| 831 | }], |
| 832 | [ 'v8_host_byteorder=="big"', { |
| 833 | 'defines': [ |
| 834 | 'V8_TARGET_ARCH_MIPS64_BE', |
| 835 | ], |
| 836 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 837 | [ 'v8_use_mips_abi_hardfloat=="true"', { |
| 838 | 'defines': [ |
| 839 | '__mips_hard_float=1', |
| 840 | 'CAN_USE_FPU_INSTRUCTIONS', |
| 841 | ], |
| 842 | }, { |
| 843 | 'defines': [ |
| 844 | '__mips_soft_float=1' |
| 845 | ], |
| 846 | }], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 847 | ], |
| 848 | 'target_conditions': [ |
| 849 | ['_toolset=="target"', { |
| 850 | 'conditions': [ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 851 | ['v8_target_arch==target_arch', { |
| 852 | 'cflags': [ |
| 853 | '-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273 |
| 854 | ], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 855 | 'conditions': [ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 856 | ['v8_target_arch=="mips64el"', { |
| 857 | 'cflags': ['-EL'], |
| 858 | 'ldflags': ['-EL'], |
| 859 | }], |
| 860 | ['v8_target_arch=="mips64"', { |
| 861 | 'cflags': ['-EB'], |
| 862 | 'ldflags': ['-EB'], |
| 863 | }], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 864 | [ 'v8_use_mips_abi_hardfloat=="true"', { |
| 865 | 'cflags': ['-mhard-float'], |
| 866 | 'ldflags': ['-mhard-float'], |
| 867 | }, { |
| 868 | 'cflags': ['-msoft-float'], |
| 869 | 'ldflags': ['-msoft-float'], |
| 870 | }], |
| 871 | ['mips_arch_variant=="r6"', { |
| 872 | 'defines': ['_MIPS_ARCH_MIPS64R6',], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 873 | 'conditions': [ |
| 874 | [ 'clang==0', { |
| 875 | 'cflags': ['-Wa,-mips64r6'], |
| 876 | }], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 877 | ], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 878 | 'cflags': ['-mips64r6', '-mabi=64'], |
| 879 | 'ldflags': ['-mips64r6', '-mabi=64'], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 880 | }], |
| 881 | ['mips_arch_variant=="r2"', { |
| 882 | 'defines': ['_MIPS_ARCH_MIPS64R2',], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 883 | 'conditions': [ |
| 884 | [ 'clang==0', { |
| 885 | 'cflags': ['-Wa,-mips64r2'], |
| 886 | }], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 887 | ], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 888 | 'cflags': ['-mips64r2', '-mabi=64'], |
| 889 | 'ldflags': ['-mips64r2', '-mabi=64'], |
Paul Lind | 18a7ebb | 2014-12-17 22:29:32 -0800 | [diff] [blame] | 890 | }], |
| 891 | ], |
| 892 | }, { |
| 893 | # 'v8_target_arch!=target_arch' |
| 894 | # Target not built with an MIPS CXX compiler (simulator build). |
| 895 | 'conditions': [ |
| 896 | ['mips_arch_variant=="r6"', { |
| 897 | 'defines': ['_MIPS_ARCH_MIPS64R6',], |
| 898 | }], |
| 899 | ['mips_arch_variant=="r2"', { |
| 900 | 'defines': ['_MIPS_ARCH_MIPS64R2',], |
| 901 | }], |
| 902 | ], |
| 903 | }], |
| 904 | ], |
| 905 | }], #'_toolset=="target" |
| 906 | ['_toolset=="host"', { |
| 907 | 'conditions': [ |
| 908 | ['mips_arch_variant=="r6"', { |
| 909 | 'defines': ['_MIPS_ARCH_MIPS64R6',], |
| 910 | }], |
| 911 | ['mips_arch_variant=="r2"', { |
| 912 | 'defines': ['_MIPS_ARCH_MIPS64R2',], |
| 913 | }], |
| 914 | ], |
| 915 | }], #'_toolset=="host" |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 916 | ], |
| 917 | }], # v8_target_arch=="mips64el" |
| 918 | ['v8_target_arch=="x64"', { |
| 919 | 'defines': [ |
| 920 | 'V8_TARGET_ARCH_X64', |
| 921 | ], |
| 922 | 'xcode_settings': { |
| 923 | 'ARCHS': [ 'x86_64' ], |
| 924 | }, |
| 925 | 'msvs_settings': { |
| 926 | 'VCLinkerTool': { |
| 927 | 'StackReserveSize': '2097152', |
| 928 | }, |
| 929 | }, |
| 930 | 'msvs_configuration_platform': 'x64', |
| 931 | }], # v8_target_arch=="x64" |
| 932 | ['v8_target_arch=="x32"', { |
| 933 | 'defines': [ |
| 934 | # x32 port shares the source code with x64 port. |
| 935 | 'V8_TARGET_ARCH_X64', |
| 936 | 'V8_TARGET_ARCH_32_BIT', |
| 937 | ], |
| 938 | 'cflags': [ |
| 939 | '-mx32', |
| 940 | # Inhibit warning if long long type is used. |
| 941 | '-Wno-long-long', |
| 942 | ], |
| 943 | 'ldflags': [ |
| 944 | '-mx32', |
| 945 | ], |
| 946 | }], # v8_target_arch=="x32" |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 947 | ['linux_use_gold_flags==1', { |
| 948 | # Newer gccs and clangs support -fuse-ld, use the flag to force gold |
| 949 | # selection. |
| 950 | # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html |
| 951 | 'ldflags': [ '-fuse-ld=gold', ], |
| 952 | }], |
| 953 | ['linux_use_bundled_binutils==1', { |
| 954 | 'cflags': [ |
| 955 | '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)', |
| 956 | ], |
| 957 | }], |
| 958 | ['linux_use_bundled_gold==1', { |
| 959 | # Put our binutils, which contains gold in the search path. We pass |
| 960 | # the path to gold to the compiler. gyp leaves unspecified what the |
| 961 | # cwd is when running the compiler, so the normal gyp path-munging |
| 962 | # fails us. This hack gets the right path. |
| 963 | 'ldflags': [ |
| 964 | '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)', |
| 965 | ], |
| 966 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 967 | ['OS=="win"', { |
| 968 | 'defines': [ |
| 969 | 'WIN32', |
| 970 | ], |
| 971 | # 4351: VS 2005 and later are warning us that they've fixed a bug |
| 972 | # present in VS 2003 and earlier. |
| 973 | 'msvs_disabled_warnings': [4351], |
| 974 | 'msvs_configuration_attributes': { |
| 975 | 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)', |
| 976 | 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', |
| 977 | 'CharacterSet': '1', |
| 978 | }, |
| 979 | }], |
| 980 | ['OS=="win" and v8_target_arch=="ia32"', { |
| 981 | 'msvs_settings': { |
| 982 | 'VCCLCompilerTool': { |
| 983 | # Ensure no surprising artifacts from 80bit double math with x86. |
| 984 | 'AdditionalOptions': ['/arch:SSE2'], |
| 985 | }, |
| 986 | }, |
| 987 | }], |
| 988 | ['OS=="win" and v8_enable_prof==1', { |
| 989 | 'msvs_settings': { |
| 990 | 'VCLinkerTool': { |
| 991 | 'GenerateMapFile': 'true', |
| 992 | }, |
| 993 | }, |
| 994 | }], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 995 | ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ |
| 996 | or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \ |
| 997 | v8_target_arch=="ia32"', { |
| 998 | 'cflags': [ |
| 999 | '-msse2', |
| 1000 | '-mfpmath=sse', |
| 1001 | '-mmmx', # Allows mmintrin.h for MMX intrinsics. |
| 1002 | ], |
| 1003 | }], |
| 1004 | ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1005 | or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \ |
| 1006 | (v8_target_arch=="arm" or v8_target_arch=="ia32" or \ |
| 1007 | v8_target_arch=="x87" or v8_target_arch=="mips" or \ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1008 | v8_target_arch=="mipsel" or v8_target_arch=="ppc" or \ |
| 1009 | v8_target_arch=="s390")', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1010 | 'target_conditions': [ |
| 1011 | ['_toolset=="host"', { |
| 1012 | 'conditions': [ |
| 1013 | ['host_cxx_is_biarch==1', { |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1014 | 'conditions': [ |
| 1015 | ['host_arch=="s390" or host_arch=="s390x"', { |
| 1016 | 'cflags': [ '-m31' ], |
| 1017 | 'ldflags': [ '-m31' ] |
| 1018 | },{ |
| 1019 | 'cflags': [ '-m32' ], |
| 1020 | 'ldflags': [ '-m32' ] |
| 1021 | }], |
| 1022 | ], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1023 | }], |
| 1024 | ], |
| 1025 | 'xcode_settings': { |
| 1026 | 'ARCHS': [ 'i386' ], |
| 1027 | }, |
| 1028 | }], |
| 1029 | ['_toolset=="target"', { |
| 1030 | 'conditions': [ |
| 1031 | ['target_cxx_is_biarch==1 and nacl_target_arch!="nacl_x64"', { |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1032 | 'conditions': [ |
| 1033 | ['host_arch=="s390" or host_arch=="s390x"', { |
| 1034 | 'cflags': [ '-m31' ], |
| 1035 | 'ldflags': [ '-m31' ] |
| 1036 | },{ |
| 1037 | 'cflags': [ '-m32' ], |
| 1038 | 'ldflags': [ '-m32' ], |
| 1039 | }], |
| 1040 | ], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1041 | }], |
| 1042 | ], |
| 1043 | 'xcode_settings': { |
| 1044 | 'ARCHS': [ 'i386' ], |
| 1045 | }, |
| 1046 | }], |
| 1047 | ], |
| 1048 | }], |
| 1049 | ['(OS=="linux" or OS=="android") and \ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1050 | (v8_target_arch=="x64" or v8_target_arch=="arm64" or \ |
| 1051 | v8_target_arch=="ppc64" or v8_target_arch=="s390x")', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1052 | 'target_conditions': [ |
| 1053 | ['_toolset=="host"', { |
| 1054 | 'conditions': [ |
| 1055 | ['host_cxx_is_biarch==1', { |
| 1056 | 'cflags': [ '-m64' ], |
| 1057 | 'ldflags': [ '-m64' ] |
| 1058 | }], |
| 1059 | ], |
| 1060 | }], |
| 1061 | ['_toolset=="target"', { |
| 1062 | 'conditions': [ |
| 1063 | ['target_cxx_is_biarch==1', { |
| 1064 | 'cflags': [ '-m64' ], |
| 1065 | 'ldflags': [ '-m64' ], |
| 1066 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1067 | ] |
| 1068 | }], |
| 1069 | ], |
| 1070 | }], |
| 1071 | ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1072 | or OS=="netbsd" or OS=="qnx" or OS=="aix"', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1073 | 'conditions': [ |
| 1074 | [ 'v8_no_strict_aliasing==1', { |
| 1075 | 'cflags': [ '-fno-strict-aliasing' ], |
| 1076 | }], |
| 1077 | ], # conditions |
| 1078 | }], |
| 1079 | ['OS=="solaris"', { |
| 1080 | 'defines': [ '__C99FEATURES__=1' ], # isinf() etc. |
| 1081 | }], |
| 1082 | ['OS=="freebsd" or OS=="openbsd"', { |
| 1083 | 'cflags': [ '-I/usr/local/include' ], |
| 1084 | }], |
| 1085 | ['OS=="netbsd"', { |
| 1086 | 'cflags': [ '-I/usr/pkg/include' ], |
| 1087 | }], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1088 | ['OS=="aix"', { |
| 1089 | 'defines': [ |
| 1090 | # Support for malloc(0) |
| 1091 | '_LINUX_SOURCE_COMPAT=1', |
Ben Murdoch | 61f157c | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 1092 | '__STDC_FORMAT_MACROS', |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1093 | '_ALL_SOURCE=1'], |
| 1094 | 'conditions': [ |
| 1095 | [ 'v8_target_arch=="ppc"', { |
| 1096 | 'ldflags': [ '-Wl,-bmaxdata:0x60000000/dsa' ], |
| 1097 | }], |
| 1098 | [ 'v8_target_arch=="ppc64"', { |
| 1099 | 'cflags': [ '-maix64' ], |
Ben Murdoch | 61f157c | 2016-09-16 13:49:30 +0100 | [diff] [blame] | 1100 | 'ldflags': [ '-maix64 -Wl,-bbigtoc' ], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1101 | }], |
| 1102 | ], |
| 1103 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1104 | ], # conditions |
| 1105 | 'configurations': { |
| 1106 | # Abstract configuration for v8_optimized_debug == 0. |
| 1107 | 'DebugBase0': { |
| 1108 | 'abstract': 1, |
| 1109 | 'msvs_settings': { |
| 1110 | 'VCCLCompilerTool': { |
| 1111 | 'Optimization': '0', |
| 1112 | 'conditions': [ |
| 1113 | ['component=="shared_library"', { |
| 1114 | 'RuntimeLibrary': '3', # /MDd |
| 1115 | }, { |
| 1116 | 'RuntimeLibrary': '1', # /MTd |
| 1117 | }], |
| 1118 | ], |
| 1119 | }, |
| 1120 | 'VCLinkerTool': { |
| 1121 | 'LinkIncremental': '2', |
| 1122 | }, |
| 1123 | }, |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1124 | 'variables': { |
| 1125 | 'v8_enable_slow_dchecks%': 1, |
| 1126 | }, |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1127 | 'conditions': [ |
| 1128 | ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1129 | OS=="qnx" or OS=="aix"', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1130 | 'cflags!': [ |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1131 | '-O3', |
| 1132 | '-O2', |
| 1133 | '-O1', |
| 1134 | '-Os', |
| 1135 | ], |
| 1136 | 'cflags': [ |
| 1137 | '-fdata-sections', |
| 1138 | '-ffunction-sections', |
| 1139 | ], |
| 1140 | }], |
| 1141 | ['OS=="mac"', { |
| 1142 | 'xcode_settings': { |
| 1143 | 'GCC_OPTIMIZATION_LEVEL': '0', # -O0 |
| 1144 | }, |
| 1145 | }], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1146 | ['v8_enable_slow_dchecks==1', { |
| 1147 | 'defines': [ |
| 1148 | 'ENABLE_SLOW_DCHECKS', |
| 1149 | ], |
| 1150 | }], |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 1151 | ], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1152 | }, # DebugBase0 |
| 1153 | # Abstract configuration for v8_optimized_debug == 1. |
| 1154 | 'DebugBase1': { |
| 1155 | 'abstract': 1, |
| 1156 | 'msvs_settings': { |
| 1157 | 'VCCLCompilerTool': { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1158 | 'Optimization': '2', |
| 1159 | 'InlineFunctionExpansion': '2', |
| 1160 | 'EnableIntrinsicFunctions': 'true', |
| 1161 | 'FavorSizeOrSpeed': '0', |
| 1162 | 'StringPooling': 'true', |
| 1163 | 'BasicRuntimeChecks': '0', |
| 1164 | 'conditions': [ |
| 1165 | ['component=="shared_library"', { |
| 1166 | 'RuntimeLibrary': '3', #/MDd |
| 1167 | }, { |
| 1168 | 'RuntimeLibrary': '1', #/MTd |
| 1169 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1170 | ], |
| 1171 | }, |
| 1172 | 'VCLinkerTool': { |
| 1173 | 'LinkIncremental': '1', |
| 1174 | 'OptimizeReferences': '2', |
| 1175 | 'EnableCOMDATFolding': '2', |
| 1176 | }, |
| 1177 | }, |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1178 | 'variables': { |
| 1179 | 'v8_enable_slow_dchecks%': 0, |
| 1180 | }, |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1181 | 'conditions': [ |
| 1182 | ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1183 | OS=="qnx" or OS=="aix"', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1184 | 'cflags!': [ |
| 1185 | '-O0', |
| 1186 | '-O1', |
| 1187 | '-Os', |
| 1188 | ], |
| 1189 | 'cflags': [ |
| 1190 | '-fdata-sections', |
| 1191 | '-ffunction-sections', |
| 1192 | ], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1193 | 'conditions': [ |
| 1194 | # TODO(crbug.com/272548): Avoid -O3 in NaCl |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1195 | # Don't use -O3 with sanitizers. |
| 1196 | ['nacl_target_arch=="none" and asan==0 and msan==0 and lsan==0 \ |
| 1197 | and tsan==0 and ubsan==0 and ubsan_vptr==0', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1198 | 'cflags': ['-O3'], |
| 1199 | 'cflags!': ['-O2'], |
| 1200 | }, { |
| 1201 | 'cflags': ['-O2'], |
| 1202 | 'cflags!': ['-O3'], |
| 1203 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1204 | ], |
| 1205 | }], |
| 1206 | ['OS=="mac"', { |
| 1207 | 'xcode_settings': { |
| 1208 | 'GCC_OPTIMIZATION_LEVEL': '3', # -O3 |
| 1209 | 'GCC_STRICT_ALIASING': 'YES', |
| 1210 | }, |
| 1211 | }], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1212 | ['v8_enable_slow_dchecks==1', { |
| 1213 | 'defines': [ |
| 1214 | 'ENABLE_SLOW_DCHECKS', |
| 1215 | ], |
| 1216 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1217 | ], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1218 | }, # DebugBase1 |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1219 | # Common settings for the Debug configuration. |
| 1220 | 'DebugBaseCommon': { |
| 1221 | 'abstract': 1, |
| 1222 | 'defines': [ |
| 1223 | 'ENABLE_DISASSEMBLER', |
| 1224 | 'V8_ENABLE_CHECKS', |
| 1225 | 'OBJECT_PRINT', |
| 1226 | 'VERIFY_HEAP', |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 1227 | 'DEBUG', |
| 1228 | 'TRACE_MAPS' |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1229 | ], |
| 1230 | 'conditions': [ |
| 1231 | ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1232 | OS=="qnx" or OS=="aix"', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1233 | 'cflags': [ '-Woverloaded-virtual', '<(wno_array_bounds)', ], |
| 1234 | }], |
| 1235 | ['OS=="linux" and v8_enable_backtrace==1', { |
| 1236 | # Support for backtrace_symbols. |
| 1237 | 'ldflags': [ '-rdynamic' ], |
| 1238 | }], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1239 | ['OS=="linux" and disable_glibcxx_debug==0', { |
| 1240 | # Enable libstdc++ debugging facilities to help catch problems |
| 1241 | # early, see http://crbug.com/65151 . |
| 1242 | 'defines': ['_GLIBCXX_DEBUG=1',], |
| 1243 | }], |
| 1244 | ['OS=="aix"', { |
| 1245 | 'ldflags': [ '-Wl,-bbigtoc' ], |
| 1246 | 'conditions': [ |
| 1247 | ['v8_target_arch=="ppc64"', { |
| 1248 | 'cflags': [ '-maix64 -mcmodel=large' ], |
| 1249 | }], |
| 1250 | ], |
| 1251 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1252 | ['OS=="android"', { |
| 1253 | 'variables': { |
| 1254 | 'android_full_debug%': 1, |
| 1255 | }, |
| 1256 | 'conditions': [ |
| 1257 | ['android_full_debug==0', { |
| 1258 | # Disable full debug if we want a faster v8 in a debug build. |
| 1259 | # TODO(2304): pass DISABLE_DEBUG_ASSERT instead of hiding DEBUG. |
| 1260 | 'defines!': [ |
| 1261 | 'DEBUG', |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 1262 | 'ENABLE_SLOW_DCHECKS', |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1263 | ], |
| 1264 | }], |
| 1265 | ], |
| 1266 | }], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1267 | # TODO(pcc): Re-enable in LTO builds once we've fixed the intermittent |
| 1268 | # link failures (crbug.com/513074). |
| 1269 | ['linux_use_gold_flags==1 and use_lto==0', { |
| 1270 | 'target_conditions': [ |
| 1271 | ['_toolset=="target"', { |
| 1272 | 'ldflags': [ |
| 1273 | # Experimentation found that using four linking threads |
| 1274 | # saved ~20% of link time. |
| 1275 | # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36 |
| 1276 | # Only apply this to the target linker, since the host |
| 1277 | # linker might not be gold, but isn't used much anyway. |
| 1278 | '-Wl,--threads', |
| 1279 | '-Wl,--thread-count=4', |
| 1280 | ], |
| 1281 | }], |
| 1282 | ], |
| 1283 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1284 | ], |
| 1285 | }, # DebugBaseCommon |
| 1286 | 'Debug': { |
| 1287 | 'inherit_from': ['DebugBaseCommon'], |
| 1288 | 'conditions': [ |
| 1289 | ['v8_optimized_debug==0', { |
| 1290 | 'inherit_from': ['DebugBase0'], |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1291 | }, { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1292 | 'inherit_from': ['DebugBase1'], |
| 1293 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1294 | ], |
| 1295 | }, # Debug |
Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 1296 | 'ReleaseBase': { |
| 1297 | 'abstract': 1, |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1298 | 'variables': { |
| 1299 | 'v8_enable_slow_dchecks%': 0, |
| 1300 | }, |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1301 | 'conditions': [ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1302 | ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \ |
| 1303 | or OS=="aix"', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1304 | 'cflags!': [ |
| 1305 | '-Os', |
| 1306 | ], |
| 1307 | 'cflags': [ |
| 1308 | '-fdata-sections', |
| 1309 | '-ffunction-sections', |
| 1310 | '<(wno_array_bounds)', |
| 1311 | ], |
| 1312 | 'conditions': [ |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1313 | # TODO(crbug.com/272548): Avoid -O3 in NaCl |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1314 | # Don't use -O3 with sanitizers. |
| 1315 | ['nacl_target_arch=="none" and asan==0 and msan==0 and lsan==0 \ |
| 1316 | and tsan==0 and ubsan==0 and ubsan_vptr==0', { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1317 | 'cflags': ['-O3'], |
| 1318 | 'cflags!': ['-O2'], |
| 1319 | }, { |
| 1320 | 'cflags': ['-O2'], |
| 1321 | 'cflags!': ['-O3'], |
| 1322 | }], |
| 1323 | ], |
| 1324 | }], |
| 1325 | ['OS=="android"', { |
| 1326 | 'cflags!': [ |
| 1327 | '-O3', |
| 1328 | '-Os', |
| 1329 | ], |
| 1330 | 'cflags': [ |
| 1331 | '-fdata-sections', |
| 1332 | '-ffunction-sections', |
| 1333 | '-O2', |
| 1334 | ], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1335 | }], |
| 1336 | ['OS=="mac"', { |
| 1337 | 'xcode_settings': { |
| 1338 | 'GCC_OPTIMIZATION_LEVEL': '3', # -O3 |
| 1339 | |
| 1340 | # -fstrict-aliasing. Mainline gcc |
| 1341 | # enables this at -O2 and above, |
| 1342 | # but Apple gcc does not unless it |
| 1343 | # is specified explicitly. |
| 1344 | 'GCC_STRICT_ALIASING': 'YES', |
| 1345 | }, |
| 1346 | }], # OS=="mac" |
| 1347 | ['OS=="win"', { |
| 1348 | 'msvs_settings': { |
| 1349 | 'VCCLCompilerTool': { |
| 1350 | 'Optimization': '2', |
| 1351 | 'InlineFunctionExpansion': '2', |
| 1352 | 'EnableIntrinsicFunctions': 'true', |
| 1353 | 'FavorSizeOrSpeed': '0', |
| 1354 | 'StringPooling': 'true', |
| 1355 | 'conditions': [ |
| 1356 | ['component=="shared_library"', { |
| 1357 | 'RuntimeLibrary': '2', #/MD |
| 1358 | }, { |
| 1359 | 'RuntimeLibrary': '0', #/MT |
| 1360 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1361 | ], |
| 1362 | }, |
| 1363 | 'VCLinkerTool': { |
| 1364 | 'LinkIncremental': '1', |
| 1365 | 'OptimizeReferences': '2', |
| 1366 | 'EnableCOMDATFolding': '2', |
| 1367 | }, |
| 1368 | }, |
| 1369 | }], # OS=="win" |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 1370 | ['v8_enable_slow_dchecks==1', { |
| 1371 | 'defines': [ |
| 1372 | 'ENABLE_SLOW_DCHECKS', |
| 1373 | ], |
| 1374 | }], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1375 | ], # conditions |
| 1376 | }, # Release |
Ben Murdoch | da12d29 | 2016-06-02 14:46:10 +0100 | [diff] [blame] | 1377 | 'Release': { |
| 1378 | 'inherit_from': ['ReleaseBase'], |
| 1379 | }, # Debug |
| 1380 | 'conditions': [ |
| 1381 | [ 'OS=="win"', { |
| 1382 | # TODO(bradnelson): add a gyp mechanism to make this more graceful. |
| 1383 | 'Debug_x64': { |
| 1384 | 'inherit_from': ['DebugBaseCommon'], |
| 1385 | 'conditions': [ |
| 1386 | ['v8_optimized_debug==0', { |
| 1387 | 'inherit_from': ['DebugBase0'], |
| 1388 | }, { |
| 1389 | 'inherit_from': ['DebugBase1'], |
| 1390 | }], |
| 1391 | ], |
| 1392 | }, |
| 1393 | 'Release_x64': { |
| 1394 | 'inherit_from': ['ReleaseBase'], |
| 1395 | }, |
| 1396 | }], |
| 1397 | ], |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 1398 | }, # configurations |
| 1399 | }, # target_defaults |
| 1400 | } |