aboutsummaryrefslogtreecommitdiffstats
path: root/apex
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2019-01-29 02:46:31 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-01-29 02:46:31 +0000
commit62f6fcbbb9528b58fd98e5fd5c71e484844be12f (patch)
treef550a206767be117017e8b2f86fe6da6acd10f21 /apex
parentb55752827ad5f65a0ffd848362a721e8284d8961 (diff)
parent388ef3f5aacd8023102a076e81be14bc1a62a294 (diff)
downloadbuild_soong-62f6fcbbb9528b58fd98e5fd5c71e484844be12f.tar.gz
build_soong-62f6fcbbb9528b58fd98e5fd5c71e484844be12f.tar.bz2
build_soong-62f6fcbbb9528b58fd98e5fd5c71e484844be12f.zip
Merge "Create sanitizer variants of APEX only when SANITIZE_TARGET is set"
Diffstat (limited to 'apex')
-rw-r--r--apex/apex.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/apex/apex.go b/apex/apex.go
index 46c9dcf0..321e2e89 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -483,9 +483,17 @@ func (a *apexBundle) getImageVariation(config android.DeviceConfig) string {
}
}
-func (a *apexBundle) IsSanitizerEnabled() bool {
- // APEX can be mutated for sanitizers
- return true
+func (a *apexBundle) IsSanitizerEnabled(ctx android.BaseModuleContext, sanitizerName string) bool {
+ globalSanitizerNames := []string{}
+ if a.Host() {
+ globalSanitizerNames = ctx.Config().SanitizeHost()
+ } else {
+ arches := ctx.Config().SanitizeDeviceArch()
+ if len(arches) == 0 || android.InList(a.Arch().ArchType.Name, arches) {
+ globalSanitizerNames = ctx.Config().SanitizeDevice()
+ }
+ }
+ return android.InList(sanitizerName, globalSanitizerNames)
}
func getCopyManifestForNativeLibrary(cc *cc.Module) (fileToCopy android.Path, dirInApex string) {