diff options
-rw-r--r-- | cc/sanitize.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cc/sanitize.go b/cc/sanitize.go index fc44eaf1..881a5a01 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -224,8 +224,8 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) { } } - // Enable CFI for all components in the include paths - if s.Cfi == nil && ctx.Config().CFIEnabledForPath(ctx.ModuleDir()) { + // 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 { s.Cfi = boolPtr(true) if inList("cfi", ctx.Config().SanitizeDeviceDiag()) { s.Diag.Cfi = boolPtr(true) @@ -256,6 +256,13 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) { s.Diag.Cfi = nil } + // Also disable CFI for VNDK variants of components in the + // include paths + if ctx.isVndk() && ctx.useVndk() && ctx.Config().CFIEnabledForPath(ctx.ModuleDir()) { + s.Cfi = nil + s.Diag.Cfi = nil + } + if ctx.staticBinary() { s.Address = nil s.Coverage = nil |