ABI-COMPLIANCE-CHECKER(1)
okay bestie, welcome to the abi-compliance-checker(1) manual page (User Commands) π let's get into it π«Ά
β¨ NAME β¨
abi-compliance-checker is a tool to compare ABI compatibility of shared C/C++ library versions π¦
β¨ DESCRIPTION β¨
β¨ NAME: β¨
ABI Compliance Checker (abi-compliance-checker) is all about checking backward compatibility of a C/C++ library API π
β¨ DESCRIPTION: β¨
okay so ABI Compliance Checker (ABICC) is a tool for checking backward binary compatibility and backward source compatibility of a C/C++ library API β¨
It analyzes changes in API and ABI (ABI=API+compiler ABI) that could break binary compatibility and/or source compatibility. We're talking changes in calling stack, v-table changes, removed symbols, renamed fields, etc. π
Binary incompatibility can make applications built with an old version of a library crash or behave incorrectly if they run on a new one π Source incompatibility can cause recompilation errors with a new library version π
The tool can create and compare ABI dumps for header files and shared objects of a library. The ABI dump for a library can also be created by the ABI Dumper tool (https://github.com/lvc/abi-dumper) if shared objects include debug-info πΈ
This tool is for developers of software libraries and maintainers of operating systems who care about backward compatibility, meaning old applications can still run or be recompiled with newer library versions π§
The tool can also be used by ISVs to check application portability to new library versions. Found issues can be taken into account when adapting the application to a new library version π
This tool is free software: you can redistribute it and/or modify it under the terms of the GNU LGPL 2.1 π
β¨ USAGE #1 (WITH ABI DUMPER): β¨
- Compile the library with
"-g -Og"GCC options so it contains DWARF debug info π₯ - Create ABI dumps for both library versions using the ABI Dumper (
https://github.com/lvc/abi-dumper) tool:
abi-dumper OLD.so -o ABI-0.dump -lver 0
abi-dumper NEW.so -o ABI-1.dump -lver 1
- You can filter the public ABI with the help of the additional
-public-headersoption of the ABI Dumper tool π¦ - Compare the ABI dumps to create a report:
abi-compliance-checker -l NAME -old ABI-0.dump -new ABI-1.dump
β¨ USAGE #2 (ORIGINAL): β¨
- Create XML-descriptors for two versions of a library (
OLD.xmlandNEW.xml) that look like this:
<version>
1.0
</version>
<headers>
/path/to/headers/
</headers>
<libs>
/path/to/libraries/
</libs>
- Compare the XML-descriptors to create a report:
abi-compliance-checker -lib NAME -old OLD.xml -new NEW.xml
β¨ USAGE #3 (CREATE ABI DUMPS): β¨
- Create XML-descriptors for two versions of a library (
OLD.xmlandNEW.xml) using the same format as above:
<version>
1.0
</version>
<headers>
/path/to/headers/
</headers>
<libs>
/path/to/libraries/
</libs>
- Create the ABI dumps:
abi-compliance-checker -lib NAME -dump OLD.xml -dump-path ./ABI-0.dump
abi-compliance-checker -lib NAME -dump NEW.xml -dump-path ./ABI-1.dump
- Compare the ABI dumps to create a report:
abi-compliance-checker -l NAME -old ABI-0.dump -new ABI-1.dump
β¨ INFO OPTIONS β¨
-h|-helpβ Print this help, bestie π-i|-infoβ Print complete info, including all options π-v|-versionβ Print version information π-dumpversionβ Print the tool version (2.3) and don't do anything else π
β¨ GENERAL OPTIONS β¨
-l|-libraryNAME β Any name of the library πΈ-old|-d1PATH β The descriptor of the 1st (old) library version. It can be one of the following types β¨
- ABI dump generated by the ABI Dumper tool
- XML-descriptor (
*.xmlfile), which looks like this:
<version>
1.0
</version>
<headers>
/path1/to/header(s)/ /path2/to/header(s)/
...
</headers>
<libs>
/path1/to/library(ies)/ /path2/to/library(ies)/
...
</libs>
...
- ABI dump generated by the
-dumpoption - Directory with headers and libraries
- Single header file
If you're using descriptor types 4-5, you should specify version numbers with -v1 and -v2 options π
For more information, please see: https://lvc.github.io/abi-compliance-checker/Xml-Descriptor.html π§
-new|-d2PATH β The descriptor of the 2nd (new) library version π-dumpPATH β Create a library ABI dump for the input XML descriptor. You can transfer it anywhere and pass it instead of the descriptor. It can also be used for debugging the tool π«Ά-filterPATH β A path to an XML descriptor withskip_*rules to filter analyzed symbols in the report π
β¨ EXTRA OPTIONS β¨
-debugβ Debugging mode, periodt π₯ Prints debug info on the screen and saves intermediate analysis stages in the debug directory:debug/LIB_NAME/VERSION/Also consider using the-dumpoption for debugging the tool π-ext|-extendedβ If your library A is supposed to be used by other library B and you want to control the ABI of B, then enable this option π The tool will check for changes in all data types, even if they aren't used by any function in library A. Those data types aren't part of the A library ABI, but they may be part of the ABI of the B library π The short scheme is:
app C (broken) -> lib B (broken ABI) -> lib A (stable ABI)
-staticβ Check static libraries instead of shared ones. The<libs>section of the XML-descriptor should point to the static libraries location π¦-gcc-pathPATH β Path to the cross GCC compiler to use instead of the usual (host) GCC π§-gcc-prefixPREFIX β GCC toolchain prefix π-gcc-optionsOPTS β Additional compiler options π-count-symbolsPATH β Count the total public symbols in the ABI dump π-use-dumpsβ Make dumps for two versions of a library and compare the dumps. This should boost the tool's performance and decrease system memory usage β-xmlβ Alias for:--report-format=xmlor--dump-format=xmlπ-app|-applicationPATH β Specify the application that should be checked for portability to the new library version π-headers-onlyβ Check header files without libraries. It's easy to run, but it may provide a low quality compatibility report with false positives and without detecting added/removed symbols π
Heads up: the -headers-only report can be low quality, with false positives, and it won't detect added or removed symbols. Use it knowing that π
-v1|-vnum1NUM β Specify the 1st library version outside the descriptor. You need this if you've preferred an alternative descriptor type (see-d1option). In the general case, you should specify it in the XML-descriptor:
<version>
VERSION
</version>
-v2|-vnum2NUM β Specify the 2nd library version outside the descriptor πΈ-relpath1PATH β Replace{RELPATH}macros with PATH in the 1st XML-descriptor (-d1) π§-relpath2PATH β Replace{RELPATH}macros with PATH in the 2nd XML-descriptor (-d2) π
β¨ TEST OPTIONS β¨
-testβ Run internal tests. This creates two binary incompatible versions of a sample library and runs the tool to check them for compatibility. It's a good way to see whether the tool works correctly in your current environment π₯-test-dumpβ Test the ability to create, read, and compare ABI dumps π¦-test-abi-dumperβ Compare ABI dumps created by the ABI Dumper tool π
β¨ REPORT OPTIONS β¨
-binary|-bin|-abiβ Show binary compatibility problems only. The report is generated tocompat_reports/LIB_NAME/V1_to_V2/abi_compat_report.htmlπ-source|-src|-apiβ Show source compatibility problems only. The report is generated tocompat_reports/LIB_NAME/V1_to_V2/src_compat_report.htmlπ«Ά-s|-strictβ Treat all compatibility warnings as problems. This adds a number of "Low" severity problems to the return value of the tool π
β¨ REPORT PATH OPTIONS β¨
-report-pathPATH β Path to the compatibility report. Default:compat_reports/LIB_NAME/V1_to_V2/compat_report.htmlπ-bin-report-pathPATH β Path to the binary compatibility report. Default:compat_reports/LIB_NAME/V1_to_V2/abi_compat_report.htmlπ-src-report-pathPATH β Path to the source compatibility report. Default:compat_reports/LIB_NAME/V1_to_V2/src_compat_report.htmlπΈ
β¨ REPORT FORMAT OPTIONS β¨
-show-retvalβ Show the symbol's return type in the report β¨-stdoutβ Print analysis results (compatibility reports and ABI dumps) to stdout instead of creating a file. This lets you pipe the data to other programs π§-report-formatFMT β Change the format of the compatibility report. Formats:htmβ HTML format (default)xmlβ XML format
-old-styleβ Generate an old-style report π-titleNAME β Change the library name in the report title to NAME. By default, the name specified by the-loption is displayed π-componentNAME β The component name in the title and summary of the HTML report. Default:libraryπ¦-p|-paramsPATH β Path to a file with the function parameter names. It can improve the report view if the library header files have no parameter names. File format:
func1;param1;param2;param3 ... func2;param1;param2;param3 ...
...
-limit-affectedLIMIT β The maximum number of affected symbols listed under the description of the changed type in the report π-list-affectedβ Generate a file with the list of incompatible symbols beside the HTML compatibility report. Usec++filt @filefrom GNU binutils to unmangle C++ symbols in the generated file. Default names:abi_affected.txtandsrc_affected.txtπ
β¨ ABI DUMP OPTIONS β¨
-dump-pathPATH β Specify a*.dumpfile path where the ABI dump will be generated. Default:abi_dumps/LIB_NAME/VERSION/ABI.dumpπ-dump-formatFMT β Change the format of the ABI dump. Formats:perl, the Data::Dumper format and the default one πxml, the XML format π«Ά-check, checks completeness of the ABI dump π-extra-info DIR, dumps extra info intoDIRπ-extra-dump, makes an extended ABI dump with all symbols from the translation unit β¨-relpath PATH, swaps every{RELPATH}macro forPATHin the XML descriptor used for dumping the library ABI (see-dumpoption) π¦-vnum NUM, sets the library version in the generated ABI dump. Heads up, the<version>section of the input XML descriptor gets overwritten in this case β οΈ-sort, turns on sorting of data in ABI dumps ποΈ
β¨ FILTER SYMBOLS OPTIONS β¨
-symbols-list PATH, a file with a list of symbols (mangled names in C++) that should be checked. Everything else is skipped π―-types-list PATH, a file with a list of types that should be checked. Other types won't be checked π-skip-symbols PATH, the list of symbols that should not be checked π-skip-types PATH, the list of types that should not be checked π-skip-internal-symbols PATTERN, don't check symbols matched by the regular expression π§-skip-internal-types PATTERN, don't check types matched by the regular expression. It gets matched against full qualified type names (e.g.struct xyz::Name<T>), and it only has to match any part of the type name π-keep-cxx, checks_ZS*,_ZNS*and_ZNKS*symbols π-keep-reserved, reports changes in reserved fields π₯
β¨ FILTER HEADERS OPTIONS β¨
-skip-headers PATH, the file with the list of header files that should not be checked π ββοΈ-headers-list PATH, the file with a list of headers that should be checked/dumped π-header NAME, check/dump the ABI of this header only π―-nostdinc, don't search GCC standard system directories for header files π«-tolerance LEVEL, applies a set of heuristics so the input header files compile successfully. You can turn on several tolerance levels by joining them into one string (e.g.13,124, etc.). The levels are:1, skip non-Linux headers (e.g.win32_*.h, etc.)2, skip internal headers (e.g.*_p.h,impl/*.h, etc.)3, skip headers that include non-Linux headers4, skip headers included by others
-tolerant, enables the highest tolerance level[1234]π-skip-unidentified, skips header files in theheadersandinclude_preamblesections of the XML descriptor that can't be found. This is super useful if you're using the same descriptor for different targets πΈ
β¨ FILTER RULES OPTIONS β¨
-skip-typedef-uncover, doesn't report a problem if a type is covered or uncovered by a typedef (useful for broken debug info) π€·ββοΈ-check-private-abi, checks data types from the private part of the ABI when comparing ABI dumps created by the ABI Dumper tool with the-public-headersoption π
Requires ABI Dumper >= 0.99.14 β οΈ
-disable-constants-check, don't check for changes in constants π΄-skip-added-constants, don't detect added constants π«-skip-removed-constants, don't detect removed constants π«
β¨ OTHER OPTIONS β¨
-lang LANG, sets the library language (C or C++). Use this if the tool can't auto-detect the language. It can be handy for checking C library headers (--lang=C) in--headers-onlyor--extendedmodes π-arch ARCH, sets the library architecture (x86, x86_64, ia64, arm, ppc32, ppc64, s390, ect.). This comes in clutch if the tool can't detect the correct architecture of the input objects π¦Ύ-mingw-compatible, if the input header files are compatible with the MinGW GCC compiler, tell the tool so it can speed up the analysis πββοΈ-cxx-incompatible, set this if the input C header files use C++ keywords. The tool will try to swap those keywords out at the preprocessor stage and put them back in the final TU dump π-cpp-compatible, does nothing. Literally nothing π«-quick, quick analysis. Disables checking of some template instances β‘-force, try enabling this if the tool didn't check all the types and symbols in the header files πͺ
β¨ OS ANALYSIS OPTIONS β¨
-dump-system NAME -sysroot DIR, finds all the shared libraries and header files in theDIRdirectory, creates XML descriptors, and makes ABI dumps for each library. The result set can be compared (--cmp-systems) with another one made for a different version of the operating system, to check them for compatibility. Don't forget the-cross-gccoption if your target system needs a specific version of GCC (different from the host GCC) π₯οΈ
The system ABI dump gets generated to:
sys_dumps/NAME/ARCH
-dump-system DESCRIPTOR.xml, the same as the previous option, but it takes an XML descriptor of the target system as input. This is where you describe your system, like so:
/* Primary sections */
<name>
/* Name of the system */
</name>
<headers>
/* The list of paths to header files and/or
directories with header files, one per line */
</headers>
<libs>
/* The list of paths to shared libraries and/or
directories with shared libraries, one per line */
</libs>
/* Optional sections */
<search_headers>
/* List of directories to be searched
for header files to automatically generate include paths, one per
line */
</search_headers>
<search_libs>
/* List of directories to be searched
for shared libraries to resolve dependencies, one per line */
</search_libs>
<tools>
/* List of directories with tools used
for analysis (GCC toolchain), one per line */
</tools>
<cross_prefix>
/* GCC toolchain prefix.
Examples:
arm-linux-gnueabi arm-none-symbianelf */
</cross_prefix>
<gcc_options>
/* Additional GCC options, one per line */
</gcc_options>
-cmp-systems -d1 sys_dumps/NAME1/ARCH -d2 sys_dumps/NAME2/ARCH, compares two ABI dumps of a system. It creates compatibility reports for each system library, plus a common HTML report with the summary of test results for all checked libraries π₯
The summary report gets generated to:
sys_compat_reports/NAME1_to_NAME2/ARCH
-sysroot DIR, specifies an alternative root directory. The tool will search for include paths inDIR/usr/includeandDIR/usr/libπ-sysinfo DIR, use this with the-dump-systemoption to dump the ABI of operating systems and configure the dumping process βοΈ-libs-list PATH, a file with a list of libraries that should be dumped by the-dump-systemoption or checked by the-cmp-systemsoption π
β¨ LOGGING OPTIONS β¨
-log-path PATH, the log path for all messages. Default:logs/LIB_NAME/VERSION/log.txtπ-log1-path PATH, the log path for the 1st version of a library. Default:logs/LIB_NAME/V1/log.txtπ-log2-path PATH, the log path for the 2nd version of a library. Default:logs/LIB_NAME/V2/log.txtπ-logging-mode MODE, changes the logging mode. Modes:w, overwrite old logs (default)a, append to old logsn, don't write any logs
-q|-quiet, prints all messages to the file instead of stdout and stderr. Default path (can be changed with the-log-pathoption):logs/run.logπ€«
β¨ REPORT PATH β¨
The compatibility report gets generated to:
compat_reports/LIB_NAME/V1_to_V2/compat_report.html
β¨ LOG PATH β¨
The log gets generated to:
logs/LIB_NAME/V1/log.txt
logs/LIB_NAME/V2/log.txt
β¨ EXIT CODES β¨
0, compatible. The tool ran without any errors π₯³non-zero, incompatible, or the tool ran with errors π
β¨ MORE INFO β¨
https://lvc.github.io/abi-compliance-checker/πhttps://github.com/lvc/abi-compliance-checkerπ
β¨ AUTHOR β¨
This manual page was written by Mathieu Malaterre <malat@debian.org> for the Debian GNU/Linux system (but may be used by others). π«Ά
Written by Andrey Ponomarenko. π
π COPYRIGHT π
Copyright Β© 2018 Andrey Ponomarenko's ABI Laboratory. License: GNU LGPL 2.1 <http://www.gnu.org/licenses/>. This program is free software: you can redistribute it and/or modify it. π
And that's the whole page, bestie! π This manual is from the ABI Compliance Checker (ABICC) project, dated February 2023. Go forth and check those ABIs, you're literally unstoppable π β¨
π¦ where this page comes from
- debian bookworm: abi-compliance-checker 2.3-2 Β· LGPL-2.1-or-later
- ubuntu noble: abi-compliance-checker 2.3-2 Β· LGPL-2.1-or-later
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms