From 734cf8b9b190f98aefa85ae7b2d7e33f7eee22a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Gro=C3=9F?= Date: Mon, 11 Apr 2022 17:23:32 +0200 Subject: [PATCH] [ext-code-space] Enable the external code space on Android MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The external code space is required for the sandbox, so enable it on Android to be able to enable the sandbox there as well in the future. Bug: v8:11880 Change-Id: Ic7ba29c77affc3e0e83c8a93f2f6f53b3c72b8e8 Cq-Include-Trybots: luci.v8.try:v8_linux64_heap_sandbox_dbg_ng,v8_linux_arm64_sim_heap_sandbox_dbg_ng Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3578799 Reviewed-by: Igor Sheludko Commit-Queue: Samuel Groß Cr-Commit-Position: refs/heads/main@{#79924} --- BUILD.gn | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index fec387d31e..05c38bc3ca 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -299,7 +299,7 @@ declare_args() { # Enable the experimental V8 sandbox. # Sets -DV8_SANDBOX. - v8_enable_sandbox = false + v8_enable_sandbox = "" # Enable external pointer sandboxing. Requires v8_enable_sandbox. # Sets -DV8_SANDBOXED_EXTERNAL_POINRTERS. @@ -421,13 +421,10 @@ if (v8_enable_short_builtin_calls == "") { v8_current_cpu == "x64" || (!is_android && v8_current_cpu == "arm64") } if (v8_enable_external_code_space == "") { - # Can't use !is_android here, because Torque toolchain is affected by - # the value of this flag but actually runs on the host side. v8_enable_external_code_space = v8_enable_pointer_compression && (v8_current_cpu == "x64" || - (target_os != "android" && target_os != "fuchsia" && - v8_current_cpu == "arm64")) + (target_os != "fuchsia" && v8_current_cpu == "arm64")) } if (v8_enable_maglev == "") { v8_enable_maglev = v8_current_cpu == "x64" && v8_enable_pointer_compression @@ -493,10 +490,12 @@ if (v8_enable_shared_ro_heap == "") { v8_enable_pointer_compression_shared_cage } -# Enable the v8 sandbox on 64-bit Chromium builds. -if (build_with_chromium && v8_enable_pointer_compression_shared_cage && - v8_enable_external_code_space) { - v8_enable_sandbox = true +if (v8_enable_sandbox == "") { + # TODO(saelo, v8:11880) remove dependency on v8_enable_external_code_space + # once that is enabled everywhere by default. + v8_enable_sandbox = + build_with_chromium && v8_enable_pointer_compression_shared_cage && + v8_enable_external_code_space } # Enable all available sandbox features if sandbox future is enabled.