Allow PRODUCT_CFI_INCLUDE_PATHS to work with blueprints also
but disable it for host modules like how it's done for Android.mk
Bug:
179233410
Test:
m -j32
Change-Id: I246cd9163e06997a2b50cd25688370690c8929af
diff --git a/cc/sanitize.go b/cc/sanitize.go
index b244394..dd15ae1 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -437,8 +437,8 @@
}
}
- // Enable CFI for all components in the include paths (for Aarch64 only)
- if s.Cfi == nil && ctx.Config().CFIEnabledForPath(ctx.ModuleDir()) && ctx.Arch().ArchType == android.Arm64 {
+ // Enable CFI for non-host components in the include paths
+ if s.Cfi == nil && ctx.Config().CFIEnabledForPath(ctx.ModuleDir()) && !ctx.Host() {
s.Cfi = proptools.BoolPtr(true)
if inList("cfi", ctx.Config().SanitizeDeviceDiag()) {
s.Diag.Cfi = proptools.BoolPtr(true)