DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Eads, Gage" <gage.eads@intel.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: Olivier Matz <olivier.matz@6wind.com>,
	"'Jacob,  Jerin'" <Jerin.JacobKollanukkaran@cavium.com>,
	"santosh.shukla@caviumnetworks.com"
	<santosh.shukla@caviumnetworks.com>
Subject: [dpdk-dev] Inter-PMD dependencies when building shared libraries
Date: Mon, 2 Oct 2017 20:48:29 +0000	[thread overview]
Message-ID: <9184057F7FC11744A2107296B6B8EB1E14005F70@FMSMSX108.amr.corp.intel.com> (raw)

I believe I've spotted an issue in the way inter-PMD dependencies are handled when building shared libraries. The depdirs_rule in mk/rte.subdir.mk relies on DEPDIRS-xyz containing the names of subdirectories that xyz depends on. In mk/rte.lib.mk, these DEPDIRS are converted into LDLIBS. This works when the subdirectory names match the library names (i.e. any of the libraries under lib/). However when the dependency is on a PMD, the subdirectory and library names don't match.

This is a problem, for example, in a patch for the net/octeontx PMD, which has a dependency on the event/octeontx PMD: http://dpdk.org/ml/archives/dev/2017-August/073983.html

I've reproduced this with a contrived example, by making the failsafe PMD depend on the NULL PMD in drivers/net/Makefile:
-DEPDIRS-failsafe = $(core-libs)
+DEPDIRS-failsafe = $(core-libs) librte_pmd_null

You can reproduce the build failure by running this command:
./devtools/test-build.sh x86_64-native-linuxapp-gcc+CONFIG_RTE_BUILD_SHARED_LIB

I'm no expert on DPDK's dependency handling code, but one option is to modify rte.lib.mk like so:
-LDLIBS += $(subst lib,-l,$(_LDDIRS))
+LDLIBS += $(subst lib,-l,$(filter lib%,$(_LDDIRS)))

Then you could put the PMD's directory name in DEPDIRs, and specify the depended-on library in the PMD's LDLIBS (as is done in the aforementioned net/octeontx PMD).

Thoughts?

Thanks,
Gage

             reply	other threads:[~2017-10-02 20:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-02 20:48 Eads, Gage [this message]
2017-10-05 12:12 ` Olivier MATZ
2017-10-05 12:32   ` Thomas Monjalon
2017-10-05 12:50     ` Bruce Richardson
2017-10-12 16:04       ` [dpdk-dev] [PATCH 0/3] mk: fix LDLIBS Olivier Matz
2017-10-12 16:04         ` [dpdk-dev] [PATCH 1/3] crypto/dpaa2_sec: remove uneffective dependency Olivier Matz
2017-10-12 16:04         ` [dpdk-dev] [PATCH 2/3] mempool/octeontx: fix dependency Olivier Matz
2017-10-12 16:04         ` [dpdk-dev] [PATCH 3/3] mk: do not generate LDLIBS from directory dependencies Olivier Matz
2017-10-24  0:11           ` Thomas Monjalon
2017-10-23 14:39         ` [dpdk-dev] [PATCH 0/3] mk: fix LDLIBS Eads, Gage
2017-10-24  0:15           ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9184057F7FC11744A2107296B6B8EB1E14005F70@FMSMSX108.amr.corp.intel.com \
    --to=gage.eads@intel.com \
    --cc=Jerin.JacobKollanukkaran@cavium.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    --cc=santosh.shukla@caviumnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).