From Fedora Project Wiki

No edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Introduction ==
== Introduction ==


The <code>abipkgdiff</code> program compares the [https://en.wikipedia.org/wiki/Application_binary_interface ABI] of ELF binaries carried by two versions of a given package. It then emits a textual report that precisely describes the changes that potentially make the ELF binaries ABI incompatible. Note that <code>abipkgdiff</code> analyzes the ABI of the binaries by essentially looking at the debug information accompanying the ELF binaries.
The <code>abipkgdiff</code> program compares the [https://en.wikipedia.org/wiki/Application_binary_interface ABI] of ELF binaries carried by two versions of a given package.
 
It does so by analyzing the content the ELF binaries themselves, including their debug information. It can pinpoint ABI changes, categorize them into harmless and potentially harmful (i.e ABI incompatible) changes, and report about the potentially harmful changes in a way that makes it easy for programmers to understand which part of the source code change induced the ABI change.  
 
Note that abipkgdiff is written using the Libabigail foundation library.


== Requirements ==
== Requirements ==
Line 17: Line 21:
The <code>abipkgdiff</code> program compares the ABIs of ELF binaries contained in two versions of a given package P.  Let's call P1.rpm and P2.rpm the former and later version of packageP.  Please note that <code>abipkgdiff</code> needs the debug information packages of P1 and P2 in order to operate.  Let's call these debug info packages P1-debuginfo.rpm and P2-debuginfo.rpm  You need to have them available locally, just as you do for P1.rpm and P2.rpm
The <code>abipkgdiff</code> program compares the ABIs of ELF binaries contained in two versions of a given package P.  Let's call P1.rpm and P2.rpm the former and later version of packageP.  Please note that <code>abipkgdiff</code> needs the debug information packages of P1 and P2 in order to operate.  Let's call these debug info packages P1-debuginfo.rpm and P2-debuginfo.rpm  You need to have them available locally, just as you do for P1.rpm and P2.rpm


=== Comparing ===
=== Comparing RPMs ===


To compare the ABIs of P1 and P2 here is the command line:
To compare the ABIs of P1 and P2 here is the command line:
Line 26: Line 30:


A report with details of the ABI changes is emitted on the standard output of the command line.
A report with details of the ABI changes is emitted on the standard output of the command line.
=== Comparing binaries stuffed into directories ===
If you have two directories named, for instance, <code>old</code> and <code>new</code>, which contain two versions of the same binaries, then abipkgdiff can compare the ABIs of the different versions of the binaries, assuming <code>old/</code> contains the older versions of the binaries and <code>new/</code> contains the newer versions.  The command line would then be:
<pre>
abipkgdiff old new
</pre>
This can come in handy, especially if <code>old</code> has been populated by typing <code>"make install DESTDIR=/path/to/old"</code> while being in the build directory of the old binary, and if <code>new</code> has been populated by typing <code>"make install DESTDIR=/path/to/new"</code> while being in the build directory of the new binary.


== External links ==
== External links ==


[https://sourceware.org/libabigail/manual/abipkgdiff.html The manual of the abipkgdiff command]
* [https://sourceware.org/libabigail/manual/abipkgdiff.html The manual of the abipkgdiff command]
* [https://sourceware.org/libabigail/ The ABI Generic Analysis and Instrumentation Library]
 
[[Category:ABI]]

Latest revision as of 09:59, 20 November 2015

Introduction

The abipkgdiff program compares the ABI of ELF binaries carried by two versions of a given package.

It does so by analyzing the content the ELF binaries themselves, including their debug information. It can pinpoint ABI changes, categorize them into harmless and potentially harmful (i.e ABI incompatible) changes, and report about the potentially harmful changes in a way that makes it easy for programmers to understand which part of the source code change induced the ABI change.

Note that abipkgdiff is written using the Libabigail foundation library.

Requirements

It is assumed that you already have a development environment setup which can build packages. Other than that all that is required is the package libabigail.

$ sudo yum install libabigail
(or as root)
# yum install libabigail

Procedure

The abipkgdiff program compares the ABIs of ELF binaries contained in two versions of a given package P. Let's call P1.rpm and P2.rpm the former and later version of packageP. Please note that abipkgdiff needs the debug information packages of P1 and P2 in order to operate. Let's call these debug info packages P1-debuginfo.rpm and P2-debuginfo.rpm You need to have them available locally, just as you do for P1.rpm and P2.rpm

Comparing RPMs

To compare the ABIs of P1 and P2 here is the command line:

abipkgdiff --d1 P1-debuginfo.rpm --d2 P2-debuginfo.rpm P1.rpm P2.rpm

A report with details of the ABI changes is emitted on the standard output of the command line.

Comparing binaries stuffed into directories

If you have two directories named, for instance, old and new, which contain two versions of the same binaries, then abipkgdiff can compare the ABIs of the different versions of the binaries, assuming old/ contains the older versions of the binaries and new/ contains the newer versions. The command line would then be:

abipkgdiff old new

This can come in handy, especially if old has been populated by typing "make install DESTDIR=/path/to/old" while being in the build directory of the old binary, and if new has been populated by typing "make install DESTDIR=/path/to/new" while being in the build directory of the new binary.

External links