Merge "Fix: sanitizerRuntimeMutator is not run for host"
diff --git a/cc/sanitize.go b/cc/sanitize.go
index d19e54a..162e22e 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -667,10 +667,10 @@
// Add the dependency to the runtime library for each of the sanitizer variants
func sanitizerRuntimeMutator(mctx android.BottomUpMutatorContext) {
- if mctx.Os() != android.Android {
- return
- }
if c, ok := mctx.Module().(*Module); ok && c.sanitize != nil {
+ if !c.Enabled() {
+ return
+ }
var sanitizers []string
var diagSanitizers []string