Browse Source

fix: build torque with x64 toolchain

Co-Authored-By: Alexey Kuzmin <[email protected]>
John Kleinschmidt 6 years ago
parent
commit
df32326ce5

+ 5 - 0
patches/common/v8/.patches.yaml

@@ -65,3 +65,8 @@ patches:
   author: Shelley Vohr <[email protected]>
   file: expose_mksnapshot.patch
   description: Needed in order to build mksnapshot on arm.
+-
+  author: Aleksei Kuzmin <[email protected]>
+  file: build-torque-with-x64-toolchain-on-arm.patch
+  description: |
+    torque binary has to be run during the build.

+ 23 - 0
patches/common/v8/build-torque-with-x64-toolchain-on-arm.patch

@@ -0,0 +1,23 @@
+diff --git a/BUILD.gn b/BUILD.gn
+index 456a318..af803ff 100644
+--- a/BUILD.gn
++++ b/BUILD.gn
+@@ -870,7 +870,8 @@ action("run_torque") {
+   # is the target toolchain and, hence, can't be used.
+   v8_torque_toolchain = v8_snapshot_toolchain
+   if (host_cpu == "x64" &&
+-      (v8_current_cpu == "mips" || v8_current_cpu == "mips64")) {
++      (v8_current_cpu == "mips" || v8_current_cpu == "mips64" ||
++       v8_current_cpu == "arm" || v8_current_cpu == "arm64")) {
+     v8_torque_toolchain = "//build/toolchain/linux:clang_x64"
+   }
+ 
+@@ -3079,7 +3080,7 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) {
+   }
+ }
+ 
+-if (current_toolchain == v8_snapshot_toolchain) {
++if (current_toolchain == current_toolchain) {
+   v8_executable("torque") {
+     visibility = [ ":*" ]  # Only targets in this file can depend on this.
+