Commit 54f663e2 authored by vogelheim's avatar vogelheim Committed by Commit bot

Revert of Re-land "Fix double-building of v8 in GN builds" (patchset #2...

Revert of Re-land "Fix double-building of v8 in GN builds" (patchset #2 id:20001 of https://codereview.chromium.org/2171083003/ )

Reason for revert:
Reverted, because it breaks some funky android build.

Can reproduce breakage locally, w/ args.gn as follows:
disable_brotli_filter = true
disable_file_support = true
disable_ftp_support = true
enable_websockets = false
ffmpeg_branding = "Chrome"
is_component_build = false
is_debug = true
proprietary_codecs = true
symbol_level = 1
target_cpu = "x86"
target_os = "android"
use_goma = true
use_platform_icu_alternatives = true

This ends up building the mkpeephole tool w/ an architecture that won't run on the build machine.

Original issue's description:
> Re-land "Fix double-building of v8 in GN builds"
>
> This re-lands r37926 w/ the needed fix for cross-compiles; we
> can only re-use the default toolchain when the host can actually
> run it.
>
> R=machenbach@chromium.org
> BUG=629825
>
> Committed: https://crrev.com/5b762044b53f988fa9a534fe1a84f9938b3abd75
> Cr-Commit-Position: refs/heads/master@{#37970}

TBR=machenbach@chromium.org,dpranke@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=629825

Review-Url: https://codereview.chromium.org/2175693003
Cr-Commit-Position: refs/heads/master@{#37984}
parent 45f990c3
......@@ -38,46 +38,26 @@ declare_args() {
# configurations v8 runs on.
if (v8_snapshot_toolchain == "") {
if (host_cpu == "x64" && host_os == "linux") {
if (v8_current_cpu == v8_target_cpu && current_cpu == target_cpu &&
(target_cpu == "x86" || target_cpu == "x64")) {
# 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 target_cpu == "x86" v8_target_cpu == "arm"
# will use the //build/toolchain/linux:clang_x86 toolchain, but have the
# same effect as if you specified
#
# custom_toolchain="//build/toolchain/linux:clang_x86_v8_arm"
#
# As a result, if we didn't take that into account we could
# accidentally end up building two identical copies of v8.
#
# So, we can re-use the default toolchain for the snapshot in these
# casees, but only when the host is actually capable of running the
# target code, which at this time means that the target_cpu == x86
# or x64.
v8_snapshot_toolchain = default_toolchain
if (current_cpu == "arm" || current_cpu == "mipsel" ||
current_cpu == "x86") {
_snapshot_cpu = "x86"
} else {
if (current_cpu == "arm" || current_cpu == "mipsel" ||
current_cpu == "x86") {
_snapshot_cpu = "x86"
} else {
assert(current_cpu == "arm64" || current_cpu == "x64" ||
current_cpu == "mips64el",
"Need environment for this arch: $current_cpu")
_snapshot_cpu = "x64"
}
assert(current_cpu == "arm64" || current_cpu == "x64" ||
current_cpu == "mips64el",
"Need environment for this arch: $current_cpu")
_snapshot_cpu = "x64"
}
if (v8_current_cpu != _snapshot_cpu) {
_cpus = "${_snapshot_cpu}_v8_${v8_current_cpu}"
} else {
_cpus = _snapshot_cpu
}
if (v8_current_cpu != _snapshot_cpu) {
_cpus = "${_snapshot_cpu}_v8_${v8_current_cpu}"
} else {
_cpus = _snapshot_cpu
}
if ((host_os == "linux" && current_os == "android") || is_clang) {
v8_snapshot_toolchain = "//build/toolchain/linux:clang_${_cpus}"
} else {
v8_snapshot_toolchain = "//build/toolchain/linux:${_cpus}"
}
if ((host_os == "linux" && current_os == "android") || is_clang) {
v8_snapshot_toolchain = "//build/toolchain/linux:clang_${_cpus}"
} else {
v8_snapshot_toolchain = "//build/toolchain/linux:${_cpus}"
}
} else if (host_os == "mac" && current_os == "win") {
assert(v8_current_cpu == current_cpu,
......
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