From 5c62618f2672ce4d2969875727709cbd89c0722d Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Thu, 22 Aug 2019 15:06:05 -0700 Subject: [PATCH] module/event: add subsystem interdependencies The SPDK application framework defines a list of event subsystem dependencies. When linking against individual shared libraries, it is useful for this dependency structure to be codified in the shared libraries themselves. For example, when linking a bdev based application against libspdk_bdev.so, one might wish to only specify this shared object at link time. However, when you actually run the application, it will fail to start because it is not linked to the copy and vmd subsystems. However, once thesedependencies are added, one can effectively link against only the exact subsystems they need and any dependent subsystems will be linked in automatically. Change-Id: Ic986281a162ac20b523486e9f8cccf4a0787afd7 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466081 Tested-by: SPDK CI Jenkins Reviewed-by: Paul Luse Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker --- mk/spdk.lib_deps.mk | 24 +++++++++++++++--------- module/event/subsystems/Makefile | 11 +++++++++++ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/mk/spdk.lib_deps.mk b/mk/spdk.lib_deps.mk index 71213815d7..6c8e827afc 100644 --- a/mk/spdk.lib_deps.mk +++ b/mk/spdk.lib_deps.mk @@ -130,15 +130,21 @@ DEPDIRS-bdev_virtio := $(BDEV_DEPS_CONF_THREAD) virtio # module/event # module/event/app -DEPDIRS-app_rpc := event $(JSON_LIBS) thread util +DEPDIRS-app_rpc := log util thread event $(JSON_LIBS) -#module/event/subsystems -DEPDIRS-event_bdev := bdev event +# module/event/subsystems +# These depdirs include subsystem interdependencies which +# are not related to symbols, but are defined directly in +# the SPDK event subsystem code. DEPDIRS-event_copy := copy event -DEPDIRS-event_iscsi := event iscsi -DEPDIRS-event_nbd := event nbd DEPDIRS-event_net := sock net event -DEPDIRS-event_nvmf := $(BDEV_DEPS_CONF_THREAD) event nvme nvmf -DEPDIRS-event_scsi := event scsi -DEPDIRS-event_vhost := event vhost -DEPDIRS-event_vmd := conf vmd event +DEPDIRS-event_vmd := vmd conf $(JSON_LIBS) event + +DEPDIRS-event_bdev := bdev event event_copy event_vmd + +DEPDIRS-event_nbd := event nbd event_bdev +DEPDIRS-event_nvmf := $(BDEV_DEPS_CONF_THREAD) event nvme nvmf event_bdev +DEPDIRS-event_scsi := event scsi event_bdev + +DEPDIRS-event_iscsi := event iscsi event_scsi +DEPDIRS-event_vhost := event vhost event_scsi diff --git a/module/event/subsystems/Makefile b/module/event/subsystems/Makefile index d6b2c7614b..d29b33f0e0 100644 --- a/module/event/subsystems/Makefile +++ b/module/event/subsystems/Makefile @@ -42,6 +42,17 @@ endif DIRS-$(CONFIG_VHOST) += vhost +# These dependencies are not based specifically on symbols, but rather +# the subsystem dependency tree defined within the event subsystem C files +# themselves. Should that tree change, these dependencies should change +# accordingly. +DEPDIRS-bdev := copy vmd +DEPDIRS-iscsi := scsi +DEPDIRS-nbd := bdev +DEPDIRS-nvmf := bdev +DEPDIRS-scsi := bdev +DEPDIRS-vhost := scsi + .PHONY: all clean $(DIRS-y) all: $(DIRS-y)