diff options
author | Jiyong Park <jiyong@google.com> | 2017-08-03 21:22:50 +0900 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-08-17 17:34:25 -0700 |
commit | ab0fd5f060500d159942f7e408f9406652d62372 (patch) | |
tree | 967ff0d1e77c4369f11b4660b9a55883b81eee7c /cc/vndk.go | |
parent | 2b3cb9cd39e4e9538ee32e0e0668274f4b662b39 (diff) | |
download | soong-ab0fd5f060500d159942f7e408f9406652d62372.tar.gz |
List of VNDK-related libs are exported to make
LL-NDK, VNDK-core, VNDK-SP libraries are exported to make as
SOONG_LLNDK_LIBRARIES, SOONG_VNDK_CORE_LIBRARIES, and
SOONG_VNDK_SAMEPROCESS_LIBRARIES. This can be used to auto-generate
ld.config.txt from a template.
Bug: 64013660
Test: BOARD_VNDK_VERSION=current m -j successful
Test: check out/soong/make_vars*.mk and look for SOONG_*_LIBRARIES
Merged-In: I0f4c5d05d9cd28c3fc9fdcca6ce0e6eaeaacbe8d
Change-Id: I0f4c5d05d9cd28c3fc9fdcca6ce0e6eaeaacbe8d
(cherry picked from commit d5b18a55bbde5d7f0ce78c889aacdd4bc2efc994)
Diffstat (limited to 'cc/vndk.go')
-rw-r--r-- | cc/vndk.go | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/cc/vndk.go b/cc/vndk.go index fd1bdcb58..2e6ac137a 100644 --- a/cc/vndk.go +++ b/cc/vndk.go @@ -15,6 +15,9 @@ package cc import ( + "strings" + "sync" + "android/soong/android" ) @@ -96,3 +99,38 @@ func (vndk *vndkdep) vndkCheckLinkType(ctx android.ModuleContext, to *Module) { return } } + +var ( + vndkCoreLibraries []string + vndkSpLibraries []string + llndkLibraries []string + vndkLibrariesLock sync.Mutex +) + +// gather list of vndk-core, vndk-sp, and ll-ndk libs +func vndkMutator(mctx android.BottomUpMutatorContext) { + if m, ok := mctx.Module().(*Module); ok { + if _, ok := m.linker.(*llndkStubDecorator); ok { + vndkLibrariesLock.Lock() + defer vndkLibrariesLock.Unlock() + name := strings.TrimSuffix(m.Name(), llndkLibrarySuffix) + if !inList(name, llndkLibraries) { + llndkLibraries = append(llndkLibraries, name) + } + } else if lib, ok := m.linker.(*libraryDecorator); ok && lib.shared() { + if m.vndkdep.isVndk() { + vndkLibrariesLock.Lock() + defer vndkLibrariesLock.Unlock() + if m.vndkdep.isVndkSp() { + if !inList(m.Name(), vndkSpLibraries) { + vndkSpLibraries = append(vndkSpLibraries, m.Name()) + } + } else { + if !inList(m.Name(), vndkCoreLibraries) { + vndkCoreLibraries = append(vndkCoreLibraries, m.Name()) + } + } + } + } + } +} |