abipkgdiff - Linux
Overview
abipkgdiff compares two sets of package interfaces (ABIs) and generates a report on the ABI changes. It’s invaluable for library and application maintainers to detect source- and binary-level incompatibilities.
Syntax
abipkgdiff [options] <pkg1.so> <pkg2.so>
Options/Flags
- -t, –strictness=
: Specify verbosity level (range: 0-2, default: 0). - -a, –all=
: Specify level of symbol matching (range: 0-2, default: 0). - -s, –simple: Print only the most basic ABI changes.
- -f, –file=
: Write output to a file (default: stdout). - -r, –resolution=
: Specify symbol resolution strategy (range: 0-3, default: 0). - -h, –help: Display usage information.
Examples
Comparing two libraries (basic):
abipkgdiff /lib/libnet.so /lib/libnet2.so
Generating a comprehensive report:
abipkgdiff -t 2 -a 2 -r 3 /usr/lib/libfoo.so /opt/libs/libfoo2.so -f report.txt
Common Issues
- Ensure that both input files are ABI-compatible.
- When facing unexpected output, try adjusting the -a or -r options.
- If comparing symbol-heavy libraries, limit the verbosity with -t 0.
Integration
Generating a diff for automatic testing:
pkgA=$(find . -name 'liba.so')
pkgB=$(find . -name 'libb.so')
diff_report=$(mktemp)
abipkgdiff -s -f $diff_report $pkgA $pkgB
# ... Test script continues here, verifying diff_report ...
Related Commands
- objdump
- readelf
- nm