Merge "Support sanitizing a single device arch"

This commit is contained in:
Treehugger Robot 2016-11-03 07:12:53 +00:00 committed by Gerrit Code Review
commit 42e04de8a7
3 changed files with 13 additions and 11 deletions

View File

@ -357,17 +357,15 @@ func (c *config) SkipDeviceInstall() bool {
}
func (c *config) SanitizeHost() []string {
if c.ProductVariables.SanitizeHost == nil {
return nil
}
return append([]string(nil), *c.ProductVariables.SanitizeHost...)
return append([]string(nil), c.ProductVariables.SanitizeHost...)
}
func (c *config) SanitizeDevice() []string {
if c.ProductVariables.SanitizeDevice == nil {
return nil
}
return append([]string(nil), *c.ProductVariables.SanitizeDevice...)
return append([]string(nil), c.ProductVariables.SanitizeDevice...)
}
func (c *config) SanitizeDeviceArch() []string {
return append([]string(nil), c.ProductVariables.SanitizeDeviceArch...)
}
func (c *config) Android64() bool {

View File

@ -118,8 +118,9 @@ type productVariables struct {
DevicePrefer32BitExecutables *bool `json:",omitempty"`
HostPrefer32BitExecutables *bool `json:",omitempty"`
SanitizeHost *[]string `json:",omitempty"`
SanitizeDevice *[]string `json:",omitempty"`
SanitizeHost []string `json:",omitempty"`
SanitizeDevice []string `json:",omitempty"`
SanitizeDeviceArch []string `json:",omitempty"`
}
func boolPtr(v bool) *bool {

View File

@ -119,9 +119,12 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
if ctx.Host() {
globalSanitizers = ctx.AConfig().SanitizeHost()
} else {
arches := ctx.AConfig().SanitizeDeviceArch()
if len(arches) == 0 || inList(ctx.Arch().ArchType.Name, arches) {
globalSanitizers = ctx.AConfig().SanitizeDevice()
}
}
}
if len(globalSanitizers) > 0 {
var found bool