Add shared_libs to vendor and recovery targets.
Prerequisite for https://android-review.googlesource.com/815573.
Test: Built system/core/libunwindstack with https://android-review.googlesource.com/815573
Bug: 118374951
Change-Id: I6dd7ba1416f34291792c8ac5cf74048753f3e2f6
diff --git a/cc/linker.go b/cc/linker.go
index e96bfcb..a1593ee 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -99,6 +99,10 @@
Target struct {
Vendor struct {
+ // list of shared libs that only should be used to build the vendor
+ // variant of the C/C++ module.
+ Shared_libs []string
+
// list of shared libs that should not be used to build the vendor variant
// of the C/C++ module.
Exclude_shared_libs []string
@@ -116,6 +120,10 @@
Exclude_runtime_libs []string
}
Recovery struct {
+ // list of shared libs that only should be used to build the recovery
+ // variant of the C/C++ module.
+ Shared_libs []string
+
// list of shared libs that should not be used to build
// the recovery variant of the C/C++ module.
Exclude_shared_libs []string
@@ -200,6 +208,7 @@
}
if ctx.useVndk() {
+ deps.SharedLibs = append(deps.SharedLibs, linker.Properties.Target.Vendor.Shared_libs...)
deps.SharedLibs = removeListFromList(deps.SharedLibs, linker.Properties.Target.Vendor.Exclude_shared_libs)
deps.ReexportSharedLibHeaders = removeListFromList(deps.ReexportSharedLibHeaders, linker.Properties.Target.Vendor.Exclude_shared_libs)
deps.StaticLibs = removeListFromList(deps.StaticLibs, linker.Properties.Target.Vendor.Exclude_static_libs)
@@ -210,6 +219,7 @@
}
if ctx.inRecovery() {
+ deps.SharedLibs = append(deps.SharedLibs, linker.Properties.Target.Recovery.Shared_libs...)
deps.SharedLibs = removeListFromList(deps.SharedLibs, linker.Properties.Target.Recovery.Exclude_shared_libs)
deps.ReexportSharedLibHeaders = removeListFromList(deps.ReexportSharedLibHeaders, linker.Properties.Target.Recovery.Exclude_shared_libs)
deps.StaticLibs = removeListFromList(deps.StaticLibs, linker.Properties.Target.Recovery.Exclude_static_libs)