gvisor: Explicitly register C++ toolchains for cross-compilation.

Bazel >= 5 seems to no longer implicitly recognize coral_crosstool's
C++ toolchains when looking through the possible set of toolchains to use for
compiling C++ (`@bazel_tools//tools/cpp:toolchain_type`).

This change explicitly registers these toolchains within `WORKSPACE`.

PiperOrigin-RevId: 492011138
This commit is contained in:
Etienne Perot
2022-11-30 14:07:24 -08:00
committed by gVisor bot
parent 1823b16fcc
commit ba73788f2c
2 changed files with 23 additions and 0 deletions
+22
View File
@@ -145,6 +145,28 @@ go_path(
],
)
# CC toolchain targets for cross-compilation.
# Required to be explicitly specified in bazel >= 5.
toolchain(
name = "cc_toolchain_k8",
target_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
toolchain = "@crosstool//:cc-compiler-k8",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
toolchain(
name = "cc_toolchain_aarch64",
target_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
],
toolchain = "@crosstool//:cc-compiler-aarch64",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
# gazelle is a set of build tools.
#
# To update the WORKSPACE from go.mod, use:
+1
View File
@@ -137,6 +137,7 @@ http_archive(
load("@coral_crosstool//:configure.bzl", "cc_crosstool")
cc_crosstool(name = "crosstool")
register_toolchains("//:cc_toolchain_k8", "//:cc_toolchain_aarch64")
# Load protobuf dependencies.
http_archive(