build: use SYS_LIBS for modules system lib dependencies

This is a step towards simplifying the Makefiles for
SPDK applications.  After this change, all of the
xxx_MODULES_LINKER_ARGS variables are just a list
of SPDK libraries wrapped in --whole-archive.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0cf069c2f74e8998d42dea9598db55f333c861b7

Reviewed-on: https://review.gerrithub.io/434146
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Jim Harris 2018-11-20 13:38:24 -07:00 committed by Darek Stojaczyk
parent 3da5847023
commit 9a47106188

View File

@ -40,41 +40,43 @@ BLOCKDEV_MODULES_LIST += bdev_crypto
endif
ifeq ($(CONFIG_RDMA),y)
BLOCKDEV_MODULES_DEPS += -libverbs -lrdmacm
SYS_LIBS += -libverbs -lrdmacm
endif
ifeq ($(OS),Linux)
BLOCKDEV_MODULES_LIST += bdev_aio
BLOCKDEV_MODULES_DEPS += -laio
SYS_LIBS += -laio
ifeq ($(CONFIG_VIRTIO),y)
BLOCKDEV_MODULES_LIST += bdev_virtio virtio
endif
ifeq ($(CONFIG_ISCSI_INITIATOR),y)
BLOCKDEV_MODULES_LIST += bdev_iscsi
# Fedora installs libiscsi to /usr/lib64/iscsi for some reason.
BLOCKDEV_MODULES_DEPS += -L/usr/lib64/iscsi -liscsi
SYS_LIBS += -L/usr/lib64/iscsi -liscsi
endif
endif
ifeq ($(CONFIG_RBD),y)
BLOCKDEV_MODULES_LIST += bdev_rbd
BLOCKDEV_MODULES_DEPS += -lrados -lrbd
SYS_LIBS += -lrados -lrbd
endif
ifeq ($(CONFIG_PMDK),y)
BLOCKDEV_MODULES_LIST += bdev_pmem
BLOCKDEV_MODULES_DEPS += -lpmemblk
SYS_LIBS += -lpmemblk
endif
SOCK_MODULES_LIST = sock_posix
ifeq ($(CONFIG_VPP),y)
SYS_LIBS += -Wl,--whole-archive
ifneq ($(CONFIG_VPP_DIR),)
SOCK_MODULES_DEPS = -l:libvppinfra.a -l:libsvm.a -l:libvapiclient.a
SOCK_MODULES_DEPS += -l:libvppcom.a -l:libvlibmemoryclient.a
SYS_LIBS += -l:libvppinfra.a -l:libsvm.a -l:libvapiclient.a
SYS_LIBS += -l:libvppcom.a -l:libvlibmemoryclient.a
else
SOCK_MODULES_DEPS = -lvppcom
SYS_LIBS += -lvppcom
endif
SYS_LIBS += -Wl,--no-whole-archive
SOCK_MODULES_LIST += sock_vpp
endif
@ -82,21 +84,18 @@ COPY_MODULES_LIST = copy_ioat ioat
BLOCKDEV_MODULES_LINKER_ARGS = -Wl,--whole-archive \
$(BLOCKDEV_MODULES_LIST:%=-lspdk_%) \
-Wl,--no-whole-archive \
$(BLOCKDEV_MODULES_DEPS)
-Wl,--no-whole-archive
BLOCKDEV_MODULES_FILES = $(call spdk_lib_list_to_static_libs,$(BLOCKDEV_MODULES_LIST))
COPY_MODULES_LINKER_ARGS = -Wl,--whole-archive \
$(COPY_MODULES_LIST:%=-lspdk_%) \
-Wl,--no-whole-archive \
$(COPY_MODULES_DEPS)
-Wl,--no-whole-archive
COPY_MODULES_FILES = $(call spdk_lib_list_to_static_libs,$(COPY_MODULES_LIST))
SOCK_MODULES_LINKER_ARGS = -Wl,--whole-archive \
$(SOCK_MODULES_LIST:%=-lspdk_%) \
$(SOCK_MODULES_DEPS) \
-Wl,--no-whole-archive
SOCK_MODULES_FILES = $(call spdk_lib_list_to_static_libs,$(SOCK_MODULES_LIST))