All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Palider <jpalider@marvell.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: "bruce.richardson@intel.com" <bruce.richardson@intel.com>,
	"thomas@monjalon.net" <thomas@monjalon.net>,
	"david.marchand@redhat.com" <david.marchand@redhat.com>
Subject: [dpdk-dev] Meson configuration for pkg-config for drivers' shared objects
Date: Tue, 18 May 2021 14:33:50 +0000	[thread overview]
Message-ID: <CY4PR1801MB1911DD89AD702B22E775FB38D52C9@CY4PR1801MB1911.namprd18.prod.outlook.com> (raw)

Hi,

I experience a problem while building out-of-tree application against drivers' shared libraries from dpdk that are _not_ accessed by means of lib/ interface. This looks a bit like a lack of a link between the framework and what certain drivers deliver (rte_pmd API). Employing pkg-config in current shape does not satisfy the dependencies.

Please, have a look at the example below which materializes this problem of an app.c:

#include <rte_pmd_i40e.h>
#include <rte_ether.h>

int main()
{
        rte_ether_format_addr(NULL, 0, NULL);
        rte_pmd_i40e_set_vf_mac_addr(0, 0, NULL);
}

I want to use two symbols, one from librte_net and one from i40e net rte pmd.

1. PLAIN compilation: complains about both of them, as expected:

$ ${CROSS}-g++ -march=armv8.1-a -o bin-app app.c
/tmp/ccUac7fS.o: In function `main':
app.c:(.text+0x114): undefined reference to `rte_ether_format_addr'
app.c:(.text+0x124): undefined reference to `rte_pmd_i40e_set_vf_mac_addr'
collect2: error: ld returned 1 exit status

2. PKGCONFIG asked to fill dependencies adds them for dpdk lib/ but i40e rte pmd is still missing:

${CROSS}-g++ -march=armv8.1-a -o bin-app app.c $(pkg-config --libs libdpdk)
/tmp/ccYhiA3K.o: In function `main':
app.c:(.text+0x124): undefined reference to `rte_pmd_i40e_set_vf_mac_addr'
collect2: error: ld returned 1 exit status

3. WORKADOUND: which adds explicitly dependency for linker:

${CROSS}-g++ -march=armv8.1-a -o bin-app app.c $(pkg-config --libs libdpdk) -lrte_net_i40e

The borderline is that I don't want to add them explicitly, but rather pkg-config do this for me. This would be realized if driver's lib (which actually gets built as .so) was added to meson's dpdk_libraries variable:
my_lib_name = '_'.join(['rte', class, name])
shared_lib = shared_library(my_lib_name)
dpdk_libraries = [shared_lib] + dpdk_libraries
In such case $(pkg-config --libs libdpdk) would satisfy all dependencies.

My questions are:
1. Is there a better approach to this problem than one mentioned by me? Am I missing something?
2. Shall RTE PMD APIs of certain drivers be a part of dpdk default pkg-config configuration?

I have learned there used to be libdpdk.so but this is no longer applicable, also this is not a plugin-alike issue. So I hope I am not duplicating topics - I could not find anything resembling this one.

Regards,
Jakub

                 reply	other threads:[~2021-05-18 14:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CY4PR1801MB1911DD89AD702B22E775FB38D52C9@CY4PR1801MB1911.namprd18.prod.outlook.com \
    --to=jpalider@marvell.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.