From 79602d10c674bfbcc776b7711878f859f7f58369 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. Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466081 (master) (cherry picked from commit 5c62618f2672ce4d2969875727709cbd89c0722d) Change-Id: Ic986281a162ac20b523486e9f8cccf4a0787afd7 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466983 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Tomasz Zawadzki --- mk/spdk.lib_deps.mk | 22 ++++++++++++++-------- module/event/subsystems/Makefile | 11 +++++++++++ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/mk/spdk.lib_deps.mk b/mk/spdk.lib_deps.mk index e7ec9f37a6..472d14b853 100644 --- a/mk/spdk.lib_deps.mk +++ b/mk/spdk.lib_deps.mk @@ -128,15 +128,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 +# 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..c9c6464af4 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)