Message ID | 1418684684-23642-1-git-send-email-thomas.monjalon@6wind.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 09658805C; Tue, 16 Dec 2014 00:05:20 +0100 (CET) Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id 1E6258057 for <dev@dpdk.org>; Tue, 16 Dec 2014 00:05:18 +0100 (CET) Received: by mail-wg0-f43.google.com with SMTP id l18so16056338wgh.2 for <dev@dpdk.org>; Mon, 15 Dec 2014 15:05:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=iSDn2bt//uU35srjmF/FBYAKdZWIgEuIfIkUOARSVxM=; b=fAuc8WY0JQOKqm05AjpGuSDcfPYwbviIB/5X6YNSJhU++JK7+0GaH+tYRcPNvRjOtl 0+CNvY+WpX4x1WOUnJiHTY6Ct3QDlP92CFKFME6u72J1PC4XREiQEnUm7hMHFf+KVUQC n50hSXAHWRLsi08wDic/YFMy7cv7zpgqqBMTb8t+UdrxroMuFMePDdpBa0Rquyq/0leB GKEtY4rwwjAEsJs9DbyC2SgT1pb3UYG0ivGQSOyqIlEjpdlpHwSW/uZugX3cUOZR5o59 3Ys+BFdIhj0iee3kdfNGKgCkIYKZrmiJmto4tAaoXKSkEcEeZuRCio6Hhcfb6lpHRALB 3LuQ== X-Gm-Message-State: ALoCoQkpFEbH0ACw+ds6t+drW7TqoImCqmGz3Ia68f/PwAYUn1HkpuSCFrqozxv/v+wuWvXYSDzd X-Received: by 10.194.57.43 with SMTP id f11mr54446347wjq.6.1418684717965; Mon, 15 Dec 2014 15:05:17 -0800 (PST) Received: from localhost.localdomain (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id eu15sm14899209wid.18.2014.12.15.15.05.16 for <dev@dpdk.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Dec 2014 15:05:17 -0800 (PST) From: Thomas Monjalon <thomas.monjalon@6wind.com> To: dev@dpdk.org Date: Tue, 16 Dec 2014 00:04:44 +0100 Message-Id: <1418684684-23642-1-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <2438199.ui6ep4sFDa@xps13> References: <2438199.ui6ep4sFDa@xps13> Subject: [dpdk-dev] [PATCH v2] mk: fix build with shared pcap pmd X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Thomas Monjalon
Dec. 15, 2014, 11:04 p.m. UTC
Some applications doesn't have the pcap link flag
when shared libraries are enabled.
Indeed in such case, pcap PMD must not be linked but pcap library should.
Actually -lpcap is always needed if pcap PMD is used,
and -lrte_pmd_pcap must be set only with static PMD library.
So the flags -lrte_pmd_pcap and -lpcap are enabled separately.
Workarounds in test-pmd/ and test-pipeline/ can be removed.
Reported-by: Stepan Sojka <stepan.sojka@adaptivemobile.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
v2:
fix in rte.app.mk
v1 from Stepan:
fix every applications
app/test-pipeline/Makefile | 4 ----
app/test-pmd/Makefile | 4 ----
mk/rte.app.mk | 6 +++++-
3 files changed, 5 insertions(+), 9 deletions(-)
Comments
On Tue, Dec 16, 2014 at 12:04:44AM +0100, Thomas Monjalon wrote: > Some applications doesn't have the pcap link flag > when shared libraries are enabled. > Indeed in such case, pcap PMD must not be linked but pcap library should. > > Actually -lpcap is always needed if pcap PMD is used, > and -lrte_pmd_pcap must be set only with static PMD library. > So the flags -lrte_pmd_pcap and -lpcap are enabled separately. > > Workarounds in test-pmd/ and test-pipeline/ can be removed. > > Reported-by: Stepan Sojka <stepan.sojka@adaptivemobile.com> > Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> > --- > > v2: > fix in rte.app.mk > > v1 from Stepan: > fix every applications > > app/test-pipeline/Makefile | 4 ---- > app/test-pmd/Makefile | 4 ---- > mk/rte.app.mk | 6 +++++- > 3 files changed, 5 insertions(+), 9 deletions(-) > > diff --git a/app/test-pipeline/Makefile b/app/test-pipeline/Makefile > index b81652f..aa6df0c 100644 > --- a/app/test-pipeline/Makefile > +++ b/app/test-pipeline/Makefile > @@ -41,10 +41,6 @@ APP = testpipeline > CFLAGS += -O3 > CFLAGS += $(WERROR_FLAGS) > > -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) > -LDFLAGS += -lpcap > -endif > - > # > # all source are stored in SRCS-y > # > diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile > index 97dc2e6..dcf26f4 100644 > --- a/app/test-pmd/Makefile > +++ b/app/test-pmd/Makefile > @@ -41,10 +41,6 @@ APP = testpmd > CFLAGS += -O3 > CFLAGS += $(WERROR_FLAGS) > > -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) > -LDFLAGS += -lpcap > -endif > - > # > # all source are stored in SRCS-y > # > diff --git a/mk/rte.app.mk b/mk/rte.app.mk > index 84ec4df..c5eaf82 100644 > --- a/mk/rte.app.mk > +++ b/mk/rte.app.mk > @@ -119,6 +119,10 @@ LDLIBS += -lm > LDLIBS += -lrt > endif > > +ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) > +LDLIBS += -lpcap > +endif > + > LDLIBS += --start-group > > ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) > @@ -207,7 +211,7 @@ LDLIBS += -lrte_pmd_ring > endif > > ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) > -LDLIBS += -lrte_pmd_pcap -lpcap > +LDLIBS += -lrte_pmd_pcap > endif > > ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) > -- > 2.1.3 > > Actually, what if we just add $(LDFLAGS) to the O_TO_S rule in mk/rte.lib.mk? Then in lib/librte_pmd_pcap/Makefile, we can just add LDFLAGS+=-lpcap, and the loading of the pcap pmd will itself require the loading of libpcap. That would be a nice clean implementation that allows applications to just link the pmd and not have to worry about dependencies. It would also allow us to clean up other dependencies like the xenvirt pmd and vhost. Neil
2014-12-16 08:58, Neil Horman: > On Tue, Dec 16, 2014 at 12:04:44AM +0100, Thomas Monjalon wrote: > > Some applications doesn't have the pcap link flag > > when shared libraries are enabled. > > Indeed in such case, pcap PMD must not be linked but pcap library should. > > > > Actually -lpcap is always needed if pcap PMD is used, > > and -lrte_pmd_pcap must be set only with static PMD library. > > So the flags -lrte_pmd_pcap and -lpcap are enabled separately. > > > > Workarounds in test-pmd/ and test-pipeline/ can be removed. > > > > Reported-by: Stepan Sojka <stepan.sojka@adaptivemobile.com> > > Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> [...] > > --- a/mk/rte.app.mk > > +++ b/mk/rte.app.mk > > @@ -119,6 +119,10 @@ LDLIBS += -lm > > LDLIBS += -lrt > > endif > > > > +ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) > > +LDLIBS += -lpcap > > +endif > > + > > LDLIBS += --start-group > > > > ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) > > @@ -207,7 +211,7 @@ LDLIBS += -lrte_pmd_ring > > endif > > > > ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) > > -LDLIBS += -lrte_pmd_pcap -lpcap > > +LDLIBS += -lrte_pmd_pcap > > endif > > > > ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) > > Actually, what if we just add $(LDFLAGS) to the O_TO_S rule in mk/rte.lib.mk? > Then in lib/librte_pmd_pcap/Makefile, we can just add LDFLAGS+=-lpcap, and the > loading of the pcap pmd will itself require the loading of libpcap. That would > be a nice clean implementation that allows applications to just link the pmd and > not have to worry about dependencies. It would also allow us to clean up other > dependencies like the xenvirt pmd and vhost. Yes it makes sense. Could you test it please? What about applying my patch (which keep the existing logic) as a first fix/clean-up and then move -lpcap in PMD as a second step? Proceeding this way would allow to integrate a safe fix for 1.8.0. Maybe that linking pcap in the PMD could unveil new bugs with some distributions, so it would need some time to validate it.
On Tue, Dec 16, 2014 at 03:39:56PM +0100, Thomas Monjalon wrote: > 2014-12-16 08:58, Neil Horman: > > On Tue, Dec 16, 2014 at 12:04:44AM +0100, Thomas Monjalon wrote: > > > Some applications doesn't have the pcap link flag > > > when shared libraries are enabled. > > > Indeed in such case, pcap PMD must not be linked but pcap library should. > > > > > > Actually -lpcap is always needed if pcap PMD is used, > > > and -lrte_pmd_pcap must be set only with static PMD library. > > > So the flags -lrte_pmd_pcap and -lpcap are enabled separately. > > > > > > Workarounds in test-pmd/ and test-pipeline/ can be removed. > > > > > > Reported-by: Stepan Sojka <stepan.sojka@adaptivemobile.com> > > > Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> > [...] > > > --- a/mk/rte.app.mk > > > +++ b/mk/rte.app.mk > > > @@ -119,6 +119,10 @@ LDLIBS += -lm > > > LDLIBS += -lrt > > > endif > > > > > > +ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) > > > +LDLIBS += -lpcap > > > +endif > > > + > > > LDLIBS += --start-group > > > > > > ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) > > > @@ -207,7 +211,7 @@ LDLIBS += -lrte_pmd_ring > > > endif > > > > > > ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) > > > -LDLIBS += -lrte_pmd_pcap -lpcap > > > +LDLIBS += -lrte_pmd_pcap > > > endif > > > > > > ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) > > > > Actually, what if we just add $(LDFLAGS) to the O_TO_S rule in mk/rte.lib.mk? > > Then in lib/librte_pmd_pcap/Makefile, we can just add LDFLAGS+=-lpcap, and the > > loading of the pcap pmd will itself require the loading of libpcap. That would > > be a nice clean implementation that allows applications to just link the pmd and > > not have to worry about dependencies. It would also allow us to clean up other > > dependencies like the xenvirt pmd and vhost. > > Yes it makes sense. Could you test it please? > What about applying my patch (which keep the existing logic) as a first > fix/clean-up and then move -lpcap in PMD as a second step? > Proceeding this way would allow to integrate a safe fix for 1.8.0. > Maybe that linking pcap in the PMD could unveil new bugs with some distributions, > so it would need some time to validate it. > > -- > Thomas > ACK, I'm fine with your patch currently. I'll revisit this after 1.8 is released Neil
2014-12-16 16:42, Neil Horman: > On Tue, Dec 16, 2014 at 03:39:56PM +0100, Thomas Monjalon wrote: > > 2014-12-16 08:58, Neil Horman: > > > On Tue, Dec 16, 2014 at 12:04:44AM +0100, Thomas Monjalon wrote: > > > > Some applications doesn't have the pcap link flag > > > > when shared libraries are enabled. > > > > Indeed in such case, pcap PMD must not be linked but pcap library should. > > > > > > > > Actually -lpcap is always needed if pcap PMD is used, > > > > and -lrte_pmd_pcap must be set only with static PMD library. > > > > So the flags -lrte_pmd_pcap and -lpcap are enabled separately. > > > > > > > > Workarounds in test-pmd/ and test-pipeline/ can be removed. > > > > > > > > Reported-by: Stepan Sojka <stepan.sojka@adaptivemobile.com> > > > > Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> > > [...] > > > > --- a/mk/rte.app.mk > > > > +++ b/mk/rte.app.mk > > > > @@ -119,6 +119,10 @@ LDLIBS += -lm > > > > LDLIBS += -lrt > > > > endif > > > > > > > > +ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) > > > > +LDLIBS += -lpcap > > > > +endif > > > > + > > > > LDLIBS += --start-group > > > > > > > > ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) > > > > @@ -207,7 +211,7 @@ LDLIBS += -lrte_pmd_ring > > > > endif > > > > > > > > ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) > > > > -LDLIBS += -lrte_pmd_pcap -lpcap > > > > +LDLIBS += -lrte_pmd_pcap > > > > endif > > > > > > > > ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y) > > > > > > Actually, what if we just add $(LDFLAGS) to the O_TO_S rule in mk/rte.lib.mk? > > > Then in lib/librte_pmd_pcap/Makefile, we can just add LDFLAGS+=-lpcap, and the > > > loading of the pcap pmd will itself require the loading of libpcap. That would > > > be a nice clean implementation that allows applications to just link the pmd and > > > not have to worry about dependencies. It would also allow us to clean up other > > > dependencies like the xenvirt pmd and vhost. > > > > Yes it makes sense. Could you test it please? > > What about applying my patch (which keep the existing logic) as a first > > fix/clean-up and then move -lpcap in PMD as a second step? > > Proceeding this way would allow to integrate a safe fix for 1.8.0. > > Maybe that linking pcap in the PMD could unveil new bugs with some distributions, > > so it would need some time to validate it. > > > ACK, I'm fine with your patch currently. I'll revisit this after 1.8 is > released > Neil Applied
diff --git a/app/test-pipeline/Makefile b/app/test-pipeline/Makefile index b81652f..aa6df0c 100644 --- a/app/test-pipeline/Makefile +++ b/app/test-pipeline/Makefile @@ -41,10 +41,6 @@ APP = testpipeline CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) -LDFLAGS += -lpcap -endif - # # all source are stored in SRCS-y # diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile index 97dc2e6..dcf26f4 100644 --- a/app/test-pmd/Makefile +++ b/app/test-pmd/Makefile @@ -41,10 +41,6 @@ APP = testpmd CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) -ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) -LDFLAGS += -lpcap -endif - # # all source are stored in SRCS-y # diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 84ec4df..c5eaf82 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -119,6 +119,10 @@ LDLIBS += -lm LDLIBS += -lrt endif +ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) +LDLIBS += -lpcap +endif + LDLIBS += --start-group ifeq ($(CONFIG_RTE_LIBRTE_KVARGS),y) @@ -207,7 +211,7 @@ LDLIBS += -lrte_pmd_ring endif ifeq ($(CONFIG_RTE_LIBRTE_PMD_PCAP),y) -LDLIBS += -lrte_pmd_pcap -lpcap +LDLIBS += -lrte_pmd_pcap endif ifeq ($(CONFIG_RTE_LIBRTE_PMD_AF_PACKET),y)