1
hermetic_cc_toolchain/test/c/BUILD
Motiejus Jakštys e0e7a4ca46
Rename bazel-zig-cc to hermetic_cc_toolchain (#36)
As it says on the tin.

Long live hermetic_cc_toolchain!
2023-04-21 10:00:03 -04:00

35 lines
1.0 KiB
Python

load("@hermetic_cc_toolchain//rules:platform.bzl", "platform_binary")
cc_binary(
name = "which_libc",
srcs = ["main.c"],
target_compatible_with = [
"@platforms//os:linux",
],
)
[
(
platform_binary(
name = "which_libc_{}".format(name),
src = "which_libc",
platform = platform,
),
sh_test(
name = "test_libc_{}".format(name),
srcs = ["test.sh"],
data = ["which_libc_{}".format(name)],
env = {
"WANT": want,
"BINARY": "$(location which_libc_{})".format(name),
},
),
)
for name, platform, want in [
("linux_amd64_musl", "//libc_aware/platform:linux_amd64_musl", "non-glibc"),
("linux_amd64_gnu.2.19", "//libc_aware/platform:linux_amd64_gnu.2.19", "glibc_2.19"),
("linux_amd64_gnu.2.28", "//libc_aware/platform:linux_amd64_gnu.2.28", "glibc_2.28"),
("linux_amd64", "//platform:linux_amd64", "glibc_2.19"),
]
]