From 834b9a62163c43b7dc5dae1cfcb6b75aab952e00 Mon Sep 17 00:00:00 2001 From: Logan Chien Date: Mon, 14 Jan 2019 15:39:03 +0800 Subject: [PATCH] Add sdk version workaround for libclang_rt libclang_rt.*.so depends on libc++, which is not a part of NDK. Thus, this workaround must be added in order not to break the build when the prebuilt dependencies are checked. Bug: 121358700 Test: make checkbuild Change-Id: Icaeb7adf96fb72829053e198b659ebcb19a035fc --- cc/cc.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cc/cc.go b/cc/cc.go index 1b5e8b184..f107968ec 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -1315,6 +1315,13 @@ func checkLinkType(ctx android.ModuleContext, from *Module, to *Module, tag depe // the NDK. return } + + if strings.HasPrefix(ctx.ModuleName(), "libclang_rt.") && to.Name() == "libc++" { + // Bug: http://b/121358700 - Allow libclang_rt.* shared libraries (with sdk_version) + // to link to libc++ (non-NDK and without sdk_version). + return + } + if String(to.Properties.Sdk_version) == "" { // NDK code linking to platform code is never okay. ctx.ModuleErrorf("depends on non-NDK-built library %q",