Commit d053afc9 authored by Piotr Sikora's avatar Piotr Sikora Committed by V8 LUCI CQ

[bazel] Don't override --@v8//bazel/config:v8_target_cpu flag.

Fixes cross-compilation with bazel-zig-cc.
Signed-off-by: 's avatarPiotr Sikora <piotrsikora@google.com>
Change-Id: I7d94b84be33d8699ec71b4073bc0df1e7fcce5c4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3445204Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78992}
parent cb4f3c69
...@@ -372,6 +372,12 @@ def v8_torque(name, noicu_srcs, icu_srcs, args, extras): ...@@ -372,6 +372,12 @@ def v8_torque(name, noicu_srcs, icu_srcs, args, extras):
) )
def _v8_target_cpu_transition_impl(settings, attr): def _v8_target_cpu_transition_impl(settings, attr):
# Check for an existing v8_target_cpu flag.
if "@v8//bazel/config:v8_target_cpu" in settings:
if settings["@v8//bazel/config:v8_target_cpu"] != "none":
return
# Auto-detect target architecture based on the --cpu flag.
mapping = { mapping = {
"haswell": "x64", "haswell": "x64",
"k8": "x64", "k8": "x64",
...@@ -395,7 +401,7 @@ def _v8_target_cpu_transition_impl(settings, attr): ...@@ -395,7 +401,7 @@ def _v8_target_cpu_transition_impl(settings, attr):
# on the command line. # on the command line.
v8_target_cpu_transition = transition( v8_target_cpu_transition = transition(
implementation = _v8_target_cpu_transition_impl, implementation = _v8_target_cpu_transition_impl,
inputs = ["//command_line_option:cpu"], inputs = ["@v8//bazel/config:v8_target_cpu", "//command_line_option:cpu"],
outputs = ["@v8//bazel/config:v8_target_cpu"], outputs = ["@v8//bazel/config:v8_target_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