From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 9C002C37C for ; Thu, 9 Jun 2016 12:10:20 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id m124so53003935wme.1 for ; Thu, 09 Jun 2016 03:10:20 -0700 (PDT) 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:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=pMofU/XxlN8I2I+AzRcdkjpSBIFJ4WYXx+ra5sYWilo=; b=tbzv6ZbE+7VPI3Evq9jB83ip3huWJUyT0UU2BuhHorYEut9volNX5TEuPma/MzSYrc o+OcrGLxdJ+yZN9UbBuXQk3PEiiLiQ4oEQlhRyoFFpnZpbqMSQ3eAK6xNLrmO+fi94eG fslRWjKtoC7VqeKuhSkf1ATIn5FZQRPltciK0VOfJuahR+Mm5Yt/EX0BWjMZPOK2HmB2 /ZN9+cujqwzRcd52c+RWWeBzzmvH4dpFgGFPege1EgF56/TccMr3lkrMJEtv8f1x/BEW Hu39D0Qd8NHgs9w2R7N/gKxK47FkP9B8Qpj001iz0C7qw364Pcmg+ipi9hl9Ggrcs+CC 1bZA== 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:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=pMofU/XxlN8I2I+AzRcdkjpSBIFJ4WYXx+ra5sYWilo=; b=JmtkJE3qZw6uB9MepeoZ30gbt5hQeEsap9ckaDAgn0wR1R+3QT2zzu2s1u/W5UAaB5 4lwcrxqvjsFcm+4ygIHopjmg11v3LsybdN4CD7E7rqn0p41fKoGjK7WRVIS2DohENmMn BMxDaoiEhzxGdP2CmLZwVk39SEvskfPm3cFlRQzuhlxt5ToPEOFFsq4N8xFq9Qe7CEBb 1AUIJPhDt0S9vf2Oul6D90ShhN8SeJC0nltSFmadR2++Tz0JmngQWHeCuPwALj/uyG4P tmrhkjon8bylAw33K/k6bm/lkTWy8COVP9I0kMbkLS+gWTGrkQqC7FQKoQxyUKUoqqA+ wrvQ== X-Gm-Message-State: ALyK8tLKLLzVmoZsrOzF1kqqBqD94qqDHSqN8Rdh9I9A1WgkaO806lXfNE12/TCQvuawzw3q X-Received: by 10.194.146.132 with SMTP id tc4mr8823867wjb.13.1465467020361; Thu, 09 Jun 2016 03:10:20 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id l4sm21525955wml.21.2016.06.09.03.10.19 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Jun 2016 03:10:19 -0700 (PDT) From: Thomas Monjalon To: Ferruh Yigit Cc: dev@dpdk.org, Panu Matilainen , Christian Ehrhardt Date: Thu, 09 Jun 2016 12:10:18 +0200 Message-ID: <7354386.zBuGXxEf9j@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1464367686-3475-1-git-send-email-ferruh.yigit@intel.com> References: <574872B3.6040702@intel.com> <1464367686-3475-1-git-send-email-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 1/2] mk: prevent overlinking in applications 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: Thu, 09 Jun 2016 10:10:20 -0000 Hi Ferruh, 2016-05-27 17:48, Ferruh Yigit: > Replace --no-as-needed linker flag with --as-needed flag, which will > only link libraries directly called by application. This requires inter > library dependencies resolved correctly. > > Not linking all libraries cause a compile error for lpcap and possible > to have other similar compiler errors, so increasing the scope of > --start-group argument. What is the error? > cmdline_test application causes compile error because of cyclic > dependency between librte_eal <-> librte_mempool. A workaround added to > cmdline_test for compile error. > > Signed-off-by: Ferruh Yigit > --- a/app/cmdline_test/Makefile > +++ b/app/cmdline_test/Makefile > @@ -46,6 +46,7 @@ SRCS-y += commands.c > > CFLAGS += -O3 > CFLAGS += $(WERROR_FLAGS) A comment is required here to explain the workaround. > +LDFLAGS += -no-as-needed The option should be --no-as-needed. > --- a/mk/exec-env/linuxapp/rte.vars.mk > +++ b/mk/exec-env/linuxapp/rte.vars.mk > @@ -46,7 +46,7 @@ EXECENV_CFLAGS = -pthread > endif > > # Workaround lack of DT_NEEDED entry This comment is obsolete now. > -EXECENV_LDFLAGS = --no-as-needed > +EXECENV_LDFLAGS = --as-needed Why put this option for Linux only? Shouldn't we restrict this option to app.mk only? > --- a/mk/rte.app.mk > +++ b/mk/rte.app.mk > @@ -58,6 +58,7 @@ _LDLIBS-y += -L$(RTE_SDK_BIN)/lib > # > > _LDLIBS-y += --whole-archive > +_LDLIBS-y += --start-group --start-group must be used only to solve circular dependencies. Ideally we should not use it. I think it's needed only because of EAL logs using mempool (must be removed). Why extending it? I'm afraid we are masking some issues. > _LDLIBS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += -lrte_distributor > _LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER) += -lrte_reorder > @@ -111,8 +112,6 @@ _LDLIBS-y += -lcrypto > endif > endif # !CONFIG_RTE_BUILD_SHARED_LIBS > > -_LDLIBS-y += --start-group > - > _LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS) += -lrte_kvargs > _LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF) += -lrte_mbuf > _LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag