aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cc/linker.go12
-rw-r--r--cc/util.go10
2 files changed, 22 insertions, 0 deletions
diff --git a/cc/linker.go b/cc/linker.go
index 5a3b4781..2c391320 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -87,6 +87,14 @@ type BaseLinkerProperties struct {
// group static libraries. This can resolve missing symbols issues with interdependencies
// between static libraries, but it is generally better to order them correctly instead.
Group_static_libs *bool `android:"arch_variant"`
+
+ Target struct {
+ Vendor struct {
+ // list of shared libs that should not be used to build
+ // the vendor variant of the C/C++ module.
+ Exclude_shared_libs []string
+ }
+ }
}
func NewBaseLinker() *baseLinker {
@@ -123,6 +131,10 @@ func (linker *baseLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
deps.StaticLibs = append(deps.StaticLibs, linker.Properties.Static_libs...)
deps.SharedLibs = append(deps.SharedLibs, linker.Properties.Shared_libs...)
+ if ctx.vndk() {
+ deps.SharedLibs = removeListFromList(deps.SharedLibs, linker.Properties.Target.Vendor.Exclude_shared_libs)
+ }
+
deps.ReexportHeaderLibHeaders = append(deps.ReexportHeaderLibHeaders, linker.Properties.Export_header_lib_headers...)
deps.ReexportStaticLibHeaders = append(deps.ReexportStaticLibHeaders, linker.Properties.Export_static_lib_headers...)
deps.ReexportSharedLibHeaders = append(deps.ReexportSharedLibHeaders, linker.Properties.Export_shared_lib_headers...)
diff --git a/cc/util.go b/cc/util.go
index 2febb57c..50fb332f 100644
--- a/cc/util.go
+++ b/cc/util.go
@@ -66,6 +66,16 @@ func filterList(list []string, filter []string) (remainder []string, filtered []
return
}
+func removeListFromList(list []string, filter_out []string) (result []string) {
+ result = make([]string, 0, len(list))
+ for _, l := range list {
+ if !inList(l, filter_out) {
+ result = append(result, l)
+ }
+ }
+ return
+}
+
func removeFromList(s string, list []string) (bool, []string) {
i := indexList(s, list)
if i != -1 {