Convert abi warnings to errors.
Convert abi warnings to errors by removing the -advice-only flag from
the invocation of header-abi-diff. This will only apply to branches with
reference abi dumps checked into prebuilts/abi-dumps/(v)ndk (since
abi-diffing will only be triggered on them.)
Also allow for:
1) Extensions.
2) Changes to types in exported headers, unreferenced by public symbols still
trigger warnings.
3) Any removal of symbols appearing in a shared library's .dynsym table, but not
in exported headers is still a warning.
Bug: 64267858
Test: make -j64 from ToT.
Change-Id: Iadeac8d060cb693d4310afb841dc48d91f38597d
diff --git a/cc/builder.go b/cc/builder.go
index 6882e9a..a81dc89 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -37,6 +37,14 @@
)
var (
+ abiCheckAllowFlags = []string{
+ "-allow-extensions",
+ "-allow-unreferenced-changes",
+ "-allow-unreferenced-elf-symbol-changes",
+ }
+)
+
+var (
pctx = android.NewPackageContext("android/soong/cc")
cc = pctx.AndroidGomaStaticRule("cc",
@@ -191,10 +199,10 @@
// Abidiff check turned on in advice-only mode. Builds will not fail on abi incompatibilties / extensions.
sAbiDiff = pctx.AndroidStaticRule("sAbiDiff",
blueprint.RuleParams{
- Command: "$sAbiDiffer -lib $libName -arch $arch -advice-only -check-all-apis -o ${out} -new $in -old $referenceDump",
+ Command: "$sAbiDiffer $allowFlags -lib $libName -arch $arch -check-all-apis -o ${out} -new $in -old $referenceDump",
CommandDeps: []string{"$sAbiDiffer"},
},
- "referenceDump", "libName", "arch")
+ "allowFlags", "referenceDump", "libName", "arch")
unzipRefSAbiDump = pctx.AndroidStaticRule("unzipRefSAbiDump",
blueprint.RuleParams{
@@ -709,6 +717,7 @@
"referenceDump": referenceDump.String(),
"libName": baseName,
"arch": ctx.Arch().ArchType.Name,
+ "allowFlags": strings.Join(abiCheckAllowFlags, " "),
},
})
return android.OptionalPathForPath(outputFile)