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