aboutsummaryrefslogtreecommitdiffstats
path: root/cc/linker.go
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2017-06-16 12:03:55 +0900
committerJiyong Park <jiyong@google.com>2017-06-21 10:13:27 +0900
commit44cf1a777916fbe2dc03760b0f2076c4cd3a0f63 (patch)
tree8e621b3b6fd467cdcbe631fd04669f8e387e1684 /cc/linker.go
parent83cf1cee583dc50c928ea27082e54aa815932ea4 (diff)
downloadbuild_soong-44cf1a777916fbe2dc03760b0f2076c4cd3a0f63.tar.gz
build_soong-44cf1a777916fbe2dc03760b0f2076c4cd3a0f63.tar.bz2
build_soong-44cf1a777916fbe2dc03760b0f2076c4cd3a0f63.zip
add exclude_shared_libs for vendor_available:true libs
Adding a mechanism to conditionally exclude some shared library dependencies when a lib is built for vendors. Without this, some libraries cannot be earily marked as vendor_available if they are depending on shared libs can shouldn't be marked as vendor_available. By using exclude_shared_libs with exclude_srcs (or __ANDROID_VNDK__ macro), we can eliminate the unnecessary dependency for vendors. Bug: 62471389 Test: build Change-Id: If94277b45c3769223cea371d0028e75277640356
Diffstat (limited to 'cc/linker.go')
-rw-r--r--cc/linker.go12
1 files changed, 12 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...)