aboutsummaryrefslogtreecommitdiffstats
path: root/cc/sanitize.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/sanitize.go')
-rw-r--r--cc/sanitize.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 4c8a6114..1037181d 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -236,8 +236,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)
@@ -272,6 +272,12 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
s.Integer_overflow = nil
}
+ // Also disable CFI for VNDK variants of components
+ if ctx.isVndk() && ctx.useVndk() {
+ s.Cfi = nil
+ s.Diag.Cfi = nil
+ }
+
if ctx.staticBinary() {
s.Address = nil
s.Coverage = nil