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:
parent
ff3a2e4d55
commit
9840e1bf1a
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue