仓库:https://gitee.com/openeuler/abichecker
依赖:abi-dumper、abi-compliance-checker
用法:
python3 abichecker.py PKGNAME DIR
举例:
下面以 musl 包为例,检测 1.2.2 和 1.2.3 两个版本之间的差异:
1)准备两个版本的 rpm 包
通过osc getbinaries --debug ...
获取 obs 服务器上的两个版本的 rpm 包
$ osc getbinaries --debug openEuler:22.03:LTS musl standard_x86_64 x86_64
$ osc getbinaries --debug home:maminjie:branches:openEuler:22.03:LTS musl-1.2.2 standard_x86_64 x86_64
$ ls -1 binaries/
_buildenv
musl-debuginfo-1.2.2-2.oe2203.x86_64.rpm
musl-debuginfo-1.2.3-1.oe2203.x86_64.rpm
musl-debugsource-1.2.2-2.oe2203.x86_64.rpm
musl-debugsource-1.2.3-1.oe2203.x86_64.rpm
musl-devel-1.2.2-2.oe2203.x86_64.rpm
musl-devel-1.2.3-1.oe2203.x86_64.rpm
musl-gcc-1.2.2-2.oe2203.x86_64.rpm
musl-gcc-1.2.3-1.oe2203.x86_64.rpm
musl-libc-1.2.2-2.oe2203.x86_64.rpm
musl-libc-1.2.3-1.oe2203.x86_64.rpm
musl-libc-static-1.2.2-2.oe2203.x86_64.rpm
musl-libc-static-1.2.3-1.oe2203.x86_64.rpm
_statistics
2)重命名
将 binaries 目录重命名为 musl
$ cp -r binaries musl
3)执行 abichecker
$ python3 ~/work/my/abichecker/abichecker.py musl ~/work/tmp/
...
Creating ABI dump
The object ABI has been dumped to:
ABI-ld-musl.so.dump
Preparing, please wait ...
Comparing ABIs ...
Comparing APIs ...
Creating compatibility report ...
Binary compatibility: 99.96%
Source compatibility: 99.9%
Total binary compatibility problems: 3, warnings: 1
Total source compatibility problems: 6, warnings: 1
Report: compat_reports/ld-musl.so/X_to_Y/compat_report.html
Preparing, please wait ...
Comparing ABIs ...
Comparing APIs ...
Creating compatibility report ...
Binary compatibility: 99.96%
Source compatibility: 99.9%
Total binary compatibility problems: 3, warnings: 1
Total source compatibility problems: 6, warnings: 1
Report: compat_reports/ld-musl.so/X_to_Y/compat_report.html
更多关于 abi-dumper、abi-compliance-checker 的使用可以参考 ABI 。