From d015c4ac1be2c2dcf903a7394c6dc01fe20bd006 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 10 Aug 2016 14:34:08 -0700 Subject: [PATCH] Add support for NDK r13. Test: make checkbuild Bug: None Change-Id: I6e7c92d6731be4ae47c7dc5e9444af08d338334b --- cc/library.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cc/library.go b/cc/library.go index 14ceb2899..ad1822d40 100644 --- a/cc/library.go +++ b/cc/library.go @@ -395,6 +395,25 @@ 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, flags.Toolchain, "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")) + } + } + TransformObjToDynamicBinary(ctx, objFiles, sharedLibs, deps.StaticLibs, deps.LateStaticLibs, deps.WholeStaticLibs, linkerDeps, deps.CrtBegin, deps.CrtEnd, false, builderFlags, outputFile)