Add more flexibility to abi checking.

1) Marking a field "required" robs us of flexibility. Make fields optional
allows us to update the message format without needing to necessarily
update the reference abi-dumps.

2) Allow local warnings with the invocation of header-abi-diff.

Test: Added a function to libjpeg, got a warning claiming abi extended.

3) Introduce a flag which allows us to not filter any abi. This is
useful for cases when libraries do not include what they export. eg :
libsqlite.

Test: abi-dump size of libsqlite:
	without no-filter : 0
	with no-filter : ~9M

Change-Id: I6cfeacc8711f6df7a4136c2a27b5638988a2c54b
This commit is contained in:
Jayant Chowdhary
2017-05-23 13:49:40 -07:00
parent 0a318e9244
commit e6a88775e9
6 changed files with 78 additions and 35 deletions

View File

@@ -49,6 +49,10 @@ static llvm::cl::opt<bool> advice_only(
"advice-only", llvm::cl::desc("Advisory mode only"), llvm::cl::Optional,
llvm::cl::cat(header_checker_category));
static llvm::cl::opt<bool> suppress_local_warnings(
"suppress_local_warnings", llvm::cl::desc("suppress local warnings"),
llvm::cl::Optional, llvm::cl::cat(header_checker_category));
static llvm::cl::opt<bool> allow_extensions(
"allow-extensions",
llvm::cl::desc("Do not return a non zero status on extensions"),
@@ -80,6 +84,28 @@ int main(int argc, const char **argv) {
CompatibilityStatus status = judge.GenerateCompatibilityReport();
std::string status_str = "";
switch (status) {
case CompatibilityStatus::INCOMPATIBLE:
status_str = "broken";
break;
case CompatibilityStatus::EXTENSION:
status_str = "extended";
break;
default:
break;
}
if (!suppress_local_warnings && status) {
llvm::errs() << "******************************************************\n"
<< "VNDK Abi "
<< status_str
<< ":"
<< " Please check compatiblity report at : "
<< compatibility_report << "\n"
<< "*****************************************************\n";
}
if (advice_only) {
return CompatibilityStatus::COMPATIBLE;
}