Change PRODUCT_CFI_INCLUDE_PATHS to opt-out (Soong)
This CL changes PRODUCT_CFI_INCLUDE_PATHS to be included in all
product configs by default. To maintain the status quo, the sanitizer
logic has been modified to only respect this product config for Arm64
devices (where this was previously enabled).
Bug: 63926619
Test: m -j60 # the device still has CFI enabled thanks to the default
opt-in
Change-Id: Ia613aec545ad3e544dea41a6dbdb4112aef4afab
diff --git a/cc/sanitize.go b/cc/sanitize.go
index c9fcafc..a1eae4e 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -226,9 +226,13 @@
// Enable CFI for all components in the include paths
if s.Cfi == nil && ctx.Config().CFIEnabledForPath(ctx.ModuleDir()) {
- s.Cfi = boolPtr(true)
- if inList("cfi", ctx.Config().SanitizeDeviceDiag()) {
- s.Diag.Cfi = boolPtr(true)
+ // Do not rely on include paths for anything other than ARM64.
+ // TODO: Relax this constraint for 2019.
+ if ctx.Arch().ArchType == android.Arm64 {
+ s.Cfi = boolPtr(true)
+ if inList("cfi", ctx.Config().SanitizeDeviceDiag()) {
+ s.Diag.Cfi = boolPtr(true)
+ }
}
}