Commit 5328d922 authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

make/check_so_deps: Tell readelf to use wide output



Newer versions of readelf (e.g. from binutils v2.35) break the lines
in the following manner:

.... GLOBAL DEFAULT   14 restore_funcarra[...]

The symbol name is shortened, however, the way how it's indicated
with "[...]" may mess with any tools that look up this field with a
regex pattern - just like grep in the confirm_deps() test.

Currently, this test fails on clearlinux where the latest readelf
is shipped on board. To avoid it, make sure readelf returns full
name of the symbol with the --wide output.

Change-Id: Ief1a3dccde5481f603302ee714021dcebc20fc58
Signed-off-by: default avatarMichal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4627


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 44ff9943
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -204,13 +204,13 @@ function confirm_deps() {
		done
	done

	symbols=$(readelf -s $lib | grep -E "NOTYPE.*GLOBAL.*UND" | awk '{print $8}' | sort | uniq)
	symbols=$(readelf -s --wide $lib | grep -E "NOTYPE.*GLOBAL.*UND" | awk '{print $8}' | sort | uniq)
	for symbol in $symbols; do
		for deplib in $DEP_LIBS; do
			if [ "$deplib" == "$lib" ]; then
				continue
			fi
			found_symbol=$(readelf -s $deplib | grep -E "DEFAULT\s+[0-9]+\s$symbol$") || true
			found_symbol=$(readelf -s --wide $deplib | grep -E "DEFAULT\s+[0-9]+\s$symbol$") || true
			if [ "$found_symbol" != "" ]; then
				found_symbol_lib=$(basename $deplib | sed 's,libspdk_,,g' | sed 's,\.so,,g')
				break