Commit 9ad5ba22 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

check_so_deps: suppress types only for single SO_VER



Suppressing types with libabigail is a manual process,
that should be used with care. Otherwise ABI changes
might be missed or ignored.

Main requirement going forward should be to specify
name of the type and specific SO_VER of the library,
when adding new suppression.
Just with this change, the suppress type entry can be
removed at any later time. Rather than keep up with
SO_VER changes.

This leaves a gap during that specific SO_VER.
Where ABI breaking change could be introduced, but would
be ignored due to the suppression.
There are more specific ways to limit the scope of the
suppressions. Most useful ones are has_data_member_*,
where a name of removed field or offset of the field
can be specified. The more specific the better chances
of catching just that change.
Please refer to libabigail manual for [suppress_type].

Three examples in this patch are:
- spdk_app_opts, where reserved185 field name was removed
and new member inserted between 1480-1488 bits
- spdk_nvme_cap_register, where due to limitations of
libabigail it was not possible to refer to change in
bits part of the union and narrow down this suppression
- spdk_bdev_opts, where reserved field name was removed
and new members inserted at 192-224 bits.

As the second example shows, this should be best effort.

Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I8d9bb0fcc4d305426ee1b03d9c43ad20d299ae51
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20544


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent bd7c9e07
Loading
Loading
Loading
Loading
+25 −1
Original line number Diff line number Diff line
@@ -116,16 +116,40 @@ function confirm_abi_deps() {
		return 1
	fi

	# suppressed types should go here, in the format:
	# Type suppression should be used for deliberate change in the structure,
	# that do not affect the ABI compatibility.
	# One example is utilizing a previously reserved field in the structure.
	# Suppression file should contain at the very least the name of type
	# and point to major SO_VER of the library it applies to.
	#
	# To avoid ignoring an actual changes in ABI for a particular SO_VER,
	# the suppression should be as specific as possible to the change.
	# has_data_member_* conditions can be used to narrow down the
	# name of previously existing field, or specify the offset.
	# Please refer to libabigail for details.
	#
	# Example format:
	# [suppress_type]
	#	label = Added interrupt_mode field
	#	name = spdk_app_opts
	#	soname_regexp = ^libspdk_event\\.so\\.12\\.*$
	cat << EOF > ${suppression_file}
[suppress_type]
	label = Added interrupt_mode field
	name = spdk_app_opts
	soname_regexp = ^libspdk_event\\.so\\.12\\.*$
	has_data_member_regexp = ^reserved185$
	has_data_member_inserted_between = {1480, 1488}
[suppress_type]
	label = Added cmbs field
	name = spdk_nvme_cap_register
	soname_regexp = ^libspdk_nvme\\.so\\.11\\.*$
[suppress_type]
	label = Added iobuf_small/large_cache_size fields
	name = spdk_bdev_opts
	soname_regexp = ^libspdk_bdev\\.so\\.13\\.*$
	has_data_member_regexp = ^reserved$
	has_data_member_inserted_between = {192, 224}
EOF

	for object in "$libdir"/libspdk_*.so; do