Fix coverage sanitizer builds
Disable coverage for static binaries where address sanitizer is
disabled, and disable coverage in the mutator when disabling address
sanitizer.
Bug: 29188876
Change-Id: Ia1a21878c3f34cd295a6dec49608c412eb09e7b1
diff --git a/cc/sanitize.go b/cc/sanitize.go
index fb7cb37..b79e0c7 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -140,6 +140,7 @@
if ctx.staticBinary() {
s.Address = nil
+ s.Coverage = nil
s.Thread = nil
}
@@ -317,6 +318,9 @@
switch t {
case asan:
sanitize.Properties.Sanitize.Address = boolPtr(b)
+ if !b {
+ sanitize.Properties.Sanitize.Coverage = nil
+ }
case tsan:
sanitize.Properties.Sanitize.Thread = boolPtr(b)
default: