Merge "Support sanitizing a single device arch" am: 42e04de8a7

am: e41ddecd1f

Change-Id: I2702bee8368af00a9b8be00e761e3d357677ee47
This commit is contained in:
Colin Cross 2016-11-03 07:21:29 +00:00 committed by android-build-merger
commit 0b796789c2
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,7 +119,10 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
if ctx.Host() {
globalSanitizers = ctx.AConfig().SanitizeHost()
} else {
globalSanitizers = ctx.AConfig().SanitizeDevice()
arches := ctx.AConfig().SanitizeDeviceArch()
if len(arches) == 0 || inList(ctx.Arch().ArchType.Name, arches) {
globalSanitizers = ctx.AConfig().SanitizeDevice()
}
}
}