Don't add -L for libs that don't need it.

We're already referring to the library by the full path. The -L is
unnecessary.

Follow up to https://android-review.googlesource.com/#/c/249544/

Test: Still builds.
Change-Id: Id27dff29f75797c4c0dcc66704ac08cc0b58cfe3
This commit is contained in:
Dan Albert 2016-07-21 13:16:49 -07:00
parent e1ddc12b5d
commit ce2b839257

View file

@ -50,14 +50,14 @@ var (
ld = pctx.StaticRule("ld",
blueprint.RuleParams{
Command: "$ldCmd ${ldDirFlags} ${crtBegin} @${out}.rsp " +
Command: "$ldCmd ${crtBegin} @${out}.rsp " +
"${libFlags} ${crtEnd} -o ${out} ${ldFlags}",
CommandDeps: []string{"$ldCmd"},
Description: "ld $out",
Rspfile: "${out}.rsp",
RspfileContent: "${in}",
},
"ldCmd", "ldDirFlags", "crtBegin", "libFlags", "crtEnd", "ldFlags")
"ldCmd", "crtBegin", "libFlags", "crtEnd", "ldFlags")
partialLd = pctx.StaticRule("partialLd",
blueprint.RuleParams{
@ -350,7 +350,6 @@ func TransformObjToDynamicBinary(ctx android.ModuleContext,
ldCmd = gccCmd(flags.toolchain, "g++")
}
var ldDirs []string
var libFlagsList []string
if len(flags.libFlags) > 0 {
@ -378,7 +377,7 @@ func TransformObjToDynamicBinary(ctx android.ModuleContext,
}
for _, lib := range sharedLibs {
dir, file := filepath.Split(lib.String())
file := filepath.Base(lib.String())
if !strings.HasPrefix(file, "lib") {
panic("shared library " + lib.String() + " does not start with lib")
}
@ -386,7 +385,6 @@ func TransformObjToDynamicBinary(ctx android.ModuleContext,
panic("shared library " + lib.String() + " does not end with " + flags.toolchain.ShlibSuffix())
}
libFlagsList = append(libFlagsList, lib.String())
ldDirs = append(ldDirs, dir)
}
deps = append(deps, sharedLibs...)
@ -404,7 +402,6 @@ func TransformObjToDynamicBinary(ctx android.ModuleContext,
Implicits: deps,
Args: map[string]string{
"ldCmd": ldCmd,
"ldDirFlags": ldDirsToFlags(ldDirs),
"crtBegin": crtBegin.String(),
"libFlags": strings.Join(libFlagsList, " "),
"ldFlags": flags.ldFlags,