diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2019-06-08 23:14:24 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-06-08 23:14:24 +0000 |
commit | da3d7f40f6b64c1031d128174fafff8af2608643 (patch) | |
tree | c3c90b58794ba8a3b50cafd075fbb6d064c07842 | |
parent | 593b4bc69e9b01d8fc753a41a7b24f4bfc3ae8bb (diff) | |
parent | e16292761e6505e793bb2be1ae1e9527887e70ef (diff) | |
download | build_soong-da3d7f40f6b64c1031d128174fafff8af2608643.tar.gz build_soong-da3d7f40f6b64c1031d128174fafff8af2608643.tar.bz2 build_soong-da3d7f40f6b64c1031d128174fafff8af2608643.zip |
Snap for 5645193 from e16292761e6505e793bb2be1ae1e9527887e70ef to qt-qpr1-release
Change-Id: I5f2b1c8f0c4708ad8ec4f939f1ed3c092f7c3084
-rw-r--r-- | apex/apex.go | 11 | ||||
-rw-r--r-- | cc/binary.go | 4 | ||||
-rw-r--r-- | cc/cc.go | 10 | ||||
-rw-r--r-- | cc/library.go | 6 | ||||
-rw-r--r-- | cc/makevars.go | 15 |
5 files changed, 40 insertions, 6 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 + } + } + } } } diff --git a/cc/binary.go b/cc/binary.go index 35c3d85d..cc4c8f90 100644 --- a/cc/binary.go +++ b/cc/binary.go @@ -440,8 +440,8 @@ func (binary *binaryDecorator) install(ctx ModuleContext, file android.Path) { // Bionic binaries (e.g. linker) is installed to the bootstrap subdirectory. // The original path becomes a symlink to the corresponding file in the // runtime APEX. - if isBionic(ctx.baseModuleName()) && ctx.Arch().Native && ctx.apexName() == "" && !ctx.inRecovery() { - if ctx.Device() { + if installToBootstrap(ctx.baseModuleName(), ctx.Config()) && ctx.Arch().Native && ctx.apexName() == "" && !ctx.inRecovery() { + if ctx.Device() && isBionic(ctx.baseModuleName()) { binary.installSymlinkToRuntimeApex(ctx, file) } binary.baseInstaller.subDir = "bootstrap" @@ -596,6 +596,9 @@ func (c *Module) HasStubsVariants() bool { if library, ok := c.linker.(*libraryDecorator); ok { return len(library.Properties.Stubs.Versions) > 0 } + if library, ok := c.linker.(*prebuiltLibraryLinker); ok { + return len(library.Properties.Stubs.Versions) > 0 + } return false } @@ -615,6 +618,13 @@ func isBionic(name string) bool { return false } +func installToBootstrap(name string, config android.Config) bool { + if name == "libclang_rt.hwasan-aarch64-android" { + return inList("hwaddress", config.SanitizeDevice()) + } + return isBionic(name) +} + type baseModuleContext struct { android.BaseContext moduleContextImpl diff --git a/cc/library.go b/cc/library.go index ca1c1be0..d8eb5b4e 100644 --- a/cc/library.go +++ b/cc/library.go @@ -934,12 +934,12 @@ func (library *libraryDecorator) install(ctx ModuleContext, file android.Path) { library.baseInstaller.subDir += "-" + vndkVersion } } - } else if len(library.Properties.Stubs.Versions) > 0 && android.DirectlyInAnyApex(ctx, ctx.ModuleName()) { + } else if len(library.Properties.Stubs.Versions) > 0 { // Bionic libraries (e.g. libc.so) is installed to the bootstrap subdirectory. // The original path becomes a symlink to the corresponding file in the // runtime APEX. - if isBionic(ctx.baseModuleName()) && !library.buildStubs() && ctx.Arch().Native && !ctx.inRecovery() { - if ctx.Device() { + if installToBootstrap(ctx.baseModuleName(), ctx.Config()) && !library.buildStubs() && ctx.Arch().Native && !ctx.inRecovery() { + if ctx.Device() && isBionic(ctx.baseModuleName()) { library.installSymlinkToRuntimeApex(ctx, file) } library.baseInstaller.subDir = "bootstrap" diff --git a/cc/makevars.go b/cc/makevars.go index aa6fdea5..b03e170f 100644 --- a/cc/makevars.go +++ b/cc/makevars.go @@ -95,7 +95,20 @@ func makeVarsProvider(ctx android.MakeVarsContext) { ctx.Strict("VNDK_CORE_LIBRARIES", strings.Join(vndkCoreLibraries, " ")) ctx.Strict("VNDK_SAMEPROCESS_LIBRARIES", strings.Join(vndkSpLibraries, " ")) - ctx.Strict("LLNDK_LIBRARIES", strings.Join(llndkLibraries, " ")) + + // Make uses LLNDK_LIBRARIES to determine which libraries to install. + // HWASAN is only part of the LL-NDK in builds in which libc depends on HWASAN. + // Therefore, by removing the library here, we cause it to only be installed if libc + // depends on it. + installedLlndkLibraries := []string{} + for _, lib := range llndkLibraries { + if strings.HasPrefix(lib, "libclang_rt.hwasan-") { + continue + } + installedLlndkLibraries = append(installedLlndkLibraries, lib) + } + ctx.Strict("LLNDK_LIBRARIES", strings.Join(installedLlndkLibraries, " ")) + ctx.Strict("VNDK_PRIVATE_LIBRARIES", strings.Join(vndkPrivateLibraries, " ")) ctx.Strict("VNDK_USING_CORE_VARIANT_LIBRARIES", strings.Join(vndkUsingCoreVariantLibraries, " ")) |