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
This commit is contained in:
Dan Albert 2016-07-21 08:47:33 -07:00
parent ff3a2e4d55
commit 9840e1bf1a
1 changed files with 1 additions and 2 deletions

View File

@ -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)
}