From 0d822b804769b5f70fa0e2b72a0f93e4c063783f Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 10 Mar 2016 15:16:00 +0200 Subject: [PATCH] mk: fix vhost shared library dependencies Add DT_NEEDED entries for external library dependencies which are the most critical ones for sane operation. Clean up vhost_cuse CFLAGS/LDFLAGS confusion while at it. Signed-off-by: Panu Matilainen --- lib/librte_vhost/Makefile | 7 ++++--- mk/rte.app.mk | 12 +++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile index ef9bbae5fa..e33ff53e00 100644 --- a/lib/librte_vhost/Makefile +++ b/lib/librte_vhost/Makefile @@ -41,13 +41,14 @@ LIBABIVER := 2 CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64 ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),y) CFLAGS += -I vhost_user +LDLIBS += -lpthread else -CFLAGS += -I vhost_cuse -lfuse -LDFLAGS += -lfuse +CFLAGS += -I vhost_cuse +LDLIBS += -lfuse endif ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y) -LDFLAGS += -lnuma +LDLIBS += -lnuma endif # all source are stored in SRCS-y diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 9dcc4c42e1..a1cd9a3c72 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -80,19 +80,17 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter _LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost +# The static libraries do not know their dependencies. +# So linking with static library requires explicit dependencies. +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm +_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lnuma endif - ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse endif - -# The static libraries do not know their dependencies. -# So linking with static library requires explicit dependencies. -ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) -_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm -_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt ifeq ($(CONFIG_RTE_NEXT_ABI),y) _LDLIBS-$(CONFIG_RTE_PORT_PCAP) += -lpcap endif -- 2.20.1