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
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.
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.
28 # Shared definitions for all V8-related targets.
32 'msvs_use_common_release': 0,
40 'v8_target_arch%': '<(target_arch)',
41 'v8_host_byteorder%': '<!(python -c "import sys; print sys.byteorder")',
42 # Native Client builds currently use the V8 ARM JIT and
43 # arm/simulator-arm.cc to defer the significant effort required
44 # for NaCl JIT support. The nacl_target_arch variable provides
45 # the 'true' target arch for places in this file that need it.
46 # TODO(bradchen): get rid of nacl_target_arch when someday
47 # NaCl V8 builds stop using the ARM simulator
48 'nacl_target_arch%': 'none', # must be set externally
50 # Setting 'v8_can_use_vfp32dregs' to 'true' will cause V8 to use the VFP
51 # registers d16-d31 in the generated code, both in the snapshot and for the
52 # ARM target. Leaving the default value of 'false' will avoid the use of
53 # these registers in the snapshot and use CPU feature probing when running
55 'v8_can_use_vfp32dregs%': 'false',
56 'arm_test_noprobe%': 'off',
58 # Similar to vfp but on MIPS.
59 'v8_can_use_fpu_instructions%': 'true',
61 # Similar to the ARM hard float ABI but on MIPS.
62 'v8_use_mips_abi_hardfloat%': 'true',
64 # Force disable libstdc++ debug mode.
65 'disable_glibcxx_debug%': 0,
67 'v8_enable_backtrace%': 0,
69 # Enable profiling support. Only required on Windows.
72 # Some versions of GCC 4.5 seem to need -fno-strict-aliasing.
73 'v8_no_strict_aliasing%': 0,
75 # Chrome needs this definition unconditionally. For standalone V8 builds,
76 # it's handled in build/standalone.gypi.
77 'want_separate_host_toolset%': 1,
79 # Toolset the d8 binary should be compiled for. Possible values are 'host'
80 # and 'target'. If you want to run v8 tests, it needs to be set to 'target'.
81 # The setting is ignored if want_separate_host_toolset is 0.
82 'v8_toolset_for_d8%': 'target',
86 # For a shared library build, results in "libv8-<(soname_version).so".
87 'soname_version%': '',
89 # Allow to suppress the array bounds warning (default is no suppression).
90 'wno_array_bounds%': '',
92 # Override where to find binutils
96 ['OS=="linux" and host_arch=="x64"', {
97 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
99 ['OS=="linux" and host_arch=="ia32"', {
100 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
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" and (target_arch=="x64" or target_arch=="arm")', {
109 'linux_use_bundled_gold%': 1,
111 'linux_use_bundled_gold%': 0,
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,
121 'linux_use_bundled_binutils%': 0,
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,
128 'linux_use_gold_flags%': 0,
132 # Link-Time Optimizations
136 # This is set when building the Android WebView inside the Android build
137 # system, using the 'android' gyp backend.
138 'android_webview_build%': 0,
140 # Copy it out one scope.
141 'android_webview_build%': '<(android_webview_build)',
144 ['host_arch=="ia32" or host_arch=="x64" or \
145 host_arch=="ppc" or host_arch=="ppc64" or \
148 'host_cxx_is_biarch%': 1,
152 'host_cxx_is_biarch%': 0,
155 ['target_arch=="ia32" or target_arch=="x64" or target_arch=="x87" or \
156 target_arch=="ppc" or target_arch=="ppc64" or \
159 'target_cxx_is_biarch%': 1,
163 'target_cxx_is_biarch%': 0,
169 ['v8_target_arch=="arm"', {
171 'V8_TARGET_ARCH_ARM',
174 [ 'arm_version==7 or arm_version=="default"', {
176 'CAN_USE_ARMV7_INSTRUCTIONS',
179 [ 'arm_fpu=="vfpv3-d16" or arm_fpu=="default"', {
181 'CAN_USE_VFP3_INSTRUCTIONS',
184 [ 'arm_fpu=="vfpv3"', {
186 'CAN_USE_VFP3_INSTRUCTIONS',
187 'CAN_USE_VFP32DREGS',
190 [ 'arm_fpu=="neon"', {
192 'CAN_USE_VFP3_INSTRUCTIONS',
193 'CAN_USE_VFP32DREGS',
197 [ 'arm_test_noprobe=="on"', {
199 'ARM_TEST_NO_FEATURE_PROBE',
203 'target_conditions': [
204 ['_toolset=="host"', {
206 ['v8_target_arch==host_arch and android_webview_build==0', {
207 # Host built with an Arm CXX compiler.
209 [ 'arm_version==7', {
210 'cflags': ['-march=armv7-a',],
212 [ 'arm_version==7 or arm_version=="default"', {
214 [ 'arm_fpu!="default"', {
215 'cflags': ['-mfpu=<(arm_fpu)',],
219 [ 'arm_float_abi!="default"', {
220 'cflags': ['-mfloat-abi=<(arm_float_abi)',],
223 'cflags': ['-mthumb',],
226 'cflags': ['-marm',],
230 # 'v8_target_arch!=host_arch'
231 # Host not built with an Arm CXX compiler (simulator build).
233 [ 'arm_float_abi=="hard"', {
235 'USE_EABI_HARDFLOAT=1',
238 [ 'arm_float_abi=="softfp" or arm_float_abi=="default"', {
240 'USE_EABI_HARDFLOAT=0',
246 }], # _toolset=="host"
247 ['_toolset=="target"', {
249 ['v8_target_arch==target_arch and android_webview_build==0', {
250 # Target built with an Arm CXX compiler.
252 [ 'arm_version==7', {
253 'cflags': ['-march=armv7-a',],
255 [ 'arm_version==7 or arm_version=="default"', {
257 [ 'arm_fpu!="default"', {
258 'cflags': ['-mfpu=<(arm_fpu)',],
262 [ 'arm_float_abi!="default"', {
263 'cflags': ['-mfloat-abi=<(arm_float_abi)',],
266 'cflags': ['-mthumb',],
269 'cflags': ['-marm',],
273 # 'v8_target_arch!=target_arch'
274 # Target not built with an Arm CXX compiler (simulator build).
276 [ 'arm_float_abi=="hard"', {
278 'USE_EABI_HARDFLOAT=1',
281 [ 'arm_float_abi=="softfp" or arm_float_abi=="default"', {
283 'USE_EABI_HARDFLOAT=0',
289 # v8 is optimized for speed, which takes precedence over
290 # size optimization in LTO.
298 }], # _toolset=="target"
300 }], # v8_target_arch=="arm"
301 ['v8_target_arch=="arm64"', {
303 'V8_TARGET_ARCH_ARM64',
306 ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', {
308 'V8_TARGET_ARCH_PPC',
311 ['v8_target_arch=="ppc64"', {
313 'V8_TARGET_ARCH_PPC64',
316 ['v8_host_byteorder=="little"', {
318 'V8_TARGET_ARCH_PPC_LE',
321 ['v8_host_byteorder=="big"', {
323 'V8_TARGET_ARCH_PPC_BE',
327 # Work around AIX ceil, trunc and round oddities.
328 'cflags': [ '-mcpu=power5+ -mfprnd' ],
331 # Work around AIX assembler popcntb bug.
332 'cflags': [ '-mno-popcntb' ],
338 ['v8_target_arch=="ia32"', {
340 'V8_TARGET_ARCH_IA32',
342 }], # v8_target_arch=="ia32"
343 ['v8_target_arch=="x87"', {
345 'V8_TARGET_ARCH_X87',
347 'cflags': ['-march=i586'],
348 }], # v8_target_arch=="x87"
349 ['v8_target_arch=="mips"', {
351 'V8_TARGET_ARCH_MIPS',
354 [ 'v8_can_use_fpu_instructions=="true"', {
356 'CAN_USE_FPU_INSTRUCTIONS',
359 [ 'v8_use_mips_abi_hardfloat=="true"', {
361 '__mips_hard_float=1',
362 'CAN_USE_FPU_INSTRUCTIONS',
366 '__mips_soft_float=1'
370 'target_conditions': [
371 ['_toolset=="target"', {
373 ['v8_target_arch==target_arch and android_webview_build==0', {
374 # Target built with a Mips CXX compiler.
377 '-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
381 [ 'v8_use_mips_abi_hardfloat=="true"', {
382 'cflags': ['-mhard-float'],
383 'ldflags': ['-mhard-float'],
385 'cflags': ['-msoft-float'],
386 'ldflags': ['-msoft-float'],
388 ['mips_arch_variant=="r6"', {
390 '_MIPS_ARCH_MIPS32R6',
393 'cflags!': ['-mfp32', '-mfpxx'],
394 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
397 '-Wl,--dynamic-linker=$(LDSO_PATH)',
398 '-Wl,--rpath=$(LD_R_PATH)',
401 ['mips_arch_variant=="r2"', {
403 [ 'mips_fpu_mode=="fp64"', {
405 '_MIPS_ARCH_MIPS32R2',
408 'cflags': ['-mfp64'],
410 ['mips_fpu_mode=="fpxx"', {
412 '_MIPS_ARCH_MIPS32R2',
415 'cflags': ['-mfpxx'],
417 ['mips_fpu_mode=="fp32"', {
419 '_MIPS_ARCH_MIPS32R2',
422 'cflags': ['-mfp32'],
425 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
426 'ldflags': ['-mips32r2'],
428 ['mips_arch_variant=="r1"', {
432 'cflags!': ['-mfp64', '-mfpxx'],
433 'cflags': ['-mips32', '-Wa,-mips32'],
434 'ldflags': ['-mips32'],
436 ['mips_arch_variant=="rx"', {
438 '_MIPS_ARCH_MIPS32RX',
441 'cflags!': ['-mfp64', '-mfp32'],
442 'cflags': ['-mips32', '-Wa,-mips32', '-mfpxx'],
443 'ldflags': ['-mips32'],
447 # 'v8_target_arch!=target_arch'
448 # Target not built with an MIPS CXX compiler (simulator build).
450 ['mips_arch_variant=="r6"', {
452 '_MIPS_ARCH_MIPS32R6',
456 ['mips_arch_variant=="r2"', {
458 [ 'mips_fpu_mode=="fp64"', {
460 '_MIPS_ARCH_MIPS32R2',
464 ['mips_fpu_mode=="fpxx"', {
466 '_MIPS_ARCH_MIPS32R2',
470 ['mips_fpu_mode=="fp32"', {
472 '_MIPS_ARCH_MIPS32R2',
478 ['mips_arch_variant=="r1"', {
483 ['mips_arch_variant=="rx"', {
485 '_MIPS_ARCH_MIPS32RX',
492 }], #_toolset=="target"
493 ['_toolset=="host"', {
495 ['mips_arch_variant=="rx"', {
497 '_MIPS_ARCH_MIPS32RX',
501 ['mips_arch_variant=="r6"', {
503 '_MIPS_ARCH_MIPS32R6',
507 ['mips_arch_variant=="r2"', {
509 ['mips_fpu_mode=="fp64"', {
511 '_MIPS_ARCH_MIPS32R2',
515 ['mips_fpu_mode=="fpxx"', {
517 '_MIPS_ARCH_MIPS32R2',
521 ['mips_fpu_mode=="fp32"', {
523 '_MIPS_ARCH_MIPS32R2',
529 ['mips_arch_variant=="r1"', {
530 'defines': ['FPU_MODE_FP32',],
533 }], #_toolset=="host"
535 }], # v8_target_arch=="mips"
536 ['v8_target_arch=="mipsel"', {
538 'V8_TARGET_ARCH_MIPS',
541 [ 'v8_can_use_fpu_instructions=="true"', {
543 'CAN_USE_FPU_INSTRUCTIONS',
546 [ 'v8_use_mips_abi_hardfloat=="true"', {
548 '__mips_hard_float=1',
549 'CAN_USE_FPU_INSTRUCTIONS',
553 '__mips_soft_float=1'
557 'target_conditions': [
558 ['_toolset=="target"', {
560 ['v8_target_arch==target_arch and android_webview_build==0', {
561 # Target built with a Mips CXX compiler.
564 '-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
568 [ 'v8_use_mips_abi_hardfloat=="true"', {
569 'cflags': ['-mhard-float'],
570 'ldflags': ['-mhard-float'],
572 'cflags': ['-msoft-float'],
573 'ldflags': ['-msoft-float'],
575 ['mips_arch_variant=="r6"', {
577 '_MIPS_ARCH_MIPS32R6',
580 'cflags!': ['-mfp32', '-mfpxx'],
581 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
584 '-Wl,--dynamic-linker=$(LDSO_PATH)',
585 '-Wl,--rpath=$(LD_R_PATH)',
588 ['mips_arch_variant=="r2"', {
590 [ 'mips_fpu_mode=="fp64"', {
592 '_MIPS_ARCH_MIPS32R2',
595 'cflags': ['-mfp64'],
597 ['mips_fpu_mode=="fpxx"', {
599 '_MIPS_ARCH_MIPS32R2',
602 'cflags': ['-mfpxx'],
604 ['mips_fpu_mode=="fp32"', {
606 '_MIPS_ARCH_MIPS32R2',
609 'cflags': ['-mfp32'],
612 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
613 'ldflags': ['-mips32r2'],
615 ['mips_arch_variant=="r1"', {
616 'cflags!': ['-mfp64', '-mfpxx'],
617 'cflags': ['-mips32', '-Wa,-mips32'],
618 'ldflags': ['-mips32'],
620 ['mips_arch_variant=="rx"', {
622 '_MIPS_ARCH_MIPS32RX',
625 'cflags!': ['-mfp64', '-mfp32'],
626 'cflags': ['-mips32', '-Wa,-mips32', '-mfpxx'],
627 'ldflags': ['-mips32'],
629 ['mips_arch_variant=="loongson"', {
631 '_MIPS_ARCH_LOONGSON',
634 'cflags!': ['-mfp64', '-mfp32', '-mfpxx'],
635 'cflags': ['-mips3', '-Wa,-mips3'],
639 # 'v8_target_arch!=target_arch'
640 # Target not built with an MIPS CXX compiler (simulator build).
642 ['mips_arch_variant=="r6"', {
644 '_MIPS_ARCH_MIPS32R6',
648 ['mips_arch_variant=="r2"', {
650 [ 'mips_fpu_mode=="fp64"', {
652 '_MIPS_ARCH_MIPS32R2',
656 ['mips_fpu_mode=="fpxx"', {
658 '_MIPS_ARCH_MIPS32R2',
662 ['mips_fpu_mode=="fp32"', {
664 '_MIPS_ARCH_MIPS32R2',
670 ['mips_arch_variant=="r1"', {
675 ['mips_arch_variant=="rx"', {
677 '_MIPS_ARCH_MIPS32RX',
681 ['mips_arch_variant=="loongson"', {
683 '_MIPS_ARCH_LOONGSON',
690 }], #_toolset=="target
691 ['_toolset=="host"', {
693 ['mips_arch_variant=="rx"', {
695 '_MIPS_ARCH_MIPS32RX',
699 ['mips_arch_variant=="r6"', {
701 '_MIPS_ARCH_MIPS32R6',
705 ['mips_arch_variant=="r2"', {
707 ['mips_fpu_mode=="fp64"', {
709 '_MIPS_ARCH_MIPS32R2',
713 ['mips_fpu_mode=="fpxx"', {
715 '_MIPS_ARCH_MIPS32R2',
719 ['mips_fpu_mode=="fp32"', {
721 '_MIPS_ARCH_MIPS32R2',
727 ['mips_arch_variant=="r1"', {
728 'defines': ['FPU_MODE_FP32',],
730 ['mips_arch_variant=="loongson"', {
732 '_MIPS_ARCH_LOONGSON',
739 }], # v8_target_arch=="mipsel"
740 ['v8_target_arch=="mips64el"', {
742 'V8_TARGET_ARCH_MIPS64',
745 [ 'v8_can_use_fpu_instructions=="true"', {
747 'CAN_USE_FPU_INSTRUCTIONS',
750 [ 'v8_use_mips_abi_hardfloat=="true"', {
752 '__mips_hard_float=1',
753 'CAN_USE_FPU_INSTRUCTIONS',
757 '__mips_soft_float=1'
761 'target_conditions': [
762 ['_toolset=="target"', {
764 ['v8_target_arch==target_arch and android_webview_build==0', {
767 '-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
771 [ 'v8_use_mips_abi_hardfloat=="true"', {
772 'cflags': ['-mhard-float'],
773 'ldflags': ['-mhard-float'],
775 'cflags': ['-msoft-float'],
776 'ldflags': ['-msoft-float'],
778 ['mips_arch_variant=="r6"', {
779 'defines': ['_MIPS_ARCH_MIPS64R6',],
780 'cflags': ['-mips64r6', '-mabi=64', '-Wa,-mips64r6'],
782 '-mips64r6', '-mabi=64',
783 '-Wl,--dynamic-linker=$(LDSO_PATH)',
784 '-Wl,--rpath=$(LD_R_PATH)',
787 ['mips_arch_variant=="r2"', {
788 'defines': ['_MIPS_ARCH_MIPS64R2',],
789 'cflags': ['-mips64r2', '-mabi=64', '-Wa,-mips64r2'],
791 '-mips64r2', '-mabi=64',
792 '-Wl,--dynamic-linker=$(LDSO_PATH)',
793 '-Wl,--rpath=$(LD_R_PATH)',
798 # 'v8_target_arch!=target_arch'
799 # Target not built with an MIPS CXX compiler (simulator build).
801 ['mips_arch_variant=="r6"', {
802 'defines': ['_MIPS_ARCH_MIPS64R6',],
804 ['mips_arch_variant=="r2"', {
805 'defines': ['_MIPS_ARCH_MIPS64R2',],
810 }], #'_toolset=="target"
811 ['_toolset=="host"', {
813 ['mips_arch_variant=="r6"', {
814 'defines': ['_MIPS_ARCH_MIPS64R6',],
816 ['mips_arch_variant=="r2"', {
817 'defines': ['_MIPS_ARCH_MIPS64R2',],
820 }], #'_toolset=="host"
822 }], # v8_target_arch=="mips64el"
823 ['v8_target_arch=="x64"', {
825 'V8_TARGET_ARCH_X64',
828 'ARCHS': [ 'x86_64' ],
832 'StackReserveSize': '2097152',
835 'msvs_configuration_platform': 'x64',
836 }], # v8_target_arch=="x64"
837 ['v8_target_arch=="x32"', {
839 # x32 port shares the source code with x64 port.
840 'V8_TARGET_ARCH_X64',
841 'V8_TARGET_ARCH_32_BIT',
845 # Inhibit warning if long long type is used.
851 }], # v8_target_arch=="x32"
852 ['linux_use_gold_flags==1', {
853 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
855 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
856 'ldflags': [ '-fuse-ld=gold', ],
858 ['linux_use_bundled_binutils==1', {
860 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
863 ['linux_use_bundled_gold==1', {
864 # Put our binutils, which contains gold in the search path. We pass
865 # the path to gold to the compiler. gyp leaves unspecified what the
866 # cwd is when running the compiler, so the normal gyp path-munging
867 # fails us. This hack gets the right path.
869 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
876 # 4351: VS 2005 and later are warning us that they've fixed a bug
877 # present in VS 2003 and earlier.
878 'msvs_disabled_warnings': [4351],
879 'msvs_configuration_attributes': {
880 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
881 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
885 ['OS=="win" and v8_target_arch=="ia32"', {
887 'VCCLCompilerTool': {
888 # Ensure no surprising artifacts from 80bit double math with x86.
889 'AdditionalOptions': ['/arch:SSE2'],
893 ['OS=="win" and v8_enable_prof==1', {
896 'GenerateMapFile': 'true',
900 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
901 or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
902 v8_target_arch=="ia32"', {
906 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
909 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
910 or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
911 (v8_target_arch=="arm" or v8_target_arch=="ia32" or \
912 v8_target_arch=="x87" or v8_target_arch=="mips" or \
913 v8_target_arch=="mipsel" or v8_target_arch=="ppc")', {
914 'target_conditions': [
915 ['_toolset=="host"', {
917 ['host_cxx_is_biarch==1', {
918 'cflags': [ '-m32' ],
919 'ldflags': [ '-m32' ]
926 ['_toolset=="target"', {
928 ['target_cxx_is_biarch==1 and nacl_target_arch!="nacl_x64"', {
929 'cflags': [ '-m32' ],
930 'ldflags': [ '-m32' ],
932 # Enable feedback-directed optimisation when building in android.
933 [ 'android_webview_build == 1', {
934 'aosp_build_settings': {
935 'LOCAL_FDO_SUPPORT': 'true',
945 ['(OS=="linux" or OS=="android") and \
946 (v8_target_arch=="x64" or v8_target_arch=="arm64" or \
947 v8_target_arch=="ppc64")', {
948 'target_conditions': [
949 ['_toolset=="host"', {
951 ['host_cxx_is_biarch==1', {
952 'cflags': [ '-m64' ],
953 'ldflags': [ '-m64' ]
957 ['_toolset=="target"', {
959 ['target_cxx_is_biarch==1', {
960 'cflags': [ '-m64' ],
961 'ldflags': [ '-m64' ],
963 # Enable feedback-directed optimisation when building in android.
964 [ 'android_webview_build == 1', {
965 'aosp_build_settings': {
966 'LOCAL_FDO_SUPPORT': 'true',
973 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
974 or OS=="netbsd" or OS=="qnx" or OS=="aix"', {
976 [ 'v8_no_strict_aliasing==1', {
977 'cflags': [ '-fno-strict-aliasing' ],
982 'defines': [ '__C99FEATURES__=1' ], # isinf() etc.
984 ['OS=="freebsd" or OS=="openbsd"', {
985 'cflags': [ '-I/usr/local/include' ],
988 'cflags': [ '-I/usr/pkg/include' ],
992 # Support for malloc(0)
993 '_LINUX_SOURCE_COMPAT=1',
996 [ 'v8_target_arch=="ppc"', {
997 'ldflags': [ '-Wl,-bmaxdata:0x60000000/dsa' ],
999 [ 'v8_target_arch=="ppc64"', {
1000 'cflags': [ '-maix64' ],
1001 'ldflags': [ '-maix64' ],
1007 # Abstract configuration for v8_optimized_debug == 0.
1011 'VCCLCompilerTool': {
1012 'Optimization': '0',
1014 ['component=="shared_library"', {
1015 'RuntimeLibrary': '3', # /MDd
1017 'RuntimeLibrary': '1', # /MTd
1022 'LinkIncremental': '2',
1026 'v8_enable_slow_dchecks%': 1,
1029 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
1030 OS=="qnx" or OS=="aix"', {
1039 '-ffunction-sections',
1044 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
1047 ['v8_enable_slow_dchecks==1', {
1049 'ENABLE_SLOW_DCHECKS',
1054 # Abstract configuration for v8_optimized_debug == 1.
1058 'VCCLCompilerTool': {
1059 'Optimization': '2',
1060 'InlineFunctionExpansion': '2',
1061 'EnableIntrinsicFunctions': 'true',
1062 'FavorSizeOrSpeed': '0',
1063 'StringPooling': 'true',
1064 'BasicRuntimeChecks': '0',
1066 ['component=="shared_library"', {
1067 'RuntimeLibrary': '3', #/MDd
1069 'RuntimeLibrary': '1', #/MTd
1074 'LinkIncremental': '1',
1075 'OptimizeReferences': '2',
1076 'EnableCOMDATFolding': '2',
1080 'v8_enable_slow_dchecks%': 0,
1083 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
1084 OS=="qnx" or OS=="aix"', {
1092 '-ffunction-sections',
1095 # TODO(crbug.com/272548): Avoid -O3 in NaCl
1096 # Don't use -O3 with sanitizers.
1097 ['nacl_target_arch=="none" and asan==0 and msan==0 and lsan==0 \
1098 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
1109 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
1110 'GCC_STRICT_ALIASING': 'YES',
1113 ['v8_enable_slow_dchecks==1', {
1115 'ENABLE_SLOW_DCHECKS',
1120 # Common settings for the Debug configuration.
1121 'DebugBaseCommon': {
1124 'ENABLE_DISASSEMBLER',
1132 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
1133 OS=="qnx" or OS=="aix"', {
1134 'cflags': [ '-Woverloaded-virtual', '<(wno_array_bounds)', ],
1136 ['OS=="linux" and v8_enable_backtrace==1', {
1137 # Support for backtrace_symbols.
1138 'ldflags': [ '-rdynamic' ],
1140 ['OS=="linux" and disable_glibcxx_debug==0', {
1141 # Enable libstdc++ debugging facilities to help catch problems
1142 # early, see http://crbug.com/65151 .
1143 'defines': ['_GLIBCXX_DEBUG=1',],
1146 'ldflags': [ '-Wl,-bbigtoc' ],
1148 ['v8_target_arch=="ppc64"', {
1149 'cflags': [ '-maix64 -mcmodel=large' ],
1155 'android_full_debug%': 1,
1158 ['android_full_debug==0', {
1159 # Disable full debug if we want a faster v8 in a debug build.
1160 # TODO(2304): pass DISABLE_DEBUG_ASSERT instead of hiding DEBUG.
1163 'ENABLE_SLOW_DCHECKS',
1168 ['linux_use_gold_flags==1', {
1169 'target_conditions': [
1170 ['_toolset=="target"', {
1172 # Experimentation found that using four linking threads
1173 # saved ~20% of link time.
1174 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
1175 # Only apply this to the target linker, since the host
1176 # linker might not be gold, but isn't used much anyway.
1178 '-Wl,--thread-count=4',
1184 }, # DebugBaseCommon
1186 'inherit_from': ['DebugBaseCommon'],
1188 ['v8_optimized_debug==0', {
1189 'inherit_from': ['DebugBase0'],
1191 'inherit_from': ['DebugBase1'],
1197 'v8_enable_slow_dchecks%': 0,
1200 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
1207 '-ffunction-sections',
1208 '<(wno_array_bounds)',
1211 # TODO(crbug.com/272548): Avoid -O3 in NaCl
1212 # Don't use -O3 with sanitizers.
1213 ['nacl_target_arch=="none" and asan==0 and msan==0 and lsan==0 \
1214 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
1230 '-ffunction-sections',
1236 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
1238 # -fstrict-aliasing. Mainline gcc
1239 # enables this at -O2 and above,
1240 # but Apple gcc does not unless it
1241 # is specified explicitly.
1242 'GCC_STRICT_ALIASING': 'YES',
1247 'VCCLCompilerTool': {
1248 'Optimization': '2',
1249 'InlineFunctionExpansion': '2',
1250 'EnableIntrinsicFunctions': 'true',
1251 'FavorSizeOrSpeed': '0',
1252 'StringPooling': 'true',
1254 ['component=="shared_library"', {
1255 'RuntimeLibrary': '2', #/MD
1257 'RuntimeLibrary': '0', #/MT
1262 'LinkIncremental': '1',
1263 'OptimizeReferences': '2',
1264 'EnableCOMDATFolding': '2',
1268 ['v8_enable_slow_dchecks==1', {
1270 'ENABLE_SLOW_DCHECKS',
1276 }, # target_defaults