Merge "Escape cc ldflags in bp2build conversion"
This commit is contained in:
@@ -2437,3 +2437,18 @@ cc_library {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestCcLibraryEscapeLdflags(t *testing.T) {
|
||||||
|
runCcLibraryTestCase(t, bp2buildTestCase{
|
||||||
|
moduleTypeUnderTest: "cc_library",
|
||||||
|
moduleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
|
blueprint: soongCcProtoPreamble + `cc_library {
|
||||||
|
name: "foo",
|
||||||
|
ldflags: ["-Wl,--rpath,${ORIGIN}"],
|
||||||
|
include_build_directory: false,
|
||||||
|
}`,
|
||||||
|
expectedBazelTargets: makeCcLibraryTargets("foo", attrNameToString{
|
||||||
|
"linkopts": `["-Wl,--rpath,$${ORIGIN}"]`,
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@@ -644,7 +644,7 @@ func (la *linkerAttributes) bp2buildForAxisAndConfig(ctx android.BazelConversion
|
|||||||
|
|
||||||
var linkerFlags []string
|
var linkerFlags []string
|
||||||
if len(props.Ldflags) > 0 {
|
if len(props.Ldflags) > 0 {
|
||||||
linkerFlags = append(linkerFlags, props.Ldflags...)
|
linkerFlags = append(linkerFlags, proptools.NinjaEscapeList(props.Ldflags)...)
|
||||||
// binaries remove static flag if -shared is in the linker flags
|
// binaries remove static flag if -shared is in the linker flags
|
||||||
if isBinary && android.InList("-shared", linkerFlags) {
|
if isBinary && android.InList("-shared", linkerFlags) {
|
||||||
axisFeatures = append(axisFeatures, "-static_flag")
|
axisFeatures = append(axisFeatures, "-static_flag")
|
||||||
|
Reference in New Issue
Block a user