From 36d0b30adf5062ab65732dd96c2fb928664a2dde Mon Sep 17 00:00:00 2001 From: Stephen Roettger Date: Tue, 20 Sep 2022 14:09:09 +0200 Subject: [PATCH] Only enable sandbox on supported arches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: v8:13281 Change-Id: Ie61eb42ad6be565c8be76c9b4aa63282c7856f25 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3905190 Reviewed-by: Igor Sheludko Commit-Queue: Stephen Röttger Cr-Commit-Position: refs/heads/main@{#83340} --- tools/dev/gm.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/dev/gm.py b/tools/dev/gm.py index e2d958a191..245a05389e 100755 --- a/tools/dev/gm.py +++ b/tools/dev/gm.py @@ -46,6 +46,7 @@ ARCHES = [ ] # Arches that get built/run when you don't specify any. DEFAULT_ARCHES = ["ia32", "x64", "arm", "arm64"] +SANDBOX_SUPPORTED_ARCHES = ["x64", "arm64"] # Modes that this script understands. MODES = { "release": "release", @@ -169,7 +170,6 @@ v8_enable_disassembler = true v8_enable_object_print = true v8_enable_verify_heap = true dcheck_always_on = false -v8_enable_sandbox = true """.replace("{GOMA}", USE_GOMA) DEBUG_ARGS_TEMPLATE = """\ @@ -182,7 +182,6 @@ v8_enable_backtrace = true v8_enable_fast_mksnapshot = true v8_enable_slow_dchecks = true v8_optimized_debug = false -v8_enable_sandbox = true """.replace("{GOMA}", USE_GOMA) OPTDEBUG_ARGS_TEMPLATE = """\ @@ -195,7 +194,6 @@ v8_enable_backtrace = true v8_enable_fast_mksnapshot = true v8_enable_verify_heap = true v8_optimized_debug = true -v8_enable_sandbox = true """.replace("{GOMA}", USE_GOMA) ARGS_TEMPLATES = { @@ -348,12 +346,18 @@ class Config(object): return ["clang_base_path = \"/usr\"", "clang_use_chrome_plugins = false"] return [] + def GetSandboxFlag(self): + if self.arch in SANDBOX_SUPPORTED_ARCHES: + return ["v8_enable_sandbox = true"] + return [] + def GetGnArgs(self): # Use only substring before first '-' as the actual mode mode = re.match("([^-]+)", self.mode).group(1) template = ARGS_TEMPLATES[mode] - arch_specific = (self.GetTargetCpu() + self.GetV8TargetCpu() + - self.GetTargetOS() + self.GetSpecialCompiler()) + arch_specific = ( + self.GetTargetCpu() + self.GetV8TargetCpu() + self.GetTargetOS() + + self.GetSpecialCompiler() + self.GetSandboxFlag()) return template % "\n".join(arch_specific) def Build(self):