Revert "Block CFI on static libraries"
This reverts commit f9abec0987
.
Reason for revert:
https://b.corp.google.com/issues/301444094
https://b.corp.google.com/issues/301443813
https://b.corp.google.com/issues/301437374
Change-Id: I6fd03e4d3c0930005178ad347f53156be8f15efc
This commit is contained in:
committed by
Gerrit Code Review
parent
f9abec0987
commit
85d55c2847
@@ -4785,6 +4785,7 @@ cc_library {
|
||||
}`,
|
||||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
|
||||
"features": `["android_cfi"]`,
|
||||
"local_includes": `["."]`,
|
||||
}),
|
||||
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||
@@ -4813,6 +4814,10 @@ cc_library {
|
||||
}`,
|
||||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["android_cfi"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
}),
|
||||
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||
@@ -4843,7 +4848,10 @@ cc_library {
|
||||
}`,
|
||||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
|
||||
"features": `["android_cfi_assembly_support"]`,
|
||||
"features": `[
|
||||
"android_cfi",
|
||||
"android_cfi_assembly_support",
|
||||
]`,
|
||||
"local_includes": `["."]`,
|
||||
}),
|
||||
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||
|
@@ -1522,7 +1522,7 @@ func TestCcLibrarySharedWithCfiAndCfiAssemblySupport(t *testing.T) {
|
||||
runCcLibrarySharedTestCase(t, Bp2buildTestCase{
|
||||
Description: "cc_library_shared has correct features when cfi is enabled with cfi assembly support",
|
||||
Blueprint: `
|
||||
cc_library_shared {
|
||||
cc_library_static {
|
||||
name: "foo",
|
||||
sanitize: {
|
||||
cfi: true,
|
||||
@@ -1532,7 +1532,7 @@ cc_library_shared {
|
||||
},
|
||||
}`,
|
||||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
||||
MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
|
||||
"features": `[
|
||||
"android_cfi",
|
||||
"android_cfi_assembly_support",
|
||||
|
@@ -2135,9 +2135,9 @@ cc_library_static {
|
||||
})
|
||||
}
|
||||
|
||||
func TestCcLibraryStaticNoCfi(t *testing.T) {
|
||||
func TestCcLibraryStaticWithCfi(t *testing.T) {
|
||||
runCcLibraryStaticTestCase(t, Bp2buildTestCase{
|
||||
Description: "cc_library_static never explicitly enables CFI",
|
||||
Description: "cc_library_static has correct features when cfi is enabled",
|
||||
Blueprint: `
|
||||
cc_library_static {
|
||||
name: "foo",
|
||||
@@ -2147,6 +2147,7 @@ cc_library_static {
|
||||
}`,
|
||||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
|
||||
"features": `["android_cfi"]`,
|
||||
"local_includes": `["."]`,
|
||||
}),
|
||||
},
|
||||
@@ -2155,7 +2156,7 @@ cc_library_static {
|
||||
|
||||
func TestCcLibraryStaticWithCfiOsSpecific(t *testing.T) {
|
||||
runCcLibraryStaticTestCase(t, Bp2buildTestCase{
|
||||
Description: "cc_library_static never explicitly enables CFI even for specific variants",
|
||||
Description: "cc_library_static has correct features when cfi is enabled for specific variants",
|
||||
Blueprint: `
|
||||
cc_library_static {
|
||||
name: "foo",
|
||||
@@ -2169,6 +2170,10 @@ cc_library_static {
|
||||
}`,
|
||||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
|
||||
"features": `select({
|
||||
"//build/bazel/platforms/os:android": ["android_cfi"],
|
||||
"//conditions:default": [],
|
||||
})`,
|
||||
"local_includes": `["."]`,
|
||||
}),
|
||||
},
|
||||
@@ -2177,7 +2182,7 @@ cc_library_static {
|
||||
|
||||
func TestCcLibraryStaticWithCfiAndCfiAssemblySupport(t *testing.T) {
|
||||
runCcLibraryStaticTestCase(t, Bp2buildTestCase{
|
||||
Description: "cc_library_static will specify cfi_assembly_support feature but not cfi feature",
|
||||
Description: "cc_library_static has correct features when cfi is enabled with cfi_assembly_support",
|
||||
Blueprint: `
|
||||
cc_library_static {
|
||||
name: "foo",
|
||||
@@ -2190,7 +2195,10 @@ cc_library_static {
|
||||
}`,
|
||||
ExpectedBazelTargets: []string{
|
||||
MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
|
||||
"features": `["android_cfi_assembly_support"]`,
|
||||
"features": `[
|
||||
"android_cfi",
|
||||
"android_cfi_assembly_support",
|
||||
]`,
|
||||
"local_includes": `["."]`,
|
||||
}),
|
||||
},
|
||||
|
Reference in New Issue
Block a user