Operating Systems Compatibility
This tutorial describes how to test operating systems for binary compatibility using the ABI Compliance Checker tool. The tool is able to find all C/C++ libraries and appropriate header files in system directories, create dump of system ABI (API + compiler ABI) including ABIs of all found libraries and then compare dumps created on different operating systems to produce the HTML report containing detailed comparizon results.
Contents |
Setting Up Environment
The first step is to setup development environment on target operating systems:
- Install G++, Perl
- Install all "devel" packages or SDK.
DEB-based Linux (Ubuntu, Debian, Maemo, ...)
apt-get update
apt-cache search "\-dev"|awk '{print $1;}'>install.txt
for i in `cat install.txt`;do apt-get --force-yes -y install $i;done
RPM-based Linux (Fedora, openSUSE, MeeGo, ...)
zypper search -u dev|awk '{print $2;}'|grep 'dev'>install.txt
for i in `cat install.txt`;do zypper -n install $i;done
zypper install gcc-c++
APK-based Linux (Alpine Linux, ...)
apk update
apk search|grep "\-dev\-"|sed s/-dev-.*$/-dev/>install.txt
for i in `cat install.txt`;do apk add $i;done
apk add perl
Other (Symbian, ...)
Download and install an SDK.
Dumping System ABI
The next step is to create an XML-descriptor of target OS (descriptor.xml):
<name> /* Name of the system */ </name> <headers> /* List of directories with header files, one per line. */ </headers> <libs> /* List of directories with shared libraries, one per line. */ </libs> <tools> /* List of directories with tools (gcc, readelf, objdump, c++filt, ...) */ </tools>
Then enter to the target operating system and dump the system ABI using the following command:
perl abi-compliance-checker.pl -dump-system <descriptor.xml>
If you want to analyze libraries from /usr/include and /usr/lib, then you may use the following short command instead:
perl abi-compliance-checker.pl -dump-system <name> -sysroot /
The system ABI dump will be generated to:
sys_dumps/<name>/<arch>/
Repeat this step for other operating system or other version of the same system if you want to check backward compatibility.
Compare ABI Dumps
The last step is to compare ABI dumps of two operating systems:
perl abi-compliance-checker.pl -cmp-systems -d1 sys_dumps/<name1>/<arch> -d2 sys_dumps/<name2>/<arch>
The compatibility report will be generated to:
sys_compat_reports/<name1>_to_<name2>/<arch>/abi_compat_report.html
Examples
See examples for Maemo, MeeGo and Symbian operating systems on this page.