aboutsummaryrefslogtreecommitdiffstats
path: root/apex
diff options
context:
space:
mode:
authorPeter Collingbourne <pcc@google.com>2019-04-24 14:41:12 -0700
committerStephen Hines <srhines@google.com>2019-06-06 02:12:04 -0700
commite16292761e6505e793bb2be1ae1e9527887e70ef (patch)
treec3c90b58794ba8a3b50cafd075fbb6d064c07842 /apex
parentbc49d5f95242f5087ceffb5b186b202aee3f708b (diff)
downloadbuild_soong-e16292761e6505e793bb2be1ae1e9527887e70ef.tar.gz
build_soong-e16292761e6505e793bb2be1ae1e9527887e70ef.tar.bz2
build_soong-e16292761e6505e793bb2be1ae1e9527887e70ef.zip
Teach soong not to duplicate the HWASAN runtime into each APEX.
When HWASAN is enabled, the runtime is conceptually part of Bionic (and mutually depends on it), so it needs to be treated in the same way as the Bionic libs. Now there are only two copies of the runtime: the one in /system/lib64/bootstrap (which won't be used by ordinary processes) and the one in the runtime APEX. This reduces the size of the HWASAN system image and fixes an issue where multiple copies of the HWASAN runtime were being loaded into 64-bit binaries in APEXes because the linker namespace for the binary is different from the one for its dependent libraries outside of APEXes. HWASAN only supports loading one copy of the runtime per process, so this was causing such binaries to crash on startup. Bug: http://b/134503977 Test: Builds Change-Id: I228896e193a035e6dfba9f6e28d0b2e12fc163ea Merged-In: I228896e193a035e6dfba9f6e28d0b2e12fc163ea (cherry picked from commit 3478bb2a7fbcaaea1326a1df4a564d7ca24056ce)
Diffstat (limited to 'apex')
-rw-r--r--apex/apex.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/apex/apex.go b/apex/apex.go
index fa4cb48c..74a02679 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -521,6 +521,17 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
a.properties.Multilib.Prefer32.Binaries, target.String(),
a.getImageVariation(config))
}
+
+ if strings.HasPrefix(ctx.ModuleName(), "com.android.runtime") && target.Os.Class == android.Device {
+ for _, sanitizer := range ctx.Config().SanitizeDevice() {
+ if sanitizer == "hwaddress" {
+ addDependenciesForNativeModules(ctx,
+ []string{"libclang_rt.hwasan-aarch64-android"},
+ nil, target.String(), a.getImageVariation(config))
+ break
+ }
+ }
+ }
}
}