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 'v8_enable_backtrace%': 0,
66 # Enable profiling support. Only required on Windows.
69 # Some versions of GCC 4.5 seem to need -fno-strict-aliasing.
70 'v8_no_strict_aliasing%': 0,
72 # Chrome needs this definition unconditionally. For standalone V8 builds,
73 # it's handled in build/standalone.gypi.
74 'want_separate_host_toolset%': 1,
76 # Toolset the d8 binary should be compiled for. Possible values are 'host'
77 # and 'target'. If you want to run v8 tests, it needs to be set to 'target'.
78 # The setting is ignored if want_separate_host_toolset is 0.
79 'v8_toolset_for_d8%': 'target',
83 # For a shared library build, results in "libv8-<(soname_version).so".
84 'soname_version%': '',
86 # Allow to suppress the array bounds warning (default is no suppression).
87 'wno_array_bounds%': '',
89 # Override where to find binutils
93 ['OS=="linux" and host_arch=="x64"', {
94 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
96 ['OS=="linux" and host_arch=="ia32"', {
97 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
100 # linux_use_bundled_gold: whether to use the gold linker binary checked
101 # into third_party/binutils. Force this off via GYP_DEFINES when you
102 # are using a custom toolchain and need to control -B in ldflags.
103 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
104 # for component=static_library builds.
105 ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
106 'linux_use_bundled_gold%': 1,
108 'linux_use_bundled_gold%': 0,
110 # linux_use_bundled_binutils: whether to use the binary binutils
111 # checked into third_party/binutils. These are not multi-arch so cannot
112 # be used except on x86 and x86-64 (the only two architectures which
113 # are currently checke in). Force this off via GYP_DEFINES when you
114 # are using a custom toolchain and need to control -B in cflags.
115 ['OS=="linux" and (target_arch=="ia32" or target_arch=="x64")', {
116 'linux_use_bundled_binutils%': 1,
118 'linux_use_bundled_binutils%': 0,
120 # linux_use_gold_flags: whether to use build flags that rely on gold.
121 # On by default for x64 Linux.
122 ['OS=="linux" and target_arch=="x64"', {
123 'linux_use_gold_flags%': 1,
125 'linux_use_gold_flags%': 0,
129 # Link-Time Optimizations
133 # This is set when building the Android WebView inside the Android build
134 # system, using the 'android' gyp backend.
135 'android_webview_build%': 0,
137 # Copy it out one scope.
138 'android_webview_build%': '<(android_webview_build)',
141 ['host_arch=="ia32" or host_arch=="x64" or \
142 host_arch=="ppc" or host_arch=="ppc64" or \
145 'host_cxx_is_biarch%': 1,
149 'host_cxx_is_biarch%': 0,
152 ['target_arch=="ia32" or target_arch=="x64" or target_arch=="x87" or \
153 target_arch=="ppc" or target_arch=="ppc64" or \
156 'target_cxx_is_biarch%': 1,
160 'target_cxx_is_biarch%': 0,
166 ['v8_target_arch=="arm"', {
168 'V8_TARGET_ARCH_ARM',
171 [ 'arm_version==7 or arm_version=="default"', {
173 'CAN_USE_ARMV7_INSTRUCTIONS',
176 [ 'arm_fpu=="vfpv3-d16" or arm_fpu=="default"', {
178 'CAN_USE_VFP3_INSTRUCTIONS',
181 [ 'arm_fpu=="vfpv3"', {
183 'CAN_USE_VFP3_INSTRUCTIONS',
184 'CAN_USE_VFP32DREGS',
187 [ 'arm_fpu=="neon"', {
189 'CAN_USE_VFP3_INSTRUCTIONS',
190 'CAN_USE_VFP32DREGS',
194 [ 'arm_test_noprobe=="on"', {
196 'ARM_TEST_NO_FEATURE_PROBE',
200 'target_conditions': [
201 ['_toolset=="host"', {
203 ['v8_target_arch==host_arch and android_webview_build==0', {
204 # Host built with an Arm CXX compiler.
206 [ 'arm_version==7', {
207 'cflags': ['-march=armv7-a',],
209 [ 'arm_version==7 or arm_version=="default"', {
211 [ 'arm_fpu!="default"', {
212 'cflags': ['-mfpu=<(arm_fpu)',],
216 [ 'arm_float_abi!="default"', {
217 'cflags': ['-mfloat-abi=<(arm_float_abi)',],
220 'cflags': ['-mthumb',],
223 'cflags': ['-marm',],
227 # 'v8_target_arch!=host_arch'
228 # Host not built with an Arm CXX compiler (simulator build).
230 [ 'arm_float_abi=="hard"', {
232 'USE_EABI_HARDFLOAT=1',
235 [ 'arm_float_abi=="softfp" or arm_float_abi=="default"', {
237 'USE_EABI_HARDFLOAT=0',
243 }], # _toolset=="host"
244 ['_toolset=="target"', {
246 ['v8_target_arch==target_arch and android_webview_build==0', {
247 # Target built with an Arm CXX compiler.
249 [ 'arm_version==7', {
250 'cflags': ['-march=armv7-a',],
252 [ 'arm_version==7 or arm_version=="default"', {
254 [ 'arm_fpu!="default"', {
255 'cflags': ['-mfpu=<(arm_fpu)',],
259 [ 'arm_float_abi!="default"', {
260 'cflags': ['-mfloat-abi=<(arm_float_abi)',],
263 'cflags': ['-mthumb',],
266 'cflags': ['-marm',],
270 # 'v8_target_arch!=target_arch'
271 # Target not built with an Arm CXX compiler (simulator build).
273 [ 'arm_float_abi=="hard"', {
275 'USE_EABI_HARDFLOAT=1',
278 [ 'arm_float_abi=="softfp" or arm_float_abi=="default"', {
280 'USE_EABI_HARDFLOAT=0',
286 # v8 is optimized for speed, which takes precedence over
287 # size optimization in LTO.
295 }], # _toolset=="target"
297 }], # v8_target_arch=="arm"
298 ['v8_target_arch=="arm64"', {
300 'V8_TARGET_ARCH_ARM64',
303 ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', {
305 'V8_TARGET_ARCH_PPC',
308 ['v8_target_arch=="ppc64"', {
310 'V8_TARGET_ARCH_PPC64',
313 ['v8_host_byteorder=="little"', {
315 'V8_TARGET_ARCH_PPC_LE',
318 ['v8_host_byteorder=="big"', {
320 'V8_TARGET_ARCH_PPC_BE',
324 # Work around AIX ceil, trunc and round oddities.
325 'cflags': [ '-mcpu=power5+ -mfprnd' ],
328 # Work around AIX assembler popcntb bug.
329 'cflags': [ '-mno-popcntb' ],
335 ['v8_target_arch=="ia32"', {
337 'V8_TARGET_ARCH_IA32',
339 }], # v8_target_arch=="ia32"
340 ['v8_target_arch=="x87"', {
342 'V8_TARGET_ARCH_X87',
344 'cflags': ['-march=i586'],
345 }], # v8_target_arch=="x87"
346 ['v8_target_arch=="mips"', {
348 'V8_TARGET_ARCH_MIPS',
351 [ 'v8_can_use_fpu_instructions=="true"', {
353 'CAN_USE_FPU_INSTRUCTIONS',
356 [ 'v8_use_mips_abi_hardfloat=="true"', {
358 '__mips_hard_float=1',
359 'CAN_USE_FPU_INSTRUCTIONS',
363 '__mips_soft_float=1'
367 'target_conditions': [
368 ['_toolset=="target"', {
370 ['v8_target_arch==target_arch and android_webview_build==0', {
371 # Target built with a Mips CXX compiler.
374 '-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
378 [ 'v8_use_mips_abi_hardfloat=="true"', {
379 'cflags': ['-mhard-float'],
380 'ldflags': ['-mhard-float'],
382 'cflags': ['-msoft-float'],
383 'ldflags': ['-msoft-float'],
385 ['mips_arch_variant=="r6"', {
387 '_MIPS_ARCH_MIPS32R6',
390 'cflags!': ['-mfp32', '-mfpxx'],
391 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
394 '-Wl,--dynamic-linker=$(LDSO_PATH)',
395 '-Wl,--rpath=$(LD_R_PATH)',
398 ['mips_arch_variant=="r2"', {
400 [ 'mips_fpu_mode=="fp64"', {
402 '_MIPS_ARCH_MIPS32R2',
405 'cflags': ['-mfp64'],
407 ['mips_fpu_mode=="fpxx"', {
409 '_MIPS_ARCH_MIPS32R2',
412 'cflags': ['-mfpxx'],
414 ['mips_fpu_mode=="fp32"', {
416 '_MIPS_ARCH_MIPS32R2',
419 'cflags': ['-mfp32'],
422 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
423 'ldflags': ['-mips32r2'],
425 ['mips_arch_variant=="r1"', {
429 'cflags!': ['-mfp64', '-mfpxx'],
430 'cflags': ['-mips32', '-Wa,-mips32'],
431 'ldflags': ['-mips32'],
433 ['mips_arch_variant=="rx"', {
435 '_MIPS_ARCH_MIPS32RX',
438 'cflags!': ['-mfp64', '-mfp32'],
439 'cflags': ['-mips32', '-Wa,-mips32', '-mfpxx'],
440 'ldflags': ['-mips32'],
444 # 'v8_target_arch!=target_arch'
445 # Target not built with an MIPS CXX compiler (simulator build).
447 ['mips_arch_variant=="r6"', {
449 '_MIPS_ARCH_MIPS32R6',
453 ['mips_arch_variant=="r2"', {
455 [ 'mips_fpu_mode=="fp64"', {
457 '_MIPS_ARCH_MIPS32R2',
461 ['mips_fpu_mode=="fpxx"', {
463 '_MIPS_ARCH_MIPS32R2',
467 ['mips_fpu_mode=="fp32"', {
469 '_MIPS_ARCH_MIPS32R2',
475 ['mips_arch_variant=="r1"', {
480 ['mips_arch_variant=="rx"', {
482 '_MIPS_ARCH_MIPS32RX',
489 }], #_toolset=="target"
490 ['_toolset=="host"', {
492 ['mips_arch_variant=="rx"', {
494 '_MIPS_ARCH_MIPS32RX',
498 ['mips_arch_variant=="r6"', {
500 '_MIPS_ARCH_MIPS32R6',
504 ['mips_arch_variant=="r2"', {
506 ['mips_fpu_mode=="fp64"', {
508 '_MIPS_ARCH_MIPS32R2',
512 ['mips_fpu_mode=="fpxx"', {
514 '_MIPS_ARCH_MIPS32R2',
518 ['mips_fpu_mode=="fp32"', {
520 '_MIPS_ARCH_MIPS32R2',
526 ['mips_arch_variant=="r1"', {
527 'defines': ['FPU_MODE_FP32',],
530 }], #_toolset=="host"
532 }], # v8_target_arch=="mips"
533 ['v8_target_arch=="mipsel"', {
535 'V8_TARGET_ARCH_MIPS',
538 [ 'v8_can_use_fpu_instructions=="true"', {
540 'CAN_USE_FPU_INSTRUCTIONS',
543 [ 'v8_use_mips_abi_hardfloat=="true"', {
545 '__mips_hard_float=1',
546 'CAN_USE_FPU_INSTRUCTIONS',
550 '__mips_soft_float=1'
554 'target_conditions': [
555 ['_toolset=="target"', {
557 ['v8_target_arch==target_arch and android_webview_build==0', {
558 # Target built with a Mips CXX compiler.
561 '-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
565 [ 'v8_use_mips_abi_hardfloat=="true"', {
566 'cflags': ['-mhard-float'],
567 'ldflags': ['-mhard-float'],
569 'cflags': ['-msoft-float'],
570 'ldflags': ['-msoft-float'],
572 ['mips_arch_variant=="r6"', {
574 '_MIPS_ARCH_MIPS32R6',
577 'cflags!': ['-mfp32', '-mfpxx'],
578 'cflags': ['-mips32r6', '-Wa,-mips32r6'],
581 '-Wl,--dynamic-linker=$(LDSO_PATH)',
582 '-Wl,--rpath=$(LD_R_PATH)',
585 ['mips_arch_variant=="r2"', {
587 [ 'mips_fpu_mode=="fp64"', {
589 '_MIPS_ARCH_MIPS32R2',
592 'cflags': ['-mfp64'],
594 ['mips_fpu_mode=="fpxx"', {
596 '_MIPS_ARCH_MIPS32R2',
599 'cflags': ['-mfpxx'],
601 ['mips_fpu_mode=="fp32"', {
603 '_MIPS_ARCH_MIPS32R2',
606 'cflags': ['-mfp32'],
609 'cflags': ['-mips32r2', '-Wa,-mips32r2'],
610 'ldflags': ['-mips32r2'],
612 ['mips_arch_variant=="r1"', {
613 'cflags!': ['-mfp64', '-mfpxx'],
614 'cflags': ['-mips32', '-Wa,-mips32'],
615 'ldflags': ['-mips32'],
617 ['mips_arch_variant=="rx"', {
619 '_MIPS_ARCH_MIPS32RX',
622 'cflags!': ['-mfp64', '-mfp32'],
623 'cflags': ['-mips32', '-Wa,-mips32', '-mfpxx'],
624 'ldflags': ['-mips32'],
626 ['mips_arch_variant=="loongson"', {
628 '_MIPS_ARCH_LOONGSON',
631 'cflags!': ['-mfp64', '-mfp32', '-mfpxx'],
632 'cflags': ['-mips3', '-Wa,-mips3'],
636 # 'v8_target_arch!=target_arch'
637 # Target not built with an MIPS CXX compiler (simulator build).
639 ['mips_arch_variant=="r6"', {
641 '_MIPS_ARCH_MIPS32R6',
645 ['mips_arch_variant=="r2"', {
647 [ 'mips_fpu_mode=="fp64"', {
649 '_MIPS_ARCH_MIPS32R2',
653 ['mips_fpu_mode=="fpxx"', {
655 '_MIPS_ARCH_MIPS32R2',
659 ['mips_fpu_mode=="fp32"', {
661 '_MIPS_ARCH_MIPS32R2',
667 ['mips_arch_variant=="r1"', {
672 ['mips_arch_variant=="rx"', {
674 '_MIPS_ARCH_MIPS32RX',
678 ['mips_arch_variant=="loongson"', {
680 '_MIPS_ARCH_LOONGSON',
687 }], #_toolset=="target
688 ['_toolset=="host"', {
690 ['mips_arch_variant=="rx"', {
692 '_MIPS_ARCH_MIPS32RX',
696 ['mips_arch_variant=="r6"', {
698 '_MIPS_ARCH_MIPS32R6',
702 ['mips_arch_variant=="r2"', {
704 ['mips_fpu_mode=="fp64"', {
706 '_MIPS_ARCH_MIPS32R2',
710 ['mips_fpu_mode=="fpxx"', {
712 '_MIPS_ARCH_MIPS32R2',
716 ['mips_fpu_mode=="fp32"', {
718 '_MIPS_ARCH_MIPS32R2',
724 ['mips_arch_variant=="r1"', {
725 'defines': ['FPU_MODE_FP32',],
727 ['mips_arch_variant=="loongson"', {
729 '_MIPS_ARCH_LOONGSON',
736 }], # v8_target_arch=="mipsel"
737 ['v8_target_arch=="mips64el"', {
739 'V8_TARGET_ARCH_MIPS64',
742 [ 'v8_can_use_fpu_instructions=="true"', {
744 'CAN_USE_FPU_INSTRUCTIONS',
747 [ 'v8_use_mips_abi_hardfloat=="true"', {
749 '__mips_hard_float=1',
750 'CAN_USE_FPU_INSTRUCTIONS',
754 '__mips_soft_float=1'
758 'target_conditions': [
759 ['_toolset=="target"', {
761 ['v8_target_arch==target_arch and android_webview_build==0', {
764 '-Wno-error=array-bounds', # Workaround https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
768 [ 'v8_use_mips_abi_hardfloat=="true"', {
769 'cflags': ['-mhard-float'],
770 'ldflags': ['-mhard-float'],
772 'cflags': ['-msoft-float'],
773 'ldflags': ['-msoft-float'],
775 ['mips_arch_variant=="r6"', {
776 'defines': ['_MIPS_ARCH_MIPS64R6',],
777 'cflags': ['-mips64r6', '-mabi=64', '-Wa,-mips64r6'],
779 '-mips64r6', '-mabi=64',
780 '-Wl,--dynamic-linker=$(LDSO_PATH)',
781 '-Wl,--rpath=$(LD_R_PATH)',
784 ['mips_arch_variant=="r2"', {
785 'defines': ['_MIPS_ARCH_MIPS64R2',],
786 'cflags': ['-mips64r2', '-mabi=64', '-Wa,-mips64r2'],
788 '-mips64r2', '-mabi=64',
789 '-Wl,--dynamic-linker=$(LDSO_PATH)',
790 '-Wl,--rpath=$(LD_R_PATH)',
795 # 'v8_target_arch!=target_arch'
796 # Target not built with an MIPS CXX compiler (simulator build).
798 ['mips_arch_variant=="r6"', {
799 'defines': ['_MIPS_ARCH_MIPS64R6',],
801 ['mips_arch_variant=="r2"', {
802 'defines': ['_MIPS_ARCH_MIPS64R2',],
807 }], #'_toolset=="target"
808 ['_toolset=="host"', {
810 ['mips_arch_variant=="r6"', {
811 'defines': ['_MIPS_ARCH_MIPS64R6',],
813 ['mips_arch_variant=="r2"', {
814 'defines': ['_MIPS_ARCH_MIPS64R2',],
817 }], #'_toolset=="host"
819 }], # v8_target_arch=="mips64el"
820 ['v8_target_arch=="x64"', {
822 'V8_TARGET_ARCH_X64',
825 'ARCHS': [ 'x86_64' ],
829 'StackReserveSize': '2097152',
832 'msvs_configuration_platform': 'x64',
833 }], # v8_target_arch=="x64"
834 ['v8_target_arch=="x32"', {
836 # x32 port shares the source code with x64 port.
837 'V8_TARGET_ARCH_X64',
838 'V8_TARGET_ARCH_32_BIT',
842 # Inhibit warning if long long type is used.
848 }], # v8_target_arch=="x32"
849 ['linux_use_gold_flags==1', {
850 # Newer gccs and clangs support -fuse-ld, use the flag to force gold
852 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
853 'ldflags': [ '-fuse-ld=gold', ],
855 ['linux_use_bundled_binutils==1', {
857 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
860 ['linux_use_bundled_gold==1', {
861 # Put our binutils, which contains gold in the search path. We pass
862 # the path to gold to the compiler. gyp leaves unspecified what the
863 # cwd is when running the compiler, so the normal gyp path-munging
864 # fails us. This hack gets the right path.
866 '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
873 # 4351: VS 2005 and later are warning us that they've fixed a bug
874 # present in VS 2003 and earlier.
875 'msvs_disabled_warnings': [4351],
876 'msvs_configuration_attributes': {
877 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
878 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
882 ['OS=="win" and v8_target_arch=="ia32"', {
884 'VCCLCompilerTool': {
885 # Ensure no surprising artifacts from 80bit double math with x86.
886 'AdditionalOptions': ['/arch:SSE2'],
890 ['OS=="win" and v8_enable_prof==1', {
893 'GenerateMapFile': 'true',
897 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
898 or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
899 v8_target_arch=="ia32"', {
903 '-mmmx', # Allows mmintrin.h for MMX intrinsics.
906 ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
907 or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
908 (v8_target_arch=="arm" or v8_target_arch=="ia32" or \
909 v8_target_arch=="x87" or v8_target_arch=="mips" or \
910 v8_target_arch=="mipsel" or v8_target_arch=="ppc")', {
911 'target_conditions': [
912 ['_toolset=="host"', {
914 ['host_cxx_is_biarch==1', {
915 'cflags': [ '-m32' ],
916 'ldflags': [ '-m32' ]
923 ['_toolset=="target"', {
925 ['target_cxx_is_biarch==1 and nacl_target_arch!="nacl_x64"', {
926 'cflags': [ '-m32' ],
927 'ldflags': [ '-m32' ],
929 # Enable feedback-directed optimisation when building in android.
930 [ 'android_webview_build == 1', {
931 'aosp_build_settings': {
932 'LOCAL_FDO_SUPPORT': 'true',
942 ['(OS=="linux" or OS=="android") and \
943 (v8_target_arch=="x64" or v8_target_arch=="arm64" or \
944 v8_target_arch=="ppc64")', {
945 'target_conditions': [
946 ['_toolset=="host"', {
948 ['host_cxx_is_biarch==1', {
949 'cflags': [ '-m64' ],
950 'ldflags': [ '-m64' ]
954 ['_toolset=="target"', {
956 ['target_cxx_is_biarch==1', {
957 'cflags': [ '-m64' ],
958 'ldflags': [ '-m64' ],
960 # Enable feedback-directed optimisation when building in android.
961 [ 'android_webview_build == 1', {
962 'aosp_build_settings': {
963 'LOCAL_FDO_SUPPORT': 'true',
970 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
971 or OS=="netbsd" or OS=="qnx" or OS=="aix"', {
973 [ 'v8_no_strict_aliasing==1', {
974 'cflags': [ '-fno-strict-aliasing' ],
979 'defines': [ '__C99FEATURES__=1' ], # isinf() etc.
981 ['OS=="freebsd" or OS=="openbsd"', {
982 'cflags': [ '-I/usr/local/include' ],
985 'cflags': [ '-I/usr/pkg/include' ],
989 # Support for malloc(0)
990 '_LINUX_SOURCE_COMPAT=1',
993 [ 'v8_target_arch=="ppc"', {
994 'ldflags': [ '-Wl,-bmaxdata:0x60000000/dsa' ],
996 [ 'v8_target_arch=="ppc64"', {
997 'cflags': [ '-maix64' ],
998 'ldflags': [ '-maix64' ],
1004 # Abstract configuration for v8_optimized_debug == 0.
1008 'VCCLCompilerTool': {
1009 'Optimization': '0',
1011 ['component=="shared_library"', {
1012 'RuntimeLibrary': '3', # /MDd
1014 'RuntimeLibrary': '1', # /MTd
1019 'LinkIncremental': '2',
1023 'v8_enable_slow_dchecks%': 1,
1026 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
1027 OS=="qnx" or OS=="aix"', {
1036 '-ffunction-sections',
1041 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
1044 ['v8_enable_slow_dchecks==1', {
1046 'ENABLE_SLOW_DCHECKS',
1051 # Abstract configuration for v8_optimized_debug == 1.
1055 'VCCLCompilerTool': {
1056 'Optimization': '2',
1057 'InlineFunctionExpansion': '2',
1058 'EnableIntrinsicFunctions': 'true',
1059 'FavorSizeOrSpeed': '0',
1060 'StringPooling': 'true',
1061 'BasicRuntimeChecks': '0',
1063 ['component=="shared_library"', {
1064 'RuntimeLibrary': '3', #/MDd
1066 'RuntimeLibrary': '1', #/MTd
1071 'LinkIncremental': '1',
1072 'OptimizeReferences': '2',
1073 'EnableCOMDATFolding': '2',
1077 'v8_enable_slow_dchecks%': 0,
1080 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
1081 OS=="qnx" or OS=="aix"', {
1089 '-ffunction-sections',
1092 # TODO(crbug.com/272548): Avoid -O3 in NaCl
1093 # Don't use -O3 with sanitizers.
1094 ['nacl_target_arch=="none" and asan==0 and msan==0 and lsan==0 \
1095 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
1106 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
1107 'GCC_STRICT_ALIASING': 'YES',
1110 ['v8_enable_slow_dchecks==1', {
1112 'ENABLE_SLOW_DCHECKS',
1117 # Common settings for the Debug configuration.
1118 'DebugBaseCommon': {
1121 'ENABLE_DISASSEMBLER',
1129 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \
1130 OS=="qnx" or OS=="aix"', {
1131 'cflags': [ '-Woverloaded-virtual', '<(wno_array_bounds)', ],
1133 ['OS=="linux" and v8_enable_backtrace==1', {
1134 # Support for backtrace_symbols.
1135 'ldflags': [ '-rdynamic' ],
1138 'ldflags': [ '-Wl,-bbigtoc' ],
1142 'android_full_debug%': 1,
1145 ['android_full_debug==0', {
1146 # Disable full debug if we want a faster v8 in a debug build.
1147 # TODO(2304): pass DISABLE_DEBUG_ASSERT instead of hiding DEBUG.
1150 'ENABLE_SLOW_DCHECKS',
1155 ['linux_use_gold_flags==1', {
1156 'target_conditions': [
1157 ['_toolset=="target"', {
1159 # Experimentation found that using four linking threads
1160 # saved ~20% of link time.
1161 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
1162 # Only apply this to the target linker, since the host
1163 # linker might not be gold, but isn't used much anyway.
1165 '-Wl,--thread-count=4',
1171 }, # DebugBaseCommon
1173 'inherit_from': ['DebugBaseCommon'],
1175 ['v8_optimized_debug==0', {
1176 'inherit_from': ['DebugBase0'],
1178 'inherit_from': ['DebugBase1'],
1184 'v8_enable_slow_dchecks%': 0,
1187 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \
1194 '-ffunction-sections',
1195 '<(wno_array_bounds)',
1198 # TODO(crbug.com/272548): Avoid -O3 in NaCl
1199 # Don't use -O3 with sanitizers.
1200 ['nacl_target_arch=="none" and asan==0 and msan==0 and lsan==0 \
1201 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
1217 '-ffunction-sections',
1223 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
1225 # -fstrict-aliasing. Mainline gcc
1226 # enables this at -O2 and above,
1227 # but Apple gcc does not unless it
1228 # is specified explicitly.
1229 'GCC_STRICT_ALIASING': 'YES',
1234 'VCCLCompilerTool': {
1235 'Optimization': '2',
1236 'InlineFunctionExpansion': '2',
1237 'EnableIntrinsicFunctions': 'true',
1238 'FavorSizeOrSpeed': '0',
1239 'StringPooling': 'true',
1241 ['component=="shared_library"', {
1242 'RuntimeLibrary': '2', #/MD
1244 'RuntimeLibrary': '0', #/MT
1249 'LinkIncremental': '1',
1250 'OptimizeReferences': '2',
1251 'EnableCOMDATFolding': '2',
1255 ['v8_enable_slow_dchecks==1', {
1257 'ENABLE_SLOW_DCHECKS',
1263 }, # target_defaults