blob: 5b83901bb171279e2192b8cab14f6b99af24d91e [file] [log] [blame]
load("//build/toolchain:cc_toolchain_config.bzl", "host_cc_toolchain_config")
# This file defines //build/toolchain/musl-host-gcc:musl_host_toolchain.
#
# This is a C++ toolchain that uses GCC from the sandbox sysroot at hardcoded paths, with
# a pre-built sysroot tarball that targets Metropolis nodes with musl and Linux
# headers. It's a superset of //build/toolchain:host_cc_toolchain.
#
# For more information, see README.md.
cc_toolchain(
name = "musl_host_cc_k8_toolchain",
all_files = ":musl_toolchain_files",
ar_files = ":musl_toolchain_files",
as_files = ":musl_toolchain_files",
compiler_files = ":musl_toolchain_files",
dwp_files = ":musl_toolchain_files",
linker_files = ":musl_toolchain_files",
objcopy_files = ":musl_toolchain_files",
strip_files = ":musl_toolchain_files",
supports_param_files = 0,
toolchain_config = ":musl_host_cc_k8_toolchain_config",
toolchain_identifier = "host-musl-k8-toolchain",
)
host_cc_toolchain_config(
name = "musl_host_cc_k8_toolchain_config",
gcc = "gcc-wrapper.sh",
has_cpp = False,
host_includes = [],
is_glibc = False,
sysroot = "external/musl_sysroot",
)
filegroup(
name = "musl_toolchain_files",
srcs = [
":gcc-wrapper.sh",
":musl.spec",
"@musl_sysroot//:all",
],
)
toolchain(
name = "musl_host_toolchain",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
"//build/platforms/linkmode:musl-static",
],
toolchain = ":musl_host_cc_k8_toolchain",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)