Fix sanitize host builds

Host builds don't have a separate place to install asan modules, so only
create a single variant for them.

Change-Id: I81f7090debd7935db778f8600d8cbc86dd53b1cb
This commit is contained in:
Colin Cross 2016-05-25 12:35:53 -07:00
parent bc6fb16b26
commit b36ab1a1a0
1 changed files with 15 additions and 9 deletions

View File

@ -331,18 +331,24 @@ func sanitizerMutator(t sanitizerType) func(android.BottomUpMutatorContext) {
if d, ok := c.linker.(baseLinkerInterface); ok && d.isDependencyRoot() && c.sanitize.Sanitizer(t) { if d, ok := c.linker.(baseLinkerInterface); ok && d.isDependencyRoot() && c.sanitize.Sanitizer(t) {
modules := mctx.CreateVariations(t.String()) modules := mctx.CreateVariations(t.String())
modules[0].(*Module).sanitize.SetSanitizer(t, true) modules[0].(*Module).sanitize.SetSanitizer(t, true)
if mctx.AConfig().EmbeddedInMake() { if mctx.AConfig().EmbeddedInMake() && !c.Host() {
modules[0].(*Module).sanitize.Properties.InData = true modules[0].(*Module).sanitize.Properties.InData = true
} }
} else if c.sanitize.Properties.SanitizeDep { } else if c.sanitize.Properties.SanitizeDep {
modules := mctx.CreateVariations("", t.String()) if c.Host() {
modules[0].(*Module).sanitize.SetSanitizer(t, false) modules := mctx.CreateVariations(t.String())
modules[1].(*Module).sanitize.SetSanitizer(t, true) modules[0].(*Module).sanitize.SetSanitizer(t, true)
modules[0].(*Module).sanitize.Properties.SanitizeDep = false modules[0].(*Module).sanitize.Properties.SanitizeDep = false
modules[1].(*Module).sanitize.Properties.SanitizeDep = false } else {
modules[1].(*Module).sanitize.Properties.InData = true modules := mctx.CreateVariations("", t.String())
if mctx.AConfig().EmbeddedInMake() { modules[0].(*Module).sanitize.SetSanitizer(t, false)
modules[0].(*Module).Properties.HideFromMake = true modules[1].(*Module).sanitize.SetSanitizer(t, true)
modules[0].(*Module).sanitize.Properties.SanitizeDep = false
modules[1].(*Module).sanitize.Properties.SanitizeDep = false
modules[1].(*Module).sanitize.Properties.InData = true
if mctx.AConfig().EmbeddedInMake() {
modules[0].(*Module).Properties.HideFromMake = true
}
} }
} }
c.sanitize.Properties.SanitizeDep = false c.sanitize.Properties.SanitizeDep = false