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
This commit is contained in:
Elvis Chien
2021-06-25 01:15:17 +08:00
committed by mediatek
parent bf49705608
commit 9c99354465
2 changed files with 3 additions and 3 deletions

View File

@@ -1751,7 +1751,7 @@ func (library *libraryDecorator) install(ctx ModuleContext, file android.Path) {
mayUseCoreVariant = false
}
if ctx.Config().CFIEnabledForPath(ctx.ModuleDir()) && ctx.Arch().ArchType == android.Arm64 {
if ctx.Config().CFIEnabledForPath(ctx.ModuleDir()) {
mayUseCoreVariant = false
}

View File

@@ -437,8 +437,8 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
}
}
// 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)