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: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4627
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Michal Berger 2020-10-13 10:03:57 +02:00 committed by Tomasz Zawadzki
parent 44ff994386
commit 5328d922d7

View File

@ -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