Commit d736ac40 authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

check_so_deps: remove the SPDK_NO_LIB_DEPS variable



This variable used to control whether the dependencies of a .so library
were listed during linking.  But the way confirm_makefile_deps() works
is it builds a list of dependencies by going through each undefined
symbol in a library, finding the library that defines that symbol, and
then comparing that list to the list from mk/spdk.lib_deps.mk.  It
doesn't matter whether any of those libraries were linked in or not.

The only difference, in terms of confirm_makefile_deps(), setting this
variable makes is that the undefined symbols have their type filled in
properly:

w/o SPDK_NO_LIB_DEPS:
Num:    Value          Size Type    Bind   Vis      Ndx Name
  0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
  1: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND spdk_dif_ctx_set_data_offset
  2: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND spdk_bdev_comparev_and_writev_blocks
  3: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND spdk_bdev_queue_io_wait
  4: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND free@GLIBC_2.2.5 (2)
  ...

w/ SPDK_NO_LIB_DEPS=1:
Num:    Value          Size Type    Bind   Vis      Ndx Name
  0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
  1: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND spdk_dif_ctx_set_data_offset
  2: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND spdk_bdev_comparev_and_writev_blocks
  3: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND spdk_bdev_queue_io_wait
  4: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND free@GLIBC_2.2.5 (2)
  ...

It required a slight modification to the way we search for the undefined
symbols, but it actually ended up making it a bit simpler.

Another advantage of this change is that it's now possible to run this
test without having to rebuild everything with SPDK_NO_LIB_DEPS=1.

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I62c13c7328f9593480c09b858cf575bf621b62eb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20846


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 8bc25e17
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -53,9 +53,7 @@ else
BUILD_DEP := $(DEP)
endif

ifeq ($(SPDK_NO_LIB_DEPS),)
SPDK_DEP_LIBS = $(call spdk_lib_list_to_shared_libs,$(DEPDIRS-$(LIBNAME)))
endif

ifeq ($(CXX_SRCS),)
COMPILER=$(CC)
+2 −4
Original line number Diff line number Diff line
@@ -310,7 +310,7 @@ function confirm_deps() {
	lib_shortname=$(get_lib_shortname "$lib")
	lib_make_deps=(${!lib_shortname})

	symbols=($(readelf -s --wide "$lib" | grep -E "NOTYPE.*GLOBAL.*UND" | awk '{print $8}' | sort -u))
	symbols=($(readelf -s --wide "$lib" | awk '$7 == "UND" {print $8}' | sort -u))
	symbols_regx=$(
		IFS="|"
		echo "(${symbols[*]})"
@@ -378,9 +378,7 @@ if [[ -e $config_file ]]; then
	fi

	$rootdir/configure $config_params --with-shared
	# By setting SPDK_NO_LIB_DEPS=1, we ensure that we won't create any link dependencies.
	# Then we can be sure we get a valid accounting of the symbol dependencies we have.
	SPDK_NO_LIB_DEPS=1 $MAKE $MAKEFLAGS
	$MAKE $MAKEFLAGS
fi

xtrace_disable