Serge Bazanski | 9e861a8 | 2020-09-16 13:46:41 +0200 | [diff] [blame] | 1 | load("//build/toolchain:cc_toolchain_config.bzl", "host_cc_toolchain_config") |
| 2 | |
Leopold | bc93c2b | 2023-01-14 13:12:23 +0100 | [diff] [blame^] | 3 | # This file defines //build/toolchain/musl-host-gcc:musl_host_toolchain. |
Serge Bazanski | 9e861a8 | 2020-09-16 13:46:41 +0200 | [diff] [blame] | 4 | # |
Leopold | bc93c2b | 2023-01-14 13:12:23 +0100 | [diff] [blame^] | 5 | # This is a C++ toolchain that uses GCC from the sandbox sysroot at hardcoded paths, with |
Serge Bazanski | 662b5b3 | 2020-12-21 13:49:00 +0100 | [diff] [blame] | 6 | # a pre-built sysroot tarball that targets Metropolis nodes with musl and Linux |
Leopold | bc93c2b | 2023-01-14 13:12:23 +0100 | [diff] [blame^] | 7 | # headers. It's a superset of //build/toolchain:host_cc_toolchain. |
| 8 | # |
Serge Bazanski | 9e861a8 | 2020-09-16 13:46:41 +0200 | [diff] [blame] | 9 | # For more information, see README.md. |
| 10 | |
Serge Bazanski | 9e861a8 | 2020-09-16 13:46:41 +0200 | [diff] [blame] | 11 | cc_toolchain( |
| 12 | name = "musl_host_cc_k8_toolchain", |
| 13 | all_files = ":musl_toolchain_files", |
Leopold | bc93c2b | 2023-01-14 13:12:23 +0100 | [diff] [blame^] | 14 | ar_files = ":musl_toolchain_files", |
| 15 | as_files = ":musl_toolchain_files", |
Serge Bazanski | 9e861a8 | 2020-09-16 13:46:41 +0200 | [diff] [blame] | 16 | 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 | |
| 26 | host_cc_toolchain_config( |
| 27 | name = "musl_host_cc_k8_toolchain_config", |
| 28 | gcc = "gcc-wrapper.sh", |
Lorenz Brun | 735119f | 2021-03-11 00:30:01 +0100 | [diff] [blame] | 29 | has_cpp = False, |
Serge Bazanski | 9e861a8 | 2020-09-16 13:46:41 +0200 | [diff] [blame] | 30 | host_includes = [], |
Lorenz Brun | 735119f | 2021-03-11 00:30:01 +0100 | [diff] [blame] | 31 | is_glibc = False, |
Serge Bazanski | 9e861a8 | 2020-09-16 13:46:41 +0200 | [diff] [blame] | 32 | sysroot = "external/musl_sysroot", |
| 33 | ) |
| 34 | |
| 35 | filegroup( |
| 36 | name = "musl_toolchain_files", |
| 37 | srcs = [ |
| 38 | ":gcc-wrapper.sh", |
| 39 | ":musl.spec", |
| 40 | "@musl_sysroot//:all", |
| 41 | ], |
| 42 | ) |
Leopold | bc93c2b | 2023-01-14 13:12:23 +0100 | [diff] [blame^] | 43 | |
| 44 | toolchain( |
| 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 | ) |