Use Soong modules for the NDK's extra STL libraries

* The extra STL libs are:

       libc++abi.a [needed for ndk_libc++_static]
       libandroid_support.a [always needed in NDK r16]
       libunwind.a [needed for ARM32]

 * The existing STL-dependency logic in linkShared only applies to shared
   libraries. By moving it to STL deps, the extra STL libs are linked into
   both shared libraries and executables.

 * Remove the ndk_prebuilt_library/ndkPrebuiltLibraryFactory module type,
   which is unused now.

 * Reuse the ndk_prebuilt_static_stl module type to describe the extra
   static libraries that are linked with both the static and shared libc++
   STLs.

Bug: b/73133405
Test: manual
Change-Id: I3f73e4f882d39e6efa470073bb4fc8c42dff8253
This commit is contained in:
Ryan Prichard
2018-03-26 16:30:31 -07:00
committed by Colin Cross
parent 2d4929464b
commit b1703659a8
4 changed files with 25 additions and 83 deletions

View File

@@ -601,25 +601,6 @@ func (library *libraryDecorator) linkShared(ctx ModuleContext,
sharedLibs := deps.SharedLibs
sharedLibs = append(sharedLibs, deps.LateSharedLibs...)
// TODO(danalbert): Clean this up when soong supports prebuilts.
if strings.HasPrefix(ctx.selectedStl(), "ndk_libc++") {
libDir := getNdkStlLibDir(ctx, "libc++")
if strings.HasSuffix(ctx.selectedStl(), "_shared") {
deps.StaticLibs = append(deps.StaticLibs,
libDir.Join(ctx, "libandroid_support.a"))
} else {
deps.StaticLibs = append(deps.StaticLibs,
libDir.Join(ctx, "libc++abi.a"),
libDir.Join(ctx, "libandroid_support.a"))
}
if ctx.Arch().ArchType == android.Arm {
deps.StaticLibs = append(deps.StaticLibs,
libDir.Join(ctx, "libunwind.a"))
}
}
linkerDeps = append(linkerDeps, deps.SharedLibsDeps...)
linkerDeps = append(linkerDeps, deps.LateSharedLibsDeps...)
linkerDeps = append(linkerDeps, objs.tidyFiles...)