aboutsummaryrefslogtreecommitdiffstats
path: root/apex
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2019-02-13 20:28:58 +0900
committerJiyong Park <jiyong@google.com>2019-02-14 12:30:49 +0900
commitf97782b18cc3dae0f0fb4b680e1488b000723396 (patch)
treef25f6739653244b2e0cb00d0e1fc02e7e15f05de /apex
parentdfa4a486eb0146582fe015ac4466dc39ae0e5f7d (diff)
downloadbuild_soong-f97782b18cc3dae0f0fb4b680e1488b000723396.tar.gz
build_soong-f97782b18cc3dae0f0fb4b680e1488b000723396.tar.bz2
build_soong-f97782b18cc3dae0f0fb4b680e1488b000723396.zip
Remove prefer_sanitize.* properties
The properties are no longer required as an APEX module is mutated with required sanitizers which are gathered by scanning the sanitizers that are enabled for its direct dependencies. Bug: 124128094 Test: m on marlin The extractor libs are found under /system/apex/com.android.media Merged-In: I55961d400dcbac067a5c0dcecb90e399d4991a70 Change-Id: I55961d400dcbac067a5c0dcecb90e399d4991a70 (cherry picked from commit abda0eb76b8aa9aac3220e4f60391210fbcb5b53)
Diffstat (limited to 'apex')
-rw-r--r--apex/apex.go44
1 files changed, 10 insertions, 34 deletions
diff --git a/apex/apex.go b/apex/apex.go
index 5e1a9434..7633ad20 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -257,18 +257,8 @@ type apexBundleProperties struct {
Multilib apexMultilibProperties
- Prefer_sanitize struct {
- // Prefer native libraries with asan if available
- Address *bool
- // Prefer native libraries with hwasan if available
- Hwaddress *bool
- // Prefer native libraries with tsan if available
- Thread *bool
- // Prefer native libraries with integer_overflow if available
- Integer_overflow *bool
- // Prefer native libraries with cfi if available
- Cfi *bool
- }
+ // List of sanitizer names that this APEX is enabled for
+ SanitizerNames []string `blueprint:"mutated"`
}
type apexTargetBundleProperties struct {
@@ -551,29 +541,15 @@ func (a *apexBundle) getImageVariation(config android.DeviceConfig) string {
}
}
+func (a *apexBundle) EnableSanitizer(sanitizerName string) {
+ if !android.InList(sanitizerName, a.properties.SanitizerNames) {
+ a.properties.SanitizerNames = append(a.properties.SanitizerNames, sanitizerName)
+ }
+}
+
func (a *apexBundle) IsSanitizerEnabled(ctx android.BaseModuleContext, sanitizerName string) bool {
- // If this APEX is configured to prefer a sanitizer, use it
- switch sanitizerName {
- case "asan":
- if proptools.Bool(a.properties.Prefer_sanitize.Address) {
- return true
- }
- case "hwasan":
- if proptools.Bool(a.properties.Prefer_sanitize.Hwaddress) {
- return true
- }
- case "tsan":
- if proptools.Bool(a.properties.Prefer_sanitize.Thread) {
- return true
- }
- case "cfi":
- if proptools.Bool(a.properties.Prefer_sanitize.Cfi) {
- return true
- }
- case "integer_overflow":
- if proptools.Bool(a.properties.Prefer_sanitize.Integer_overflow) {
- return true
- }
+ if android.InList(sanitizerName, a.properties.SanitizerNames) {
+ return true
}
// Then follow the global setting