[v2,3/7] devtools: add abi dump generation script

Message ID 20191129171024.56165-4-kevin.laatz@intel.com (mailing list archive)
State Superseded, archived
Headers
Series Add ABI compatibility checks to the meson build |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Kevin Laatz Nov. 29, 2019, 5:10 p.m. UTC
  This patch adds a script to generate ABI dump files. These files will be
required to perform ABI compatibility checks during the build later in the
patchset. This script should be run on a DPDK version with a stable ABI.

Since this is a tool designed for human use, we simplify it to just work
off a whole build directory, taking the parameter of the builddir and
generating the lib|drivers/abi dir. This is hardcoded into the script since
the meson build expects the .dump files in these directories.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 devtools/gen-abi-dump.sh | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100755 devtools/gen-abi-dump.sh
  

Patch

diff --git a/devtools/gen-abi-dump.sh b/devtools/gen-abi-dump.sh
new file mode 100755
index 000000000..ffedef10c
--- /dev/null
+++ b/devtools/gen-abi-dump.sh
@@ -0,0 +1,24 @@ 
+#!/bin/sh
+
+builddir=$1
+
+if [ -z "$builddir" ] ; then
+	echo "Usage: $(basename $0) build_dir"
+	exit 1
+fi
+
+if [ ! -d "$builddir" ] ; then
+	echo "Error: build directory, '$builddir', doesn't exist"
+	exit 1
+fi
+
+for d in lib drivers ; do
+	mkdir -p $d/abi
+
+	for f in $builddir/$d/*.so* ; do
+		test -L "$f" && continue
+
+		libname=$(basename $f)
+		abidw --out-file $d/abi/${libname%.so*}.dump $f || exit 1
+	done
+done