Commit 3536db45 authored by dpranke's avatar dpranke Committed by Commit bot

Fix double-building of v8 in GN builds when setting just v8_target_cpu.

Because of the somewhat strange way default toolchains and custom
toolchains and user-specified arguments work in GN, if you did a v8
build that just set v8_target_cpu, you could end up building two
identical copies of v8 (see the comments in the change for more).

This CL identifies that case and fixes it.

R=machenbach@chromium.org
BUG=629825

Review-Url: https://codereview.chromium.org/2166173002
Cr-Commit-Position: refs/heads/master@{#37926}
parent 714b95f0
......@@ -33,11 +33,21 @@ declare_args() {
v8_snapshot_toolchain = ""
}
# TODO(GYP): For now we only support 32-bit little-endian target builds from an
# x64 Linux host. Eventually we need to support all of the host/target
# configurations v8 runs on.
# TODO(GYP): Fill in any missing host/target combinations.
if (v8_snapshot_toolchain == "") {
if (host_cpu == "x64" && host_os == "linux") {
if (v8_current_cpu == v8_target_cpu && current_cpu == target_cpu) {
# Args that are specified by the user can end up having the same
# effect as args that are specified in a toolchain; for example,
# building on linux x64 with v8_target_cpu == "arm64" will use
# the //build/toolchain/linux:clang_x64 toolchain, but have the
# same effect as if you specified
#
# custom_toolchain="//build/toolchain/linux:clang_x64_v8_arm64"
#
# As a result, if we didn't take that into account we could
# accidentally end up building two identical copies of v8.
v8_snapshot_toolchain = default_toolchain
} else if (host_cpu == "x64" && host_os == "linux") {
if (current_cpu == "arm" || current_cpu == "mipsel" ||
current_cpu == "x86") {
_snapshot_cpu = "x86"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment