blob: 5b83901bb171279e2192b8cab14f6b99af24d91e [file] [log] [blame]
Serge Bazanski9e861a82020-09-16 13:46:41 +02001load("//build/toolchain:cc_toolchain_config.bzl", "host_cc_toolchain_config")
2
Leopoldbc93c2b2023-01-14 13:12:23 +01003# This file defines //build/toolchain/musl-host-gcc:musl_host_toolchain.
Serge Bazanski9e861a82020-09-16 13:46:41 +02004#
Leopoldbc93c2b2023-01-14 13:12:23 +01005# This is a C++ toolchain that uses GCC from the sandbox sysroot at hardcoded paths, with
Serge Bazanski662b5b32020-12-21 13:49:00 +01006# a pre-built sysroot tarball that targets Metropolis nodes with musl and Linux
Leopoldbc93c2b2023-01-14 13:12:23 +01007# headers. It's a superset of //build/toolchain:host_cc_toolchain.
8#
Serge Bazanski9e861a82020-09-16 13:46:41 +02009# For more information, see README.md.
10
Serge Bazanski9e861a82020-09-16 13:46:41 +020011cc_toolchain(
12 name = "musl_host_cc_k8_toolchain",
13 all_files = ":musl_toolchain_files",
Leopoldbc93c2b2023-01-14 13:12:23 +010014 ar_files = ":musl_toolchain_files",
15 as_files = ":musl_toolchain_files",
Serge Bazanski9e861a82020-09-16 13:46:41 +020016 compiler_files = ":musl_toolchain_files",
17 dwp_files = ":musl_toolchain_files",
18 linker_files = ":musl_toolchain_files",
19 objcopy_files = ":musl_toolchain_files",
20 strip_files = ":musl_toolchain_files",
21 supports_param_files = 0,
22 toolchain_config = ":musl_host_cc_k8_toolchain_config",
23 toolchain_identifier = "host-musl-k8-toolchain",
24)
25
26host_cc_toolchain_config(
27 name = "musl_host_cc_k8_toolchain_config",
28 gcc = "gcc-wrapper.sh",
Lorenz Brun735119f2021-03-11 00:30:01 +010029 has_cpp = False,
Serge Bazanski9e861a82020-09-16 13:46:41 +020030 host_includes = [],
Lorenz Brun735119f2021-03-11 00:30:01 +010031 is_glibc = False,
Serge Bazanski9e861a82020-09-16 13:46:41 +020032 sysroot = "external/musl_sysroot",
33)
34
35filegroup(
36 name = "musl_toolchain_files",
37 srcs = [
38 ":gcc-wrapper.sh",
39 ":musl.spec",
40 "@musl_sysroot//:all",
41 ],
42)
Leopoldbc93c2b2023-01-14 13:12:23 +010043
44toolchain(
45 name = "musl_host_toolchain",
46 exec_compatible_with = [
47 "@platforms//cpu:x86_64",
48 "@platforms//os:linux",
49 ],
50 target_compatible_with = [
51 "@platforms//cpu:x86_64",
52 "@platforms//os:linux",
53 "//build/platforms/linkmode:musl-static",
54 ],
55 toolchain = ":musl_host_cc_k8_toolchain",
56 toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
57)