build: fix native_mksnapshot build (#15770)

* build: fix native_mksnapshot build

When we changed our electron_mksnapshot_zip target to include the v8_context_snapshot_generator, this dependency made the `run_mksnapshot` target run which was trying to run an arm/arm64 binary on x64 hardware.

Don't use custom build args for native_mksnapshot as they are not needed

* Added comment on why snapshot_blob.bin is skipped on arm/arm64
This commit is contained in:
John Kleinschmidt 2018-11-21 15:19:19 -05:00 committed by GitHub
parent 9e8b26cc4e
commit bb7c63c052
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 50 additions and 6 deletions

View file

@ -18,3 +18,4 @@ dcheck.patch
disable-warning-win.patch
expose_mksnapshot.patch
build-torque-with-x64-toolchain-on-arm.patch
do_not_run_arm_arm64_mksnapshot_binaries.patch

View file

@ -0,0 +1,36 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: John Kleinschmidt <jkleinsc@github.com>
Date: Mon, 19 Nov 2018 18:33:56 -0500
Subject: Do not run arm/arm64 mksnapshot binaries
For arm and arm64 target_arches, Chromium builds mksnapshot as an x64 binary and
as part of that build mksnapshot is executed to produce snapshot_blob.bin.
Chromium does not build native arm and arm64 binaries of mksnapshot, but
Electron does, so this patch makes sure that the build doesn't try to run
the mksnapshot binary if it was built for arm or arm64.
diff --git a/BUILD.gn b/BUILD.gn
index b1194e4b828e66d8d09fac57481efe313031f3ac..c256945650c24324c28a2e17fb299a1d0c2dcd19 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1247,9 +1247,19 @@ if (v8_use_snapshot && v8_use_external_startup_data) {
]
public_deps = [
":natives_blob",
- ":run_mksnapshot_default",
]
+ if (v8_snapshot_toolchain == "//build/toolchain/linux:clang_arm" ||
+ v8_snapshot_toolchain == "//build/toolchain/linux:clang_arm64") {
+ public_deps += [
+ ":mksnapshot($v8_snapshot_toolchain)",
+ ]
+ } else {
+ public_deps += [
+ ":run_mksnapshot_default",
+ ]
+ }
+
if (v8_use_multi_snapshots) {
public_deps += [ ":run_mksnapshot_trusted" ]
}