Merge branch 'upstream-master' into 'master'

* aosp/upstream-master:
  stg: remove ability to emit unstable output
  type_roots: Update `stg` and `stgdiff` documentation
  type_roots: Die when merge is requested on interfaces with type roots
  type_roots: Add flag to `stg` and `stgdiff` tools for capturing types as roots
  Abigail reader: remove useless qualifiers
  Abigail reader: add XML tidying functionality
  Abigail reader: strip non-elements before parsing XML
  Abigail reader: forbid network access during XML parsing
  Abigail reader: make `FromLibxml` and `GetName` return `string_view`
  Abigail reader: use GetName consistently
  Abigail reader: shorten a couple of helper function names
  Abigail reader: GetAttributeOrDie: make a local string const
  stgdiff.md: fix typo in --exact section
  type_roots: Populate type roots while reading ELF
  Abigail reader: add some function description comments
  Abigail reader: GetOnlyChild: eliminate name argument
  Abigail reader: GetAttribute: assign optional<string> using emplace
  Abigail reader: use Die rather than Check in GetOnlyChild
  Abigail reader: update is-declaration-only handling comment
  Abigail reader: add short-named helpers for child iteration
  Abigail reader: use auto* child element iteration loop variable type
  type_roots: Add `ReadOptions` struct for ELF reader
  type_roots: Emit `Interface` node from the proto writer
  fix some const correctness issues
  type_roots: Add `Interface` node to STG protobuf definitions
  proto: make `Symbols` node repeated in the format for consistency
  type_roots: Add types map to `Interface` node
  comparison: move static functions into anonymous namespace

Signed-off-by: Giuliano Procida <gprocida@google.com>
Change-Id: I5c544d452661ff98bf3affa41e4b8c9efb9caf52
tree: e380facd9f760c1169699fb81a345b98a0b3d990
  1. doc/
  2. fuzz/
  3. testdata/
  4. abigail_reader.cc
  5. abigail_reader.h
  6. abigail_reader_test.cc
  7. Android.bp
  8. btf_reader.cc
  9. btf_reader.h
  10. catch.cc
  11. comparison.cc
  12. comparison.h
  13. CONTRIBUTING.md
  14. deduplication.cc
  15. deduplication.h
  16. Dockerfile
  17. dwarf_processor.cc
  18. dwarf_processor.h
  19. dwarf_wrappers.cc
  20. dwarf_wrappers.h
  21. elf_loader.cc
  22. elf_loader.h
  23. elf_reader.cc
  24. elf_reader.h
  25. elf_reader_test.cc
  26. equality.h
  27. equality_cache.h
  28. error.h
  29. error_test.cc
  30. fidelity.cc
  31. fidelity.h
  32. file_descriptor.cc
  33. file_descriptor.h
  34. file_descriptor_test.cc
  35. fingerprint.cc
  36. fingerprint.h
  37. graph.cc
  38. graph.h
  39. hashing.h
  40. input.cc
  41. input.h
  42. LICENSE
  43. Makefile
  44. METADATA
  45. metrics.cc
  46. metrics.h
  47. metrics_test.cc
  48. MODULE_LICENSE_LLVM
  49. naming.cc
  50. naming.h
  51. order.h
  52. order_test.cc
  53. OWNERS
  54. post_processing.cc
  55. post_processing.h
  56. proto_reader.cc
  57. proto_reader.h
  58. proto_writer.cc
  59. proto_writer.h
  60. reader_options.h
  61. README.md
  62. reporting.cc
  63. reporting.h
  64. reporting_test.cc
  65. scc.h
  66. scc_test.cc
  67. stable_hash.cc
  68. stable_hash.h
  69. stg.cc
  70. stg.proto
  71. stgdiff.cc
  72. stgdiff_test.cc
  73. stginfo.cc
  74. substitution.h
  75. symbol_filter.cc
  76. symbol_filter.h
  77. symbol_filter_test.cc
  78. type_normalisation.cc
  79. type_normalisation.h
  80. type_resolution.cc
  81. type_resolution.h
README.md

Symbol-Type Graph (STG)

The STG (symbol-type graph) is an ABI representation and this project contains tools for the creation and comparison of such representations. At present parsers exist for libabigail's ABI XML (C types only) and BTF. The ABI diff tool, stgdiff, supports multiple reporting options.

This software currently depends on libxml2 for XML parsing, on libelf to find .BTF sections and on Linux UAPI headers for BTF types.

How to build the project

To build from source, you will need a few dependencies:

DebianRedHat
libelf-develfutils-devel
libxml2-devlibxml2-devel
linux-libc-devkernel-headers

Instructions are included for local and Docker builds.

Local Build

You can build as follows:

$ make

Docker Build

A Dockerfile is provided to build a container with libabigail to easily compile the STG tools:

$ docker build -t stg .

And then enter the container:

$ docker run -it stg

If you want to bind your development code to the container:

$ docker run -it $PWD:/src -it stg

The source code is added to /src, so when your code is bound you can edit on your host and re-compile in the container.

Note that the Dockerfile can provide a development environment (non multi-stage build with the source code) or a production image (a multi-stage build with only the final binary). By default we provide the first, and you can uncomment the final lines of the file for the latter.

Contributions

See CONTRIBUTING.md for details.