deduplication: eliminate a loop over the hash partitions am: 8ccf4ca009

Original change: https://googleplex-android-review.googlesource.com/c/platform/external/stg/+/41085908

Change-Id: I08aeb52ed34439083a04ddf462138efb32dda82c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
tree: a0e6ae0701fc473b579fa1649f824a3c9ec3ff59
  1. cmake/
  2. doc/
  3. fuzz/
  4. test_cases/
  5. testdata/
  6. abigail_reader.cc
  7. abigail_reader.h
  8. abigail_reader_test.cc
  9. Android.bp
  10. btf_reader.cc
  11. btf_reader.h
  12. catch.cc
  13. CMakeLists.txt
  14. comparison.cc
  15. comparison.h
  16. CONTRIBUTING.md
  17. deduplication.cc
  18. deduplication.h
  19. Dockerfile
  20. dwarf_processor.cc
  21. dwarf_processor.h
  22. dwarf_wrappers.cc
  23. dwarf_wrappers.h
  24. elf_dwarf_handle.cc
  25. elf_dwarf_handle.h
  26. elf_loader.cc
  27. elf_loader.h
  28. elf_reader.cc
  29. elf_reader.h
  30. elf_reader_test.cc
  31. equality.h
  32. error.h
  33. error_test.cc
  34. fidelity.cc
  35. fidelity.h
  36. file_descriptor.cc
  37. file_descriptor.h
  38. file_descriptor_test.cc
  39. filter.cc
  40. filter.h
  41. filter_test.cc
  42. fingerprint.cc
  43. fingerprint.h
  44. graph.cc
  45. graph.h
  46. hashing.h
  47. hex.h
  48. hex_test.cc
  49. input.cc
  50. input.h
  51. LICENSE
  52. METADATA
  53. MODULE_LICENSE_LLVM
  54. naming.cc
  55. naming.h
  56. number.cc
  57. number.h
  58. number_test.cc
  59. order.h
  60. order_test.cc
  61. OWNERS
  62. post_processing.cc
  63. post_processing.h
  64. proto_reader.cc
  65. proto_reader.h
  66. proto_writer.cc
  67. proto_writer.h
  68. reader_options.h
  69. README.md
  70. reporting.cc
  71. reporting.h
  72. reporting_test.cc
  73. runtime.cc
  74. runtime.h
  75. runtime_test.cc
  76. scc.h
  77. scc_test.cc
  78. scope.h
  79. scope_test.cc
  80. stable_hash.cc
  81. stable_hash.h
  82. stg.cc
  83. stg.proto
  84. stgdiff.cc
  85. stgdiff_test.cc
  86. substitution.h
  87. type_normalisation.cc
  88. type_normalisation.h
  89. type_resolution.cc
  90. type_resolution.h
  91. unification.cc
  92. unification.h
  93. union_find.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.

The ABI extraction tool, stg, emits a native ABI format. Parsers exist for libabigail's XML format, BTF and ELF / DWARF.

The ABI diff tool, stgdiff, supports multiple reporting options.

STG has a versioned native file format. Older formats can be read and rewritten as the latest.

NOTE: STG is under active development. Tool arguments and behaviour are subject to change.

Getting STG

Distributions

We intend to package STG for major distributions. Currently we have packages as follows:

DistributionPackage
Arch Linux (AUR)stg-git

Source Code

This source code is available at https://android.googlesource.com/platform/external/stg/.

Building from Source

Instructions are included for local and Docker builds.

Dependencies

STG is written in C++20. It is known to compile with GCC 11, Clang 15 or later versions. Minimum requirements for a local build are:

DependencyDebianRedHatVersion
buildcmakecmake3.14
ELF, BTFlibelf-develfutils-devel0.189
DWARFlibdw-develfutils-devel0.189
XMLlibxml2-devlibxml2-devel2.9
BTFlinux-libc-devkernel-headers5.19
native formatlibprotobuf-devprotobuf-devel3.19
native formatprotobuf-compilerprotobuf-compiler3.19
allocator[^1]libjemalloc-devjemalloc-devel5
catch2[^2]catch2catch2-devel2 (only)

[^1]: jemalloc is optional, but will likely improve performance. [^2]: catch2 is optional, but required to build the test suite.

Local Build

Build STG using CMake as follows:

$ mkdir build && cd build
$ cmake ..
$ cmake --build . --parallel

Run the STG unit test suite:

$ ctest

Docker Build

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

$ docker build -t stg .

And then enter the container:

$ docker run -it stg

Note that the Dockerfile provides only a production image. To use Docker as a development environment, you can comment out everything after the line # second stage.

After that you may 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.

Contributions

See CONTRIBUTING.md for details.

Contact Information

Please send feedback, questions and bug reports to kernel-team@android.com.