From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id A6B7C9269 for ; Sun, 6 Dec 2015 19:47:30 +0100 (CET) Received: by wmww144 with SMTP id w144so116288983wmw.1 for ; Sun, 06 Dec 2015 10:47:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jwVz6W9zfe0pKHWyRWcQC8KR7Mavinrc0kxvk8uKT6w=; b=x7yg8gCAhdgIGbsYkjaFkiTo90W6eUEAOQLA+ek4N99qKwpM13sBWGvIxptNLPShI1 Eo49ipppGqHwdF+6oRK/0W+ma+0WZ2LS9qx+7Zb5NlZ7MWeSOPNQOVJGDffOG59nB1kz AhMAOLoztTzvpW+76vNRb30Mik2c1p5qHJqLFyGy94g0FgP55AhM6mU2XB+G18r+ZzGv pz1reT+YA7lo4mdiQa3Vqk+GV71OzjYEe2ghfRSja9iJ997+SyL/Y/LhVqMRKsCdpWWf lIjQIw+4pu0VxPBl0mmrSHYIfmQR25eyowys20HLu3NztP4eIsDjAU12YyYTLcsqiYsl NUfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jwVz6W9zfe0pKHWyRWcQC8KR7Mavinrc0kxvk8uKT6w=; b=JQstZc5+IQoiLUHCZKdFYxU0j+RqzKKGJuYEcIrNf70D/R1D/X/WOGA/06VqCBiYux PHgDJA+vb5q/TAyoaEz2IJcMWbAbDv/2mTJT4OQT8ERuHx3PoDHZX0XYPqRUqTnYjT3t 2gNkWr7M8ejzmyD4XqOcP2lgzY01N+cUBAhOYK7OuNxSCRu9QWOHxxYHug+qdntWE4MK v57kUvDbgWC1tqmLagk+9vKYG/zpNKQM7F8ZwqBAHuoQw7zClxODALngs1TbSFIyoh3s hQPiDCxZOdL2p26/BeLMhWhxUC67VlFK6mcLiH5MWVXU6gWktTdY+JR4AjtJdOvgAH6C KARQ== X-Gm-Message-State: ALoCoQlgz28zINjdVyHssh+CTocp7XQATKsrmM9YgGe9BGxpwFXVAgGRZj4KgvkjWIdEwYZexoz8 X-Received: by 10.194.178.70 with SMTP id cw6mr28907071wjc.73.1449427650488; Sun, 06 Dec 2015 10:47:30 -0800 (PST) Received: from localhost.localdomain (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id vr10sm21850853wjc.38.2015.12.06.10.47.29 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Dec 2015 10:47:29 -0800 (PST) From: Thomas Monjalon To: Panu Matilainen Date: Sun, 6 Dec 2015 19:46:06 +0100 Message-Id: <1449427566-15782-2-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.5.2 In-Reply-To: <1449427566-15782-1-git-send-email-thomas.monjalon@6wind.com> References: <1449427566-15782-1-git-send-email-thomas.monjalon@6wind.com> Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH v2 2/2] mk: fix shared library dependencies of drivers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 18:47:31 -0000 From: Panu Matilainen Similar to commit 113c8e13c4201eee207723571f83aaf285277d75, but for bnx2x, pcap, sze2data and xenvirt PMDs. Requiring applications to know about library internal details like dependencies to external helper libraries is a limitation of static linkage, shared libraries should always know their own dependencies for sane operation. This is especially highlighted with dlopen()'ed items, having applications link against about plugin internal dependencies goes on the side of absurd. Note that linking with a shared combined library still requires to know the internal dependencies. Signed-off-by: Panu Matilainen Signed-off-by: Thomas Monjalon --- drivers/net/bnx2x/Makefile | 1 + drivers/net/pcap/Makefile | 1 + drivers/net/szedata2/Makefile | 1 + drivers/net/xenvirt/Makefile | 1 + mk/rte.app.mk | 12 ++++-------- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/bnx2x/Makefile b/drivers/net/bnx2x/Makefile index 87f31b6..d895d8c 100644 --- a/drivers/net/bnx2x/Makefile +++ b/drivers/net/bnx2x/Makefile @@ -8,6 +8,7 @@ LIB = librte_pmd_bnx2x.a CFLAGS += -O3 -g CFLAGS += $(WERROR_FLAGS) CFLAGS += -DZLIB_CONST +LDLIBS += -lz EXPORT_MAP := rte_pmd_bnx2x_version.map diff --git a/drivers/net/pcap/Makefile b/drivers/net/pcap/Makefile index 48be913..b41d8a2 100644 --- a/drivers/net/pcap/Makefile +++ b/drivers/net/pcap/Makefile @@ -39,6 +39,7 @@ LIB = librte_pmd_pcap.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +LDLIBS += -lpcap EXPORT_MAP := rte_pmd_pcap_version.map diff --git a/drivers/net/szedata2/Makefile b/drivers/net/szedata2/Makefile index c3c42e5..963a8d6 100644 --- a/drivers/net/szedata2/Makefile +++ b/drivers/net/szedata2/Makefile @@ -38,6 +38,7 @@ LIB = librte_pmd_szedata2.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +LDLIBS += -lsze2 EXPORT_MAP := rte_pmd_szedata2_version.map diff --git a/drivers/net/xenvirt/Makefile b/drivers/net/xenvirt/Makefile index 9c521d5..1d05b71 100644 --- a/drivers/net/xenvirt/Makefile +++ b/drivers/net/xenvirt/Makefile @@ -38,6 +38,7 @@ LIB = librte_pmd_xenvirt.a CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +LDLIBS += -lxenstore EXPORT_MAP := rte_eth_xenvirt_version.map diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 3f56852..90ec33d 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -90,10 +90,6 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost endif # ! CONFIG_RTE_BUILD_COMBINE_LIBS -_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lpcap - -_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lsze2 - ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lnuma endif @@ -106,13 +102,13 @@ endif # The combined library fails also to store this information. # So linking with static or combined library requires explicit dependencies. ifneq ($(CONFIG_RTE_BUILD_COMBINE_LIBS)$(CONFIG_RTE_BUILD_SHARED_LIB),ny) +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lpcap +_LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lz _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -libverbs -endif # CONFIG_RTE_BUILD_COMBINE_LIBS or not CONFIG_RTE_BUILD_SHARED_LIBS - -_LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lz - +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lsze2 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lxenstore +endif # CONFIG_RTE_BUILD_COMBINE_LIBS or not CONFIG_RTE_BUILD_SHARED_LIBS _LDLIBS-y += --start-group -- 2.5.2