diff options
author | Evgenii Stepanov <eugenis@google.com> | 2016-12-28 15:52:54 -0800 |
---|---|---|
committer | Evgenii Stepanov <eugenis@google.com> | 2017-01-24 20:55:11 +0000 |
commit | 774cb81796a09a54f34b2295c7f40cec812c42be (patch) | |
tree | 8078178319a7bd57abeef305a6d8a4373a5b2d70 /cc | |
parent | 7ebf9fa3c92dda5270b999b79f0c69ac2e5dd28a (diff) | |
download | build_soong-774cb81796a09a54f34b2295c7f40cec812c42be.tar.gz build_soong-774cb81796a09a54f34b2295c7f40cec812c42be.tar.bz2 build_soong-774cb81796a09a54f34b2295c7f40cec812c42be.zip |
Disable global coverage when a module disables asan.
With SANITIZE_TARGET="address coverage", if a module disables ASan
(address: false), it is left with just coverage, which is not
supported. In that case, disable coverage as well.
Bug: 33091541
Test: see above
Change-Id: Idcd04dad8cab7c7e2644d2408b1b8a381490e5af
Diffstat (limited to 'cc')
-rw-r--r-- | cc/sanitize.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cc/sanitize.go b/cc/sanitize.go index dca58d88..79c86aaa 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -136,8 +136,14 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) { s.Undefined = boolPtr(true) } - if found, globalSanitizers = removeFromList("address", globalSanitizers); found && s.Address == nil { - s.Address = boolPtr(true) + if found, globalSanitizers = removeFromList("address", globalSanitizers); found { + if s.Address == nil { + s.Address = boolPtr(true) + } else if *s.Address == false { + // Coverage w/o address is an error. If globalSanitizers includes both, and the module + // disables address, then disable coverage as well. + _, globalSanitizers = removeFromList("coverage", globalSanitizers) + } } if found, globalSanitizers = removeFromList("thread", globalSanitizers); found && s.Thread == nil { |