From 7589c82eecd4c25279f64464609708ff8400dcb0 Mon Sep 17 00:00:00 2001 From: Vishwath Mohan Date: Wed, 23 May 2018 19:29:55 -0700 Subject: Disable CFI for vendor variants of VNDK libraries Enabling CFI changes the VNDK ABI from the frozen snapshot, so the only solution for now is to temporarily disable CFI on all vendor variants for the sake of compatibility. Bug: 66301104 Test: ABI is consistent. Change-Id: Ie7dca41e0f647808b08adede09a30f3c746e6bda --- cc/sanitize.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cc/sanitize.go b/cc/sanitize.go index fc44eaf1..205b2a20 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -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 -- cgit v1.2.3 From 1c54f66bd56d00592b6ce55826411ae6af9e2697 Mon Sep 17 00:00:00 2001 From: Vishwath Mohan Date: Thu, 24 May 2018 18:36:18 -0700 Subject: Restrict CFI_INCLUDE_PATHS to Arm64 This CL restricts CFI_INCLUDE_PATHS and PRODUCT_CFI_INCLUDE_PATHS to Arm64 only. Bug: 66301104 Test: x86 targets do not respect the include paths variables Change-Id: I66ec2fb05435535aaf5d59fdfc7a170a4fdd4f26 --- cc/sanitize.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cc/sanitize.go b/cc/sanitize.go index 205b2a20..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) -- cgit v1.2.3