Merge "Hide CFI behind a global flag."

This commit is contained in:
Vishwath Mohan
2017-01-20 01:32:43 +00:00
committed by Gerrit Code Review
3 changed files with 10 additions and 0 deletions

View File

@@ -398,6 +398,10 @@ func (c *config) SanitizeDeviceArch() []string {
return append([]string(nil), c.ProductVariables.SanitizeDeviceArch...)
}
func (c *config) EnableCFI() bool {
return Bool(c.ProductVariables.EnableCFI)
}
func (c *config) Android64() bool {
for _, t := range c.Targets[Device] {
if t.Arch.ArchType.Multilib == "lib64" {

View File

@@ -124,6 +124,7 @@ type productVariables struct {
UseGoma *bool `json:",omitempty"`
Debuggable *bool `json:",omitempty"`
Eng *bool `json:",omitempty"`
EnableCFI *bool `json:",omitempty"`
VendorPath *string `json:",omitempty"`

View File

@@ -161,6 +161,11 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
}
}
if !ctx.AConfig().EnableCFI() {
s.Cfi = nil
s.Diag.Cfi = nil
}
if ctx.staticBinary() {
s.Address = nil
s.Coverage = nil