DPDK patches and discussions
 help / color / mirror / Atom feed
From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
To: dev <dev@dpdk.org>
Cc: Luca Boccassi <bluca@debian.org>,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] Overlinking in PMDs
Date: Thu, 18 Apr 2019 16:34:30 +0200	[thread overview]
Message-ID: <CAATJJ0+B-XeW57ze2yNV5tbvbCs1dcoZUQuQV8tPeEO66s=rRA@mail.gmail.com> (raw)

Hi,
on a recent 18.11.1 build I saw again that we are overlinking a lot still [1].
Some might be important and I'd not want to touch any *inner* links
inside DPDK at this time.
But it seems about everything is unconditionally linked to generic libs as well.

Here one example from a (meson) build:
# only start group and soname set are in as-needed
 -Wl,--as-needed -shared -fPIC -Wl,--start-group
 -Wl,-soname,librte_pmd_netvsc.so.18.11 -Wl,--no-as-needed
# generic libs unconditionally link
 -pthread -lm -ldl -lnuma
...
# internal libs
-Wl,-z,relro -Wl,-z,now l
     ib/librte_ethdev.so.18.11 lib/librte_eal.so.18.11
lib/librte_kvargs.so.18.11 lib/librte_net.so.18.11
lib/librte_mbuf.so.18.11 lib/librte_mempool.so.18.11
lib/librte_ring.so.18.11 lib/l
     ibrte_cmdline.so.18.11 drivers/librte_bus_pci.so.18.11
lib/librte_pci.so.18.11 drivers/librte_bus_vdev.so.18.11
drivers/librte_bus_vmbus.so.18.11 -Wl,--version-
...
# bsd is even more special it seems
/usr/lib/x86_64-linux-gnu/libbsd.so
# end group
-Wl,--end-group
...

I wonder if we really should not at least put "-pthread -lm -ldl
-lnuma" into as-needed as well.
Not sure why libbsd is so special at the end, but maybe if possible also there.

I'd assume that about everything links into rte_eal and that will link
out to the others as really needed then, that would look much cleaner
than hard depends from all the libs right?

I must admit I don't clearly see where the [no-]as-needed comes from
in meson build and for example [2] doesn't really explain why
no-as-needed was added.

[1]: http://paste.ubuntu.com/p/yT4Phz7sg2/
[2]: https://git.dpdk.org/dpdk/diff/config/meson.build?id=57ae0ec6


-- 
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd

             reply	other threads:[~2019-04-18 14:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18 14:34 Christian Ehrhardt [this message]
2019-04-18 14:34 ` Christian Ehrhardt

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='CAATJJ0+B-XeW57ze2yNV5tbvbCs1dcoZUQuQV8tPeEO66s=rRA@mail.gmail.com' \
    --to=christian.ehrhardt@canonical.com \
    --cc=bluca@debian.org \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /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).