Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: BUILD.gn

Issue 993173003: Fix the toolchain used to build the snapshots in GN. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: update comments Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: BUILD.gn
diff --git a/BUILD.gn b/BUILD.gn
index 81e6fef0ced26530e6b7b346f550a3b0bd8694c6..ee95145b179a5a1c00ebd64e884ff7c1ba0bce3f 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -18,10 +18,28 @@ v8_interpreted_regexp = false
v8_object_print = false
v8_postmortem_support = false
v8_use_snapshot = true
+
+# TODO(GYP): We should be just target_cpu and not need v8_target_arch.
v8_target_arch = current_cpu
+
v8_random_seed = "314159265"
v8_toolset_for_d8 = "host"
+# The snapshot needs to be compiled for the host, but compiled with
+# a toolchain that matches the bit-width of the target.
+#
+# TODO(GYP): For now we only support 32-bit little-endian target builds from
+# an x86/x64 Linux host. Eventually we need to support all of the
+# host/target configurations v8 runs on.
+if (target_os == "android" || target_os == "chromeos") {
+ assert(host_os == "linux" &&
+ (host_cpu == "x86" || host_cpu == "x64") &&
+ (target_cpu == "arm" || target_cpu == "mipsel" || target_cpu == "x86"))
+ snapshot_toolchain = "//build/toolchain/linux:clang_x86"
+} else {
+ snapshot_toolchain = default_toolchain
+}
+
###############################################################################
# Configurations
#
@@ -322,7 +340,7 @@ action("run_mksnapshot") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
deps = [
- ":mksnapshot($host_toolchain)",
+ ":mksnapshot($snapshot_toolchain)",
]
script = "tools/run.py"
@@ -332,7 +350,7 @@ action("run_mksnapshot") {
]
args = [
- "./" + rebase_path(get_label_info(":mksnapshot($host_toolchain)",
+ "./" + rebase_path(get_label_info(":mksnapshot($snapshot_toolchain)",
"root_out_dir") + "/mksnapshot",
root_build_dir),
"--log-snapshot-positions",
@@ -1428,7 +1446,7 @@ source_set("v8_libplatform") {
# Executables
#
-if (current_toolchain == host_toolchain) {
+if (current_toolchain == snapshot_toolchain) {
executable("mksnapshot") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698