From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f177.google.com (mail-qk0-f177.google.com [209.85.220.177]) by dpdk.org (Postfix) with ESMTP id BDD459A88 for ; Tue, 7 Jun 2016 14:36:46 +0200 (CEST) Received: by mail-qk0-f177.google.com with SMTP id p22so40044942qka.2 for ; Tue, 07 Jun 2016 05:36:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=hOIPJiQm9/aPQ9Xac6xjY4kUIvH+f2cnf3DvOSm44+I=; b=hf+XLcy5nhuImbRXo3hRUGA03sowpM+52iHRuWj6sC6EKRc7fZuJBk5I0CWUCy3pQU +3DCy9o9jOfFyYNW9HZLRC9NyLCMW0m74PLbpzM9d7p9xXQAVSW3Y42LEI9qxV1PPVyT IQh1fTbkgTE1AKBV+QVD0PgJLew9YOmqJAYAVaLtwdRDBdPJaJFcwOCgobEqvIIERRR2 inC2pdb6e+mdMBt420oDYdygvft4VMdTzqPBKLAhTnJoTFF3NgdzPVSkVJkHMmyOx+Wa sFwSrHSza7cfoQmH3oAYTpH72YN0WQEVXSxwoQobyouz43Ksf5ST6auvZgY2wt39meD5 kO2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=hOIPJiQm9/aPQ9Xac6xjY4kUIvH+f2cnf3DvOSm44+I=; b=Hg9CgMasvDtoNERsNFzKd09lEEs6OGwwNbS0lvuTuivgkKMa0jNbAR6Kk46ut4b3Ne 0zMKrnmtbyEnFXR7H1BzAMsbgb9PqNdJY7jProcLbIVWW0IhItX+V7AbNUsZjnOG320T KoozI5X5lB03AmHvSMzIzmP2RvQJP66RjdWc7n/WHVDOQ1t822adYR5gUuEp9eFen6Lq p+lTXucAn6825bgPZcyOsVihQ2biEYaILok0wSKJlEeAHeo8TidVJKLaEoZJc5E11BSn GqAdnAcXuTj7hDOj1p5gRHFoL24Drpnso6JhalOwogp9lMwRkNRxvP+FTvJPW/R3OCS+ oV7A== X-Gm-Message-State: ALyK8tJ+sBkLAzvqUZDYXLDRdYqIJulbgFi3VoBQ0f1lwtIrznFxzmW1cSzYNwhpEynFSor4oabncBZm1IA4so0w X-Received: by 10.55.69.69 with SMTP id s66mr20170327qka.117.1465303006181; Tue, 07 Jun 2016 05:36:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.162.9 with HTTP; Tue, 7 Jun 2016 05:36:26 -0700 (PDT) In-Reply-To: <62da0f5f31b2ab9db2dcc16acd2f8425a575a26f.1465293714.git.pmatilai@redhat.com> References: <62da0f5f31b2ab9db2dcc16acd2f8425a575a26f.1465293714.git.pmatilai@redhat.com> From: Christian Ehrhardt Date: Tue, 7 Jun 2016 14:36:26 +0200 Message-ID: To: Panu Matilainen Cc: dev , Thomas Monjalon , Ferruh Yigit Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] mk: generate internal library dependencies from DEPDIRS-y automatically 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: Tue, 07 Jun 2016 12:36:47 -0000 Hi Panu, thanks for refreshing that - I'm much more happy with ldd output of most libraries now after build with that. And it comes much slimmer than my initial approach that touched all lib makefiles. Acked-by: Christian Ehrhardt FYI - for anyone else also trying this in a backported way to 16.04 it needs c6417ce6 and aace9d0b as prereq. This being done is a nice step taken towards saner linking. But I still struggle to see how to fix the circular dependency between librte_eal and librte_mempool. Maybe now is a time to look at this part of the original threads again to eventually get apps less overlinked? => http://www.dpdk.org/ml/archives/dev/2016-May/039441.html My naive suggestions in generalized form can be found there (no answer yet): => http://stackoverflow.com/questions/37351699/how-to-create-both-so-files-for-two-circular-depending-libraries Kind Regards, Christian Christian Ehrhardt Software Engineer, Ubuntu Server Canonical Ltd On Tue, Jun 7, 2016 at 12:01 PM, Panu Matilainen wrote: > Up to now dependencies between DPDK internal libraries have been > untracked at shared library level, requiring applications to know > about library internal dependencies and often consequently overlinking. > > Since the dependencies are already recorded for build ordering in the > makefiles, we can use that information to generate LDLIBS entries for > internal libraries automatically. > > Also revert commit 8180554d82b3 ("vhost: fix linkage of driver with > library") which is made redundant by this change. > > Signed-off-by: Panu Matilainen > --- > drivers/net/vhost/Makefile | 1 - > mk/rte.lib.mk | 7 +++++++ > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/vhost/Makefile b/drivers/net/vhost/Makefile > index 30b91a0..f49a69b 100644 > --- a/drivers/net/vhost/Makefile > +++ b/drivers/net/vhost/Makefile > @@ -38,7 +38,6 @@ LIB = librte_pmd_vhost.a > > CFLAGS += -O3 > CFLAGS += $(WERROR_FLAGS) > -LDLIBS += -lrte_vhost > > EXPORT_MAP := rte_pmd_vhost_version.map > > diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk > index b420280..1ff403f 100644 > --- a/mk/rte.lib.mk > +++ b/mk/rte.lib.mk > @@ -77,6 +77,13 @@ else > _CPU_LDFLAGS := $(CPU_LDFLAGS) > endif > > +# Translate DEPDIRS-y into LDLIBS > +# Ignore (sub)directory dependencies which do not provide an actual > library > +_IGNORE_DIRS = lib/librte_eal/% lib/librte_net lib/librte_compat > +_DEPDIRS = $(filter-out $(_IGNORE_DIRS),$(DEPDIRS-y)) > +_LDDIRS = $(subst librte_ether,libethdev,$(_DEPDIRS)) > +LDLIBS += $(subst lib/lib,-l,$(_LDDIRS)) > + > O_TO_A = $(AR) crDs $(LIB) $(OBJS-y) > O_TO_A_STR = $(subst ','\'',$(O_TO_A)) #'# fix syntax highlight > O_TO_A_DISP = $(if $(V),"$(O_TO_A_STR)"," AR $(@)") > -- > 2.5.5 > >