Split ldflags in bp2build
But do the splitting before adding $(location...) flags. Fixes: 247830974 Test: Unit tests Test: m nothing Change-Id: I4a7e8e20f720a1074a5ffa17da4fe9b96ca6ed58
This commit is contained in:
@@ -221,6 +221,38 @@ func TestCcBinaryVersionScript(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestCcBinaryLdflagsSplitBySpaceExceptSoongAdded(t *testing.T) {
|
||||
runCcBinaryTests(t, ccBinaryBp2buildTestCase{
|
||||
description: "ldflags are split by spaces except for the ones added by soong (version script and dynamic list)",
|
||||
blueprint: `
|
||||
{rule_name} {
|
||||
name: "foo",
|
||||
ldflags: [
|
||||
"--nospace_flag",
|
||||
"-z spaceflag",
|
||||
],
|
||||
version_script: "version_script",
|
||||
dynamic_list: "dynamic.list",
|
||||
include_build_directory: false,
|
||||
}
|
||||
`,
|
||||
targets: []testBazelTarget{
|
||||
{"cc_binary", "foo", AttrNameToString{
|
||||
"additional_linker_inputs": `[
|
||||
"version_script",
|
||||
"dynamic.list",
|
||||
]`,
|
||||
"linkopts": `[
|
||||
"--nospace_flag",
|
||||
"-z",
|
||||
"spaceflag",
|
||||
"-Wl,--version-script,$(location version_script)",
|
||||
"-Wl,--dynamic-list,$(location dynamic.list)",
|
||||
]`,
|
||||
}}},
|
||||
})
|
||||
}
|
||||
|
||||
func TestCcBinarySplitSrcsByLang(t *testing.T) {
|
||||
runCcHostBinaryTestCase(t, ccBinaryBp2buildTestCase{
|
||||
description: "split srcs by lang",
|
||||
|
Reference in New Issue
Block a user