toolchains_llvm icon indicating copy to clipboard operation
toolchains_llvm copied to clipboard

Use musl as target_libc on linux

Open mrmeku opened this issue 1 year ago • 4 comments

Currently, glic_unknown is used for libc when running on linux as can be seen here: https://github.com/grailbio/bazel-toolchain/blob/3cf6c59742b58980093e2062e9ec056c3bd492e5/toolchain/cc_toolchain_config.bzl#L76

This is unfortunate, because it makes the toolchain non-hermetic in that any binary which depends on being compiled with libc is now dependent upon the system installed version of libc rather than one being provided by the toolchain on linux.

Musl is specifically designed to compat this issue and I'd love to have this toolchain make use of it and become even more hermetic.

mrmeku avatar Sep 13 '22 16:09 mrmeku

Thanks. Please send a PR. I actually never looked into what target_libc does, so I just blindly copy-pasted a value.

siddharthab avatar Sep 13 '22 16:09 siddharthab