Also, don't diff unreferenced anonymous records.
Bug: 64267858
Bug: 72697345
Test: Extend libjpeg by adding an exported function, also add an unused struct;
Without this change: build shows an 'error' message, but does not fail.
With this change in prebuilts : build shows 'error' message and
fails.
Test: tests/test.py passes.
Change-Id: Ief7ed90715a9c1a25736c10449833650c73d3db3
This commit suppresses extension warning if --allow-extensions is
specified.
Test: Run header-abi-diff with --allow-extensions
Change-Id: I76a868aea239e5ce6f8213c12282c946d28f2ab5
This commit changes API extensions from warning to error if the command
line option `--allow-extensions` is not specified.
Test: Run header-abi-diff without --allow-extensions and see the error
Change-Id: If3cf659246e78409ec64ce68dfa885ab4808b50b
Added command line options to header-abi-dumper and header-abi-diff to
support multiple text formats.
Bug: 63865902
Test: BOARD_VNDK_VERSION=current mm -j64 in
frameworks/compile/libbcc/bcinfo produces libbcinfo.so.lsdump
successfully.
Test: tests/test.py; all tests pass.
Change-Id: I291d3af16e90b12ee131bb864f90a5b96189db13
Some elf symbols in the .dynsym table of an .so file may not be present
in the headers exported by a shared library. We must still know about
these changes. Therefore, add options to make notifications about
these changes warnings instead of errors.
Bug: 62060883
Test: tests/test.py pass
Change-Id: Ic0cbad3370597c251f9e2c0f2b8cbb089aed155f
1) Types are now quantifed into one of the following:
a) RecordType - structures/ unions/ classes.
b) EnumType - enumerated types.
c) QualifiedType - types with qualifiers intact.
d) PointerType - pointer to a type.
e) LvalueReferenceType
f) RvalueReferenceType
g) ArrayType
2) ABI diffing now diffs based on types directly / indirectly reachable
by function signatures / global variable types by default. Also added an option
to header-abi-diff:
-check-all-apis : Include changes to all APIs exported via exported
headers whether directly / indirectly used by function signatures /
global variable types or not.
3) Introduced an internal representation of abi information. This
enables us to switch formats of abi-dumps / abi-diffs more easily
without changing the AST parsing code. For example: In the future, if we
wanted to add options to view the abi-dumps in html / xml we could just
add classes which extended IRDumper and implement dumping methods.
4) The linked ABI dump of a shared library also includes a list of the
exported functions and objects collected from the .dynsym table. This makes it
possible to avoid false reports of ABI breakages when functions/ global
variables are moved to assembly files.
Test: abi-dumping and linking: make -j64 from ToT
abi_diffing: change parameter types directly, indirectly.
Ran tests/test.py with soong running the built tool, all tests passed.
Bug: 62060883
Bug: 63865902
Change-Id: Id9ef757165a1669049fde20bda4147d5074cc191
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
Bug: 38325544
Test:
As shown by out/build.trace.gz when using built header-abi-linker to
link .sdump files produced by header-abi-linker.
Without fix:
Time taken to produce libc.so.lsdump by header-abi-linker => ~51 sec
With fix:
Time taken to produce libc.so.lsdump by header-abi-linker => ~3 sec
Bug: 38325929
Test: merged abiff reports of libjpeg, libc.
Change-Id: Iae54f4754d8b0407fabdb8bc8550a7f7b3479f8f
Bug: 37751376
Test: dumped the abi of libminijail, removed the "struct" keyword from
the abi-dump and confirmed that this did not result in an abi breakage
getting reported.
Bug: 37749718
Test: manually invoked header-abi-diff with file containing a list of
symbols to omit abi checks on from libminijail after changing sizes and
alignments of those symbols from libminijail's abi dumps. Diffs were not
reported.
Bug: 37918686
Test: dumped the abi of libbcinfo, it contains records as well as
symbols which adhere to the regex in the symbol file.
Also make function signature diffing independent of C++ name mangling.
Change-Id: Id34209ef24d1202745ca69765a4e2a96d1a05c2a
1) Add option to parse version script file specifying exported symbols and
variables during link time.
2) Added test version script file.
3) Minor style cleanup.
4) Remove HandleVTable as it is no longer needed.
5) header-abi-diff has a mode to enable advice-only mode. This means no
failures on abi extensions / incompatiblity. Only report generation.
5) Seperate out functionality into util lib.
Test: 1) header-abi-dumper -o example1.dump tests/input/example1.cpp -I
tests -- -x c++ -std=c++11 -I . -I
~/android/aosp/external/clang/lib/Headers
2) header-abi-linker -o test.lsdump example1.dump -v
tests/input/test_version_script.map -arch arm64 -api 24,
test.lsdump has only the symbols specified by test_version_script.amp
Change-Id: Ib539db4a886abe4917e09cd8643ab35ffecb0df1
Make Messages mirror clang Types better.
Added type size and alignments for independent and complete types.
Added vtable layout for CXXRecordDecls.
Added abi information for variables with global storage.
Added new return status to signify abi extension.
Added checks for access specifier downgrades.
Removed repeated code from header-abi-diff.
Test: header-abi-dumper -o example1.dump tests/input/example1.cpp -I
tests -- -x c++ -std=c++11 -I . -I
~/android/aosp/external/clang/lib/Headers
Change-Id: I21b5a8ef6dff92ecae47a0b1c46342862c5e0ebd
header-abi-diff takes two input dumps produced by header-abi-dumper and
produces an abi compatiblity report.
header-abi-dumper, header-abi-linker now produce dumps formatted only in
protobuf TextFormat.
Test: Dump the abi exposed by test/input/example1.cpp. Add fields, change
return types of functions and dump the abi of this version. Produce the
compatibility report by: header-abi-diff -old <ver1-dump> -new <ver2-dump>
-o <compatibility-report>.
Also tested changing the abi of libjpeg, and comparing a reference
dump with the new dump. An Abi breakage is reported.
Bug: 32750600
Change-Id: I5444912d84de726aaa18977ca9162162aa13b760