aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJayant Chowdhary <jchowdhary@google.com>2018-05-10 15:29:24 -0700
committerJayant Chowdhary <jchowdhary@google.com>2018-05-14 18:34:40 -0700
commitf267f715ebcde8f0dec9bfe168dc8c5dcfb93bc7 (patch)
tree6ccc8854b0cdd7dd77e326f6081acaca518adfa4
parent01dd3fb5043b1af6913292bd237d1ba08f57e623 (diff)
downloadbuild_soong-f267f715ebcde8f0dec9bfe168dc8c5dcfb93bc7.tar.gz
build_soong-f267f715ebcde8f0dec9bfe168dc8c5dcfb93bc7.tar.bz2
build_soong-f267f715ebcde8f0dec9bfe168dc8c5dcfb93bc7.zip
Allow abi diffs sanitized variants of vndk libraries on production devices.
Previously abi diffs were allowed only on unsanitized variants of vndk libraries. This CL allows them on all sanitized variants which go onto production devices, eg: cfi variants. Bug: 66301104 Test: Without this change, for arm64 libstagefright_foundation doesn't get an lsdump file since we don't build an unsanitized variant (aosp_arm64_ab). Test: With this change, for arm64 libstagefright_foundation does get an lsdump file (aosp_arm64_ab) Merged-In: I94f82fd84fc898e4980c3f3619df9677ed723c32 Change-Id: I94f82fd84fc898e4980c3f3619df9677ed723c32 (cherry picked from commit b7e08ca83000f14653ffdd0bc4195067bb902dfc)
-rw-r--r--cc/cc.go6
-rw-r--r--cc/sanitize.go5
2 files changed, 8 insertions, 3 deletions
diff --git a/cc/cc.go b/cc/cc.go
index 50766fa0..ca3f8726 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -540,13 +540,13 @@ func (ctx *moduleContextImpl) isVndkExt() bool {
// Create source abi dumps if the module belongs to the list of VndkLibraries.
func (ctx *moduleContextImpl) createVndkSourceAbiDump() bool {
skipAbiChecks := ctx.ctx.Config().IsEnvTrue("SKIP_ABI_CHECKS")
- isUnsanitizedVariant := true
+ isVariantOnProductionDevice := true
sanitize := ctx.mod.sanitize
if sanitize != nil {
- isUnsanitizedVariant = sanitize.isUnsanitizedVariant()
+ isVariantOnProductionDevice = sanitize.isVariantOnProductionDevice()
}
vendorAvailable := Bool(ctx.mod.VendorProperties.Vendor_available)
- return !skipAbiChecks && isUnsanitizedVariant && ctx.ctx.Device() && ((ctx.useVndk() && ctx.isVndk() && vendorAvailable) || inList(ctx.baseModuleName(), llndkLibraries))
+ return !skipAbiChecks && isVariantOnProductionDevice && ctx.ctx.Device() && ((ctx.useVndk() && ctx.isVndk() && vendorAvailable) || inList(ctx.baseModuleName(), llndkLibraries))
}
func (ctx *moduleContextImpl) selectedStl() string {
diff --git a/cc/sanitize.go b/cc/sanitize.go
index ee549bc0..86537347 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -535,6 +535,11 @@ func (sanitize *sanitize) isUnsanitizedVariant() bool {
!sanitize.isSanitizerEnabled(cfi)
}
+func (sanitize *sanitize) isVariantOnProductionDevice() bool {
+ return !sanitize.isSanitizerEnabled(asan) &&
+ !sanitize.isSanitizerEnabled(tsan)
+}
+
func (sanitize *sanitize) SetSanitizer(t sanitizerType, b bool) {
switch t {
case asan: