Hide CFI behind a global flag.
This CL ensures that locally enabling CFI in a .bp file is not honored
unless it is enabled globally using ENABLE_CFI=true first, effectively
hiding it behind a flag.
Bug: 30227045
Bug: 22033465
Test: m -j40 works and device boots
Test: cfi is correctly honored only when the global flag is set.
Change-Id: Iccc6e4bf5e7828ab8ce6056f3e40922712faa0d8
diff --git a/android/config.go b/android/config.go
index 6d28680..3603477 100644
--- a/android/config.go
+++ b/android/config.go
@@ -398,6 +398,10 @@
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" {
diff --git a/android/variable.go b/android/variable.go
index 271454a..bb84be2 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -124,6 +124,7 @@
UseGoma *bool `json:",omitempty"`
Debuggable *bool `json:",omitempty"`
Eng *bool `json:",omitempty"`
+ EnableCFI *bool `json:",omitempty"`
VendorPath *string `json:",omitempty"`