Explicitly disable CFI in bp2build when false

In Soong, CFI being explicitly set to false overrides presence in
CFI_INCLUDE_PATHS, so this change causes Bazel to mimic the same
precedence.

Bug: 278789968
Test: Unit tests
Change-Id: I827b3d4272eac2002031970f1e67c9321979b14b
This commit is contained in:
Trevor Radcliffe
2023-06-16 20:15:45 +00:00
parent df9c3441aa
commit 523c5c6597
5 changed files with 89 additions and 1 deletions

View File

@@ -1126,6 +1126,26 @@ func TestCcBinaryWithCfiAndCfiAssemblySupport(t *testing.T) {
})
}
func TestCcBinaryExplicitlyDisablesCfiWhenFalse(t *testing.T) {
runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
description: "cc_binary disables cfi when explciitly set to false in the bp",
blueprint: `
{rule_name} {
name: "foo",
sanitize: {
cfi: false,
},
}
`,
targets: []testBazelTarget{
{"cc_binary", "foo", AttrNameToString{
"features": `["-android_cfi"]`,
"local_includes": `["."]`,
}},
},
})
}
func TestCcBinaryStem(t *testing.T) {
runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
description: "cc_binary with stem property",