<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-IN" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">I’m consuming dpdk via spdk.<br>
I was trying to use pkg-config for a Makefile that I’m writing,<br>
<br>
Executing:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">PKG_CONFIG_PATH=dpdk/build/lib/pkgconfig pkg-config --libs --static libdpdk<br>
<br>
Output:<br>
-Wl,--whole-archive -Wl,--no-whole-archive -Wl,--as-needed -pthread -L/home/nutanix/exact_spdk/spdk/dpdk/build/lib -l:librte_bus_pci.a -l:librte_bus_vdev.a -l:librte_mempool_ring.a -l:librte_vhost.a -l:librte_security.a -l:librte_reorder.a -l:librte_power.a
-l:librte_cryptodev.a -l:librte_compressdev.a -l:librte_timer.a -l:librte_hash.a -l:librte_cmdline.a -l:librte_pci.a -l:librte_ethdev.a -l:librte_meter.a -l:librte_net.a -l:librte_mbuf.a -l:librte_mempool.a -l:librte_rcu.a -l:librte_ring.a -l:librte_eal.a
-l:librte_telemetry.a -l:librte_kvargs.a -lrte_vhost -lrte_security -lrte_reorder -lrte_power -lrte_cryptodev -lrte_compressdev -lrte_timer -lrte_hash -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_rcu -lrte_ring
-lrte_eal -lrte_telemetry -lrte_kvargs -lm -ldl -lnuma<br>
<br>
At a closer look, you’ll see -l:librte_bus_pci.a -l:librte_bus_vdev.a -l:librte_mempool_ring.a, but you won’t find corresponding -lrte_bus_pci, -lrte_bus_vdev, -lrte_mempool_ring. This showed up in my use case as rte_mempool_ring has some functions which execute
on startup via __attribute__((constructor)), and they did not execute thus causing issues.<br>
<br>
I think the issue is that in pkgconfig we reference ‘dpdk_libraries’, which is updated libs/meson.build, but not updated in drivers/meson.build.<br>
<br>
If I apply this fix:<br>
<br>
</span>--- a/drivers/meson.build<o:p></o:p></p>
<p class="MsoNormal">+++ b/drivers/meson.build<o:p></o:p></p>
<p class="MsoNormal">@@ -277,7 +277,7 @@ foreach subpath:subdirs<o:p></o:p></p>
<p class="MsoNormal"> static_dep = declare_dependency(<o:p></o:p></p>
<p class="MsoNormal"> include_directories: includes,<o:p></o:p></p>
<p class="MsoNormal"> dependencies: static_deps)<o:p></o:p></p>
<p class="MsoNormal">-<o:p></o:p></p>
<p class="MsoNormal">+ dpdk_libraries = [shared_lib] + dpdk_libraries<o:p></o:p></p>
<p class="MsoNormal"> dpdk_drivers += static_lib<br>
<br>
Then things work well and I see <span lang="EN-US">-lrte_bus_pci, -lrte_bus_vdev, -lrte_mempool_ring in output of:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">PKG_CONFIG_PATH=dpdk/build/lib/pkgconfig pkg-config --libs --static libdpdk<br>
<br>
Please let me know if the current behavior is expected, or this change is needed.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"><br>
Regards<br>
Abhineet Pandey<o:p></o:p></span></p>
</div>
</body>
</html>