From 9840e1bf1a963df347d30ebf4b2b7bc835c5c7d2 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 21 Jul 2016 08:47:33 -0700 Subject: Use the full path to the shared lib. Using only -lc (for example) means that in the case where we have one library path with libc.a but no libc.so (such as prebuilts/ndk) and another with libc.so (such as the out directory), we'll always use the static version. We can link shared libraries by their full path to be sure that we always get the right library. Change-Id: Idf5707fc4aaf9e651d7d8936611200760eab3c7c --- cc/builder.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cc/builder.go b/cc/builder.go index 49f88710..0787847f 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -385,8 +385,7 @@ func TransformObjToDynamicBinary(ctx android.ModuleContext, if !strings.HasSuffix(file, flags.toolchain.ShlibSuffix()) { panic("shared library " + lib.String() + " does not end with " + flags.toolchain.ShlibSuffix()) } - libFlagsList = append(libFlagsList, - "-l"+strings.TrimSuffix(strings.TrimPrefix(file, "lib"), flags.toolchain.ShlibSuffix())) + libFlagsList = append(libFlagsList, lib.String()) ldDirs = append(ldDirs, dir) } -- cgit v1.2.3