Blame SOURCES/dpdk-2.2-dtneeded.patch

ccb313
commit f85ab16a916be178a4cb61575f414c43fc98313d
ccb313
Author: Panu Matilainen <pmatilai@redhat.com>
ccb313
Date:   Tue Dec 8 13:42:26 2015 +0200
ccb313
ccb313
    mk: fix external shared library dependencies of libraries
ccb313
    
ccb313
    Similar to commit 5f9115e58cc6f304ff4ade694cf5823d32887d1a etc, but
ccb313
    for libraries. Clean up librte_vhost CFLAGS/LDFLAGS/LDLIBS confusion
ccb313
    while at it.
ccb313
    
ccb313
    Requiring applications to know about library internal details like
ccb313
    dependencies to external helper libraries is a limitation of
ccb313
    static linkage, shared libraries should always know their own
ccb313
    dependencies for sane operation.
ccb313
    
ccb313
    Linking with the combined library (whether shared or not) still
ccb313
    requires knowing the internal dependencies, and intra-dpdk
ccb313
    dependencies are also not currently recorded.
ccb313
    
ccb313
    Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
ccb313
ccb313
diff --git a/app/test/Makefile b/app/test/Makefile
ccb313
index ec33e1a..abb0545 100644
ccb313
--- a/app/test/Makefile
ccb313
+++ b/app/test/Makefile
ccb313
@@ -182,6 +182,8 @@ endif
ccb313
 endif
ccb313
 endif
ccb313
 
ccb313
+LDLIBS += -lm
ccb313
+
ccb313
 include $(RTE_SDK)/mk/rte.app.mk
ccb313
 
ccb313
 endif
ccb313
diff --git a/lib/librte_eal/bsdapp/eal/Makefile b/lib/librte_eal/bsdapp/eal/Makefile
ccb313
index 65b293f..b7b6016 100644
ccb313
--- a/lib/librte_eal/bsdapp/eal/Makefile
ccb313
+++ b/lib/librte_eal/bsdapp/eal/Makefile
ccb313
@@ -42,6 +42,9 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_ring
ccb313
 CFLAGS += -I$(RTE_SDK)/lib/librte_mempool
ccb313
 CFLAGS += $(WERROR_FLAGS) -O3
ccb313
 
ccb313
+LDLIBS += -lpthread
ccb313
+LDLIBS += -ldl
ccb313
+
ccb313
 EXPORT_MAP := rte_eal_version.map
ccb313
 
ccb313
 LIBABIVER := 2
ccb313
diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile
ccb313
index 26eced5..0efb9e4 100644
ccb313
--- a/lib/librte_eal/linuxapp/eal/Makefile
ccb313
+++ b/lib/librte_eal/linuxapp/eal/Makefile
ccb313
@@ -47,6 +47,9 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_mempool
ccb313
 CFLAGS += -I$(RTE_SDK)/lib/librte_ivshmem
ccb313
 CFLAGS += $(WERROR_FLAGS) -O3
ccb313
 
ccb313
+LDLIBS += -lpthread
ccb313
+LDLIBS += -ldl
ccb313
+
ccb313
 # specific to linuxapp exec-env
ccb313
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) := eal.c
ccb313
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_hugepage_info.c
ccb313
diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile
ccb313
index b1cb285..4d631f6 100644
ccb313
--- a/lib/librte_sched/Makefile
ccb313
+++ b/lib/librte_sched/Makefile
ccb313
@@ -41,6 +41,9 @@ CFLAGS += $(WERROR_FLAGS)
ccb313
 
ccb313
 CFLAGS_rte_red.o := -D_GNU_SOURCE
ccb313
 
ccb313
+LDLIBS += -lm
ccb313
+LDLIBS += -lrt
ccb313
+
ccb313
 EXPORT_MAP := rte_sched_version.map
ccb313
 
ccb313
 LIBABIVER := 1
ccb313
diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile
ccb313
index 6681f22..4aecc69 100644
ccb313
--- a/lib/librte_vhost/Makefile
ccb313
+++ b/lib/librte_vhost/Makefile
ccb313
@@ -42,12 +42,12 @@ CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -D_FILE_OFFSET_BITS=64
ccb313
 ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),y)
ccb313
 CFLAGS += -I vhost_user
ccb313
 else
ccb313
-CFLAGS += -I vhost_cuse -lfuse
ccb313
-LDFLAGS += -lfuse
ccb313
+CFLAGS += -I vhost_cuse
ccb313
+LDLIBS += -lfuse
ccb313
 endif
ccb313
 
ccb313
 ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
ccb313
-LDFLAGS += -lnuma
ccb313
+LDLIBS += -lnuma
ccb313
 endif
ccb313
 
ccb313
 # all source are stored in SRCS-y
ccb313
diff --git a/mk/exec-env/linuxapp/rte.vars.mk b/mk/exec-env/linuxapp/rte.vars.mk
ccb313
index 5fd7d85..d51bd17 100644
ccb313
--- a/mk/exec-env/linuxapp/rte.vars.mk
ccb313
+++ b/mk/exec-env/linuxapp/rte.vars.mk
ccb313
@@ -48,7 +48,7 @@ endif
ccb313
 # Workaround lack of DT_NEEDED entry
ccb313
 EXECENV_LDFLAGS = --no-as-needed
ccb313
 
ccb313
-EXECENV_LDLIBS  = -lrt -lm
ccb313
+EXECENV_LDLIBS  =
ccb313
 EXECENV_ASFLAGS =
ccb313
 
ccb313
 ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
ccb313
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
ccb313
index 8ecab41..4ecaa6c 100644
ccb313
--- a/mk/rte.app.mk
ccb313
+++ b/mk/rte.app.mk
ccb313
@@ -81,23 +81,11 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_LPM)            += -lrte_lpm
ccb313
 _LDLIBS-$(CONFIG_RTE_LIBRTE_POWER)          += -lrte_power
ccb313
 _LDLIBS-$(CONFIG_RTE_LIBRTE_ACL)            += -lrte_acl
ccb313
 _LDLIBS-$(CONFIG_RTE_LIBRTE_METER)          += -lrte_meter
ccb313
-
ccb313
 _LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED)          += -lrte_sched
ccb313
-_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED)          += -lm
ccb313
-_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED)          += -lrt
ccb313
-
ccb313
 _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lrte_vhost
ccb313
 
ccb313
 endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS
ccb313
 
ccb313
-ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
ccb313
-_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lnuma
ccb313
-endif
ccb313
-
ccb313
-ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n)
ccb313
-_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lfuse
ccb313
-endif
ccb313
-
ccb313
 # The static libraries do not know their dependencies.
ccb313
 # The combined library fails also to store this information.
ccb313
 # So linking with static or combined library requires explicit dependencies.
ccb313
@@ -111,6 +99,14 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT)    += -lxenstore
ccb313
 _LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD)      += -lgxio
ccb313
 # QAT PMD has a dependency on libcrypto (from openssl) for calculating HMAC precomputes
ccb313
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT)        += -lcrypto
ccb313
+_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED)          += -lm
ccb313
+_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED)          += -lrt
ccb313
+ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
ccb313
+_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lnuma
ccb313
+endif
ccb313
+ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n)
ccb313
+_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST)          += -lfuse
ccb313
+endif
ccb313
 endif # CONFIG_RTE_BUILD_COMBINE_LIBS or not CONFIG_RTE_BUILD_SHARED_LIBS
ccb313
 
ccb313
 _LDLIBS-y += --start-group