| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
| 6 import("//build/config/arm.gni") | 6 import("//build/config/arm.gni") |
| 7 import("//build/config/mips.gni") | 7 import("//build/config/mips.gni") |
| 8 import("//build/config/sanitizers/sanitizers.gni") | 8 import("//build/config/sanitizers/sanitizers.gni") |
| 9 | 9 |
| 10 # Because standalone V8 builds are not supported, assume this is part of a | 10 # Because standalone V8 builds are not supported, assume this is part of a |
| 11 # Chromium build. | 11 # Chromium build. |
| 12 import("//build/module_args/v8.gni") | 12 import("//build/module_args/v8.gni") |
| 13 | 13 |
| 14 import("snapshot_toolchain.gni") |
| 15 |
| 14 # TODO(jochen): These will need to be user-settable to support standalone V8 | 16 # TODO(jochen): These will need to be user-settable to support standalone V8 |
| 15 # builds. | 17 # builds. |
| 16 v8_deprecation_warnings = false | 18 v8_deprecation_warnings = false |
| 17 v8_enable_disassembler = false | 19 v8_enable_disassembler = false |
| 18 v8_enable_gdbjit = false | 20 v8_enable_gdbjit = false |
| 19 v8_enable_handle_zapping = true | 21 v8_enable_handle_zapping = true |
| 20 v8_enable_i18n_support = true | 22 v8_enable_i18n_support = true |
| 21 v8_enable_verify_heap = false | 23 v8_enable_verify_heap = false |
| 22 v8_interpreted_regexp = false | 24 v8_interpreted_regexp = false |
| 23 v8_object_print = false | 25 v8_object_print = false |
| 24 v8_postmortem_support = false | 26 v8_postmortem_support = false |
| 25 v8_use_snapshot = true | 27 v8_use_snapshot = true |
| 26 v8_random_seed = "314159265" | 28 v8_random_seed = "314159265" |
| 27 v8_toolset_for_d8 = "host" | 29 v8_toolset_for_d8 = "host" |
| 28 | 30 |
| 29 if (is_msan) { | 31 if (is_msan) { |
| 30 # Running the V8-generated code on an ARM simulator is a powerful hack that | 32 # Running the V8-generated code on an ARM simulator is a powerful hack that |
| 31 # allows the tool to see the memory accesses from JITted code. Without this | 33 # allows the tool to see the memory accesses from JITted code. Without this |
| 32 # flag, JS code causes false positive reports from MSan. | 34 # flag, JS code causes false positive reports from MSan. |
| 33 v8_target_arch = "arm64" | 35 v8_target_arch = "arm64" |
| 34 } else { | 36 } else { |
| 35 v8_target_arch = target_cpu | 37 v8_target_arch = target_cpu |
| 36 } | 38 } |
| 37 | 39 |
| 38 # The snapshot needs to be compiled for the host, but compiled with | |
| 39 # a toolchain that matches the bit-width of the target. | |
| 40 # | |
| 41 # TODO(GYP): For now we only support 32-bit little-endian target builds from an | |
| 42 # x64 Linux host. Eventually we need to support all of the host/target | |
| 43 # configurations v8 runs on. | |
| 44 if (host_cpu == "x64" && host_os == "linux") { | |
| 45 if (target_cpu == "arm" || target_cpu == "mipsel" || target_cpu == "x86") { | |
| 46 snapshot_toolchain = "//build/toolchain/linux:clang_x86" | |
| 47 } else if (target_cpu == "x64") { | |
| 48 snapshot_toolchain = "//build/toolchain/linux:clang_x64" | |
| 49 } else { | |
| 50 assert(false, "Need environment for this arch") | |
| 51 } | |
| 52 } else { | |
| 53 snapshot_toolchain = default_toolchain | |
| 54 } | |
| 55 | |
| 56 ############################################################################### | 40 ############################################################################### |
| 57 # Configurations | 41 # Configurations |
| 58 # | 42 # |
| 59 config("internal_config") { | 43 config("internal_config") { |
| 60 visibility = [ ":*" ] # Only targets in this file can depend on this. | 44 visibility = [ ":*" ] # Only targets in this file can depend on this. |
| 61 | 45 |
| 62 include_dirs = [ "." ] | 46 include_dirs = [ "." ] |
| 63 | 47 |
| 64 if (is_component_build) { | 48 if (is_component_build) { |
| 65 defines = [ | 49 defines = [ |
| (...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1812 ":v8_base", | 1796 ":v8_base", |
| 1813 ":v8_nosnapshot", | 1797 ":v8_nosnapshot", |
| 1814 ] | 1798 ] |
| 1815 } | 1799 } |
| 1816 | 1800 |
| 1817 public_configs = [ ":external_config" ] | 1801 public_configs = [ ":external_config" ] |
| 1818 } | 1802 } |
| 1819 } | 1803 } |
| 1820 | 1804 |
| 1821 if ((current_toolchain == host_toolchain && v8_toolset_for_d8 == "host") || | 1805 if ((current_toolchain == host_toolchain && v8_toolset_for_d8 == "host") || |
| 1806 (current_toolchain == snapshot_toolchain && v8_toolset_for_d8 == "host") || |
| 1822 (current_toolchain != host_toolchain && v8_toolset_for_d8 == "target")) { | 1807 (current_toolchain != host_toolchain && v8_toolset_for_d8 == "target")) { |
| 1823 executable("d8") { | 1808 executable("d8") { |
| 1824 sources = [ | 1809 sources = [ |
| 1825 "src/d8.cc", | 1810 "src/d8.cc", |
| 1826 "src/d8.h", | 1811 "src/d8.h", |
| 1827 ] | 1812 ] |
| 1828 | 1813 |
| 1829 configs -= [ "//build/config/compiler:chromium_code" ] | 1814 configs -= [ "//build/config/compiler:chromium_code" ] |
| 1830 configs += [ "//build/config/compiler:no_chromium_code" ] | 1815 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 1831 configs += [ | 1816 configs += [ |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1855 if (!is_component_build) { | 1840 if (!is_component_build) { |
| 1856 sources += [ | 1841 sources += [ |
| 1857 "$target_gen_dir/d8-js.cc", | 1842 "$target_gen_dir/d8-js.cc", |
| 1858 ] | 1843 ] |
| 1859 } | 1844 } |
| 1860 if (v8_enable_i18n_support) { | 1845 if (v8_enable_i18n_support) { |
| 1861 deps += [ "//third_party/icu" ] | 1846 deps += [ "//third_party/icu" ] |
| 1862 } | 1847 } |
| 1863 } | 1848 } |
| 1864 } | 1849 } |
| OLD | NEW |