aboutsummaryrefslogtreecommitdiffstats
path: root/cc/makevars.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/makevars.go')
-rw-r--r--cc/makevars.go15
1 files changed, 14 insertions, 1 deletions
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, " "))