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
Bug: 71486762
Test: tests/test.py
Test: m -j vndk_package; verify that .lsdump files have function_types
with references to parameters and return type.
Change-Id: I229bf9a40c8909cefa58a301ae993ef5c3b40e71
The key being added to respective maps which facilitate diffing of
unreferenced user defined types was earlier the linker set key. The
unique id should be used instead. This is because linker set keys for C
and C++ types can be the same, but their unique id's cannot. Thus,
having linker set keys as a key leaves open the possibility of false
type aliasing, whereas the unique id does not.
Test: python3 tests/test.py
Test: python3 tests/test.py \
MyTest.test_libc_and_cpp_with_unused_struct_and_libc_and_cpp_with_unused_cstruct;
before this change, this test fails; after this change, the test
passes.
Change-Id: I91816167a48308a8c812d01e0a09e9bb70c60b50
This causes unnecessary verbosity in diff reports.
Test: The following:
Without this change:
header-abi-diff -arch arm64 -lib libcpp_referenced_records -old \
tests/reference_dumps/arm64/libgolden_cpp.so.lsdump -new \
tests/reference_dumps/arm64/libgolden_cpp_change_member_access.so.lsdump -o \
unref_diff -check-all-apis; unref_diff has LowVolumeSpeaker as an
unreferenced diff as well as a referenced diff.
With this change:
Run the same test command as above; unref_diff has LowVolumeSpeaker
only as a referenced diff.
Change-Id: Iddb2ed2f759637f53b00fd1398395a1b1c207116
We now need to convert from type ids to type names while adding a diff
message, since types don't have type names as references anymore.
Bug: 71486971
Test: tests/test.py test updation CL; all tests pass.
Test: tests/gen_all.py; manually diff between libcpp_gold.so.lsdump and
libcpp_gold_member_diff.so.lsdump, diff is visually the same as
before.
Test: build android source tree for aosp_arm64_ab; create reference
dumps; rebuild; confirm no errors or warnings.
Change-Id: I17a3a1a02c5c2312e543a930ae3a1d9037e683b8
This enables us to use abi-diffing both while doing an abi diff between
two libraries and also while comparing two records / enums for an ODR
violation.
Bug: 71486971
Test: make -j64
Change-Id: Ic778b9fe8824835b7380ad1740751d8d4bcca9d6
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
libclang's getFullyQualifiedName API can miss default template arguments
and sometimes does not fully qualify template parameters as well. So for
type uniquing, use the API used by LLVM for TBAA : mangleCXXRTTIName.
Test: tests/test.py, all tests pass.
Bug: 69568963
Change-Id: Ibc97f5d3b0a1cb0eeed5f5df3e9c373bcb9573b4
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
Make TextFormatToIRReader to return maps instead of vectors. This allows
us to 'merge' two TextFormatToIRReaders more efficiently, which enables
more efficient and cleaner code for multi-threaded linking.
Test: tests/test.py; all tests pass.
Change-Id: I6dae0080af9f36216d30370d4f4936eedcda83d1
DiffKind really belongs to DiffMessageIR which logically groups it with the
kind of diff message.
Bug: 63865902
Test: mm -j64.
Change-Id: I78025de5cada498c9d549ff9d726657858f0c4a4
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
Test: create a reference dump for libc++ with the old format, copy it to
prebuilts/abi-dumps/vndk, run mm -j64 to invoke header-abi-diff,no protobuf
TextFormat errors reported.
Bug: 62463617
Change-Id: I1d9f952a77a3d5f5276773078876dde17d360ecc
1) Also, emit all mangled symbols for constructors.
2) Add a shared object file parser to libheader-abi-util to filter out
functions and global variables without DEFAULT or PROTECTED visibility.
3) Update expected tests.
Bug: 62721815
Bug: 62463617
Bug: 62307940
Test: Build libclang with "-UNDEBUG", mm -j64 on external/libcxx
Test: Both C1 and C2 constructors are generated for records.
Change-Id: Id5440a647fe41d27cb857a7d0e06429e28e45d8b
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