Link libc++demangle with libc++ for the device.

libc++demangle provides __cxa_demangle, which used to be a part of
libc++.so but is being moved out to save on resources since very few
libraries need it.

Test: make checkbuild
Bug: http://b/138245375
Change-Id: Ie97225d496d7d40f8749522bf36702a2d9dcdfe7
This commit is contained in:
Dan Albert
2019-07-24 12:17:40 -07:00
parent 6edff69513
commit 2da19cbc20
3 changed files with 21 additions and 2 deletions

View File

@@ -161,6 +161,15 @@ func (stl *stl) deps(ctx BaseModuleContext, deps Deps) Deps {
} else {
deps.StaticLibs = append(deps.StaticLibs, stl.Properties.SelectedStl)
}
if ctx.Device() && !ctx.useSdk() {
// __cxa_demangle is not a part of libc++.so on the device since
// it's large and most processes don't need it. Statically link
// libc++demangle into every process so that users still have it if
// needed, but the linker won't include this unless it is actually
// called.
// http://b/138245375
deps.StaticLibs = append(deps.StaticLibs, "libc++demangle")
}
if ctx.toolchain().Bionic() {
if ctx.Arch().ArchType == android.Arm {
deps.StaticLibs = append(deps.StaticLibs, "libunwind_llvm")