Reland "Prevent statically linking to a lib providing stable C APIs"
This reverts commit5b75774004
. Exempt-From-Owner-Approval: cherry-pick from internal Bug: 151051671 Test: m Merged-In: I05f0465976098941d47ecc06c978cfa116364d78 (cherry picked from commitaf7ed39b06
) Change-Id: I05f0465976098941d47ecc06c978cfa116364d78
This commit is contained in:
@@ -4833,6 +4833,42 @@ func TestApexSet(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNoStaticLinkingToStubsLib(t *testing.T) {
|
||||
testApexError(t, `.*required by "mylib" is a native library providing stub.*`, `
|
||||
apex {
|
||||
name: "myapex",
|
||||
key: "myapex.key",
|
||||
native_shared_libs: ["mylib"],
|
||||
}
|
||||
|
||||
apex_key {
|
||||
name: "myapex.key",
|
||||
public_key: "testkey.avbpubkey",
|
||||
private_key: "testkey.pem",
|
||||
}
|
||||
|
||||
cc_library {
|
||||
name: "mylib",
|
||||
srcs: ["mylib.cpp"],
|
||||
static_libs: ["otherlib"],
|
||||
system_shared_libs: [],
|
||||
stl: "none",
|
||||
apex_available: [ "myapex" ],
|
||||
}
|
||||
|
||||
cc_library {
|
||||
name: "otherlib",
|
||||
srcs: ["mylib.cpp"],
|
||||
system_shared_libs: [],
|
||||
stl: "none",
|
||||
stubs: {
|
||||
versions: ["1", "2", "3"],
|
||||
},
|
||||
apex_available: [ "myapex" ],
|
||||
}
|
||||
`)
|
||||
}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
run := func() int {
|
||||
setUp()
|
||||
|
Reference in New Issue
Block a user