Add libc constraint and libc aware toolchains
- Also get rid of @bazel_skylib dependency
This commit is contained in:
@@ -28,6 +28,8 @@ _GLIBCS = [
|
||||
"2.34",
|
||||
]
|
||||
|
||||
LIBCS = ["musl", "gnu"] + ["gnu.{}".format(glibc) for glibc in _GLIBCS]
|
||||
|
||||
def target_structs():
|
||||
ret = []
|
||||
for zigcpu, gocpu in (("x86_64", "amd64"), ("aarch64", "arm64")):
|
||||
@@ -100,6 +102,7 @@ def _target_linux_gnu(gocpu, zigcpu, glibc_version = ""):
|
||||
"@platforms//os:linux",
|
||||
"@platforms//cpu:{}".format(zigcpu),
|
||||
],
|
||||
libc_constraint = "@zig_sdk//libc:{}".format(glibc_suffix),
|
||||
tool_paths = {"ld": "ld.lld"},
|
||||
)
|
||||
|
||||
@@ -120,5 +123,6 @@ def _target_linux_musl(gocpu, zigcpu):
|
||||
"@platforms//os:linux",
|
||||
"@platforms//cpu:{}".format(zigcpu),
|
||||
],
|
||||
libc_constraint = "@zig_sdk//libc:musl",
|
||||
tool_paths = {"ld": "ld.lld"},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user