DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Inter-PMD dependencies when building shared libraries
@ 2017-10-02 20:48 Eads, Gage
  2017-10-05 12:12 ` Olivier MATZ
  0 siblings, 1 reply; 11+ messages in thread
From: Eads, Gage @ 2017-10-02 20:48 UTC (permalink / raw)
  To: dev; +Cc: Olivier Matz, 'Jacob,  Jerin', santosh.shukla

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-10-24  0:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-02 20:48 [dpdk-dev] Inter-PMD dependencies when building shared libraries Eads, Gage
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

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).