Add libc_musl as a dependency of RuleBuilderCommand.BuiltTool
Assume calls to RuleBuilderCommand.BuiltTool may refer to a tool
that was built against musl libc, and add it as a dependency
so that it is copied into the sandbox. This emulates the
behavior of compiling against glibc, which is available from the
host sysroot when running in the sandbox.
Bug: 190084016
Test: m USE_HOST_MUSL=true sdk-repo-build-tools
Change-Id: Ieafdcceb818f9c31595487aab3ffbafba1412b3a
diff --git a/android/config.go b/android/config.go
index f10732b..877800a 100644
--- a/android/config.go
+++ b/android/config.go
@@ -1982,3 +1982,8 @@
func (c *config) RBEWrapper() string {
return c.GetenvWithDefault("RBE_WRAPPER", remoteexec.DefaultWrapperPath)
}
+
+// UseHostMusl returns true if the host target has been configured to build against musl libc.
+func (c *config) UseHostMusl() bool {
+ return Bool(c.productVariables.HostMusl)
+}