• Home
Name Date Size #Lines LOC

..--

cmake/04-Jul-2025-375305

doc/04-Jul-2025-1,9441,435

fuzz/04-Jul-2025-18580

test_cases/04-Jul-2025-34,70131,830

testdata/04-Jul-2025-2,0581,874

Android.bpD04-Jul-20252.6 KiB120112

CMakeLists.txtD04-Jul-20254.5 KiB170140

CONTRIBUTING.mdD04-Jul-2025150 53

DockerfileD04-Jul-20251.5 KiB5553

LICENSED04-Jul-202512 KiB220182

METADATAD04-Jul-2025692 2018

MODULE_LICENSE_LLVMD04-Jul-20250

OWNERSD04-Jul-202540 32

README.mdD04-Jul-20253.1 KiB11074

abigail_reader.ccD04-Jul-202546.9 KiB1,4301,058

abigail_reader.hD04-Jul-20251.5 KiB5223

abigail_reader_test.ccD04-Jul-20257 KiB233193

btf_reader.ccD04-Jul-202516.5 KiB473377

btf_reader.hD04-Jul-20251.1 KiB4013

catch.ccD04-Jul-2025205 102

comparison.ccD04-Jul-202531.6 KiB981710

comparison.hD04-Jul-20253.2 KiB12982

deduplication.ccD04-Jul-20253.2 KiB11379

deduplication.hD04-Jul-20251 KiB3811

dwarf_processor.ccD04-Jul-202539.5 KiB1,085804

dwarf_processor.hD04-Jul-20251.6 KiB6128

dwarf_wrappers.ccD04-Jul-202513.6 KiB447331

dwarf_wrappers.hD04-Jul-20253.6 KiB11053

elf_dwarf_handle.ccD04-Jul-20253.2 KiB10869

elf_dwarf_handle.hD04-Jul-20251.6 KiB6230

elf_loader.ccD04-Jul-202517.7 KiB546430

elf_loader.hD04-Jul-20252.4 KiB10063

elf_reader.ccD04-Jul-202518.2 KiB503361

elf_reader.hD04-Jul-20252.2 KiB6939

elf_reader_test.ccD04-Jul-20251.6 KiB5730

equality.hD04-Jul-20258 KiB252181

equality_cache.hD04-Jul-20257.6 KiB270211

error.hD04-Jul-20252.6 KiB12682

error_test.ccD04-Jul-2025970 3611

fidelity.ccD04-Jul-20256.9 KiB260201

fidelity.hD04-Jul-20252.3 KiB8952

file_descriptor.ccD04-Jul-20251.4 KiB5625

file_descriptor.hD04-Jul-20251.4 KiB5222

file_descriptor_test.ccD04-Jul-20251.7 KiB6936

filter.ccD04-Jul-20257.9 KiB295224

filter.hD04-Jul-20251.2 KiB4515

filter_test.ccD04-Jul-20253.3 KiB12294

fingerprint.ccD04-Jul-20256.4 KiB256184

fingerprint.hD04-Jul-20251.3 KiB4211

graph.ccD04-Jul-20254.6 KiB162120

graph.hD04-Jul-202524.2 KiB804673

hashing.hD04-Jul-20253.4 KiB12875

hex.hD04-Jul-20251.5 KiB5829

hex_test.ccD04-Jul-20251.6 KiB7041

input.ccD04-Jul-20252.2 KiB7951

input.hD04-Jul-20251.1 KiB4013

naming.ccD04-Jul-20258.8 KiB345253

naming.hD04-Jul-20252.1 KiB8044

order.hD04-Jul-20257.3 KiB22581

order_test.ccD04-Jul-20259.3 KiB288224

post_processing.ccD04-Jul-20257.9 KiB255201

post_processing.hD04-Jul-2025953 338

proto_reader.ccD04-Jul-202517.1 KiB531453

proto_reader.hD04-Jul-20251 KiB3913

proto_writer.ccD04-Jul-202520.2 KiB619522

proto_writer.hD04-Jul-20251.1 KiB4216

reader_options.hD04-Jul-20251.3 KiB5626

reporting.ccD04-Jul-202514.9 KiB472369

reporting.hD04-Jul-20251.5 KiB6129

reporting_test.ccD04-Jul-20252.6 KiB7850

runtime.ccD04-Jul-20252.2 KiB8148

runtime.hD04-Jul-20252.4 KiB11677

runtime_test.ccD04-Jul-20253 KiB12597

scc.hD04-Jul-20254.7 KiB14157

scc_test.ccD04-Jul-20255.4 KiB205144

scope.hD04-Jul-20251.6 KiB6738

scope_test.ccD04-Jul-20251.4 KiB5933

stable_hash.ccD04-Jul-20256.3 KiB203143

stable_hash.hD04-Jul-20251.1 KiB4316

stg.ccD04-Jul-20257.4 KiB246212

stg.protoD04-Jul-20256.5 KiB296259

stgdiff.ccD04-Jul-20258.4 KiB268226

stgdiff_test.ccD04-Jul-202511.4 KiB371315

substitution.hD04-Jul-20253.6 KiB15597

type_normalisation.ccD04-Jul-20255.8 KiB232164

type_normalisation.hD04-Jul-2025916 327

type_resolution.ccD04-Jul-20256.4 KiB248186

type_resolution.hD04-Jul-20251 KiB3711

unification.ccD04-Jul-202510.9 KiB369280

unification.hD04-Jul-20251.5 KiB6024

README.md

1# Symbol-Type Graph (STG)
2
3The STG (symbol-type graph) is an ABI representation and this
4project contains tools for the creation and comparison of such
5representations.
6
7The ABI extraction tool, `stg`, emits a native ABI format. Parsers exist for
8libabigail's XML format, BTF and ELF / DWARF.
9
10The ABI diff tool, `stgdiff`, supports multiple reporting options.
11
12STG has a versioned native file format. Older formats can be read and
13rewritten as the latest.
14
15NOTE: STG is under active developement. Tool arguments and behaviour are
16subject to change.
17
18## Getting STG
19
20### Distributions
21
22We intend to package STG for major distributions. Currently we have
23packages as follows:
24
25| *Distribution*   | *Package*                                             |
26| ---------------- | ----------------------------------------------------- |
27| Arch Linux (AUR) | [stg-git](https://aur.archlinux.org/packages/stg-git) |
28
29### Source Code
30
31This source code is available at
32https://android.googlesource.com/platform/external/stg/.
33
34## Building from Source
35
36Instructions are included for local and Docker builds.
37
38### Dependencies
39
40STG is written in C++20. It is known to compile with GCC 11, Clang 15 or
41later versions. Mininum requirements for a local build are:
42
43| *Dependency*  | *Debian*          | *RedHat*          | *Version* |
44| ------------- | ----------------- | ----------------- | --------- |
45| build         | cmake             | cmake             | 3.14      |
46| ELF, BTF      | libelf-dev        | elfutils-devel    | 0.189     |
47| DWARF         | libdw-dev         | elfutils-devel    | 0.189     |
48| XML           | libxml2-dev       | libxml2-devel     | 2.9       |
49| BTF           | linux-libc-dev    | kernel-headers    | 5.19      |
50| native format | libprotobuf-dev   | protobuf-devel    | 3.19      |
51| native format | protobuf-compiler | protobuf-compiler | 3.19      |
52| allocator[^1] | libjemalloc-dev   | jemalloc-devel    | 5         |
53| catch2[^2]    | catch2            | catch2-devel      | 2 (only)  |
54
55[^1]: jemalloc is optional, but will likely improve performance.
56[^2]: catch2 is optional, but required to build the test suite.
57
58### Local Build
59
60Build STG using CMake as follows:
61
62```bash
63$ mkdir build && cd build
64$ cmake ..
65$ cmake --build . --parallel
66```
67
68Run the STG unit test suite:
69
70```bash
71$ ctest
72```
73
74### Docker Build
75
76A [Dockerfile](Dockerfile) is provided to build a container with the
77STG tools:
78
79```bash
80$ docker build -t stg .
81```
82
83And then enter the container:
84
85```bash
86$ docker run -it stg
87```
88
89Note that the Dockerfile provides only a production image. To use
90Docker as a development environment, you can comment out everything
91after the line `# second stage`.
92
93After that you may bind your development code to the container:
94
95```bash
96$ docker run -it $PWD:/src -it stg
97```
98
99The source code is added to `/src`, so when your code is bound you can
100edit on your host and re-compile in the container.
101
102## Contributions
103
104See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
105
106## Contact Information
107
108Please send feedback, questions and bug reports to
109[kernel-team@android.com](mailto:kernel-team@android.com).
110