diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-22 07:27:27 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-22 07:27:27 +0000 |
commit | 836d143ff22c38387952d42e27051cd8999ac638 (patch) | |
tree | dde2946694c15973cfbb47033a360d20c7d2d40e | |
parent | 9037d5b652206ab260e6c212c691540238d9287f (diff) | |
parent | 98b16c3aba9ee1ac8e93df58f36d881800dae1b7 (diff) | |
download | build_soong-836d143ff22c38387952d42e27051cd8999ac638.tar.gz build_soong-836d143ff22c38387952d42e27051cd8999ac638.tar.bz2 build_soong-836d143ff22c38387952d42e27051cd8999ac638.zip |
release-request-e204d718-da41-4e1e-bacd-c823491d6b52-for-git_oc-dr1-release-4124654 snap-temp-L59700000076596226
Change-Id: I33448ae90bd4a948c9960a34c3ef2b443d083f38
-rw-r--r-- | cc/config/global.go | 2 | ||||
-rw-r--r-- | cc/linker.go | 12 | ||||
-rw-r--r-- | cc/util.go | 10 |
3 files changed, 23 insertions, 1 deletions
diff --git a/cc/config/global.go b/cc/config/global.go index 5a669987..2e16068c 100644 --- a/cc/config/global.go +++ b/cc/config/global.go @@ -193,7 +193,7 @@ func VndkLibraries() []string { // [vendor] // namespace.default.link.system.shared_libs func LLndkLibraries() []string { - return []string{"libc", "libm", "libdl", "liblog", "libandroid_net", "ld-android", "libvndksupport"} + return []string{"libc", "libm", "libdl", "liblog", "libandroid_net", "ld-android", "libvndksupport", "libnativewindow"} } func replaceFirst(slice []string, from, to string) { 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...) @@ -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 { |