Use the C++20 spaceship operator<=> for comparisons

Now that we have transitioned to C++20, clean up some TODOs by actually
using compiler-generated comparisons, for extra convenience and safety.

PiperOrigin-RevId: 579783775
Change-Id: Idbd4f93c6f4bdaed12a93dfe9ad871d61f7f9acc
3 files changed
tree: a164ce740ac2a0de4c3ed32cdf9a844e63f67b3f
  1. cmake/
  2. doc/
  3. fuzz/
  4. testdata/
  5. abigail_reader.cc
  6. abigail_reader.h
  7. abigail_reader_test.cc
  8. btf_reader.cc
  9. btf_reader.h
  10. catch.cc
  11. CMakeLists.txt
  12. comparison.cc
  13. comparison.h
  14. CONTRIBUTING.md
  15. deduplication.cc
  16. deduplication.h
  17. Dockerfile
  18. dwarf_processor.cc
  19. dwarf_processor.h
  20. dwarf_wrappers.cc
  21. dwarf_wrappers.h
  22. elf_loader.cc
  23. elf_loader.h
  24. elf_reader.cc
  25. elf_reader.h
  26. elf_reader_test.cc
  27. equality.h
  28. equality_cache.h
  29. error.h
  30. error_test.cc
  31. fidelity.cc
  32. fidelity.h
  33. file_descriptor.cc
  34. file_descriptor.h
  35. file_descriptor_test.cc
  36. filter.cc
  37. filter.h
  38. filter_test.cc
  39. fingerprint.cc
  40. fingerprint.h
  41. graph.cc
  42. graph.h
  43. hashing.h
  44. input.cc
  45. input.h
  46. LICENSE
  47. METADATA
  48. metrics.cc
  49. metrics.h
  50. metrics_test.cc
  51. MODULE_LICENSE_LLVM
  52. naming.cc
  53. naming.h
  54. order.h
  55. order_test.cc
  56. OWNERS
  57. post_processing.cc
  58. post_processing.h
  59. proto_reader.cc
  60. proto_reader.h
  61. proto_writer.cc
  62. proto_writer.h
  63. reader_options.h
  64. README.md
  65. reporting.cc
  66. reporting.h
  67. reporting_test.cc
  68. scc.h
  69. scc_test.cc
  70. scope.h
  71. stable_hash.cc
  72. stable_hash.h
  73. stg.cc
  74. stg.proto
  75. stgdiff.cc
  76. stgdiff_test.cc
  77. stginfo.cc
  78. substitution.h
  79. type_normalisation.cc
  80. type_normalisation.h
  81. type_resolution.cc
  82. type_resolution.h
  83. unification.cc
  84. unification.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

STG can be built with CMake as follows:

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

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.