DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Bruce Richardson <bruce.richardson@intel.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] eal: don't use default library path for static binaries
Date: Mon, 29 Jun 2020 15:53:41 +0100
Message-ID: <0f1ee479-b6be-23d8-15a5-daec8368d627@intel.com> (raw)
In-Reply-To: <20200626145957.722089-1-bruce.richardson@intel.com>

On 26-Jun-20 3:59 PM, Bruce Richardson wrote:
> When using statically linked DPDK binaries, the EAL checks the default PMD
> path and tries to load any drivers there, despite the fact that all drivers
> are normally linked into the binary.  This behaviour can cause issues if
> the PMD path and lib dir is configured to a non-standard location which is
> not in the ld.so.conf paths, e.g. a build with prefix set to a home
> directory location. In a case such as this, EAL will try and
> (unnecessarily) load the .so driver files but that load will fail as their
> dependent libraries, such as ethdev, for example, will not be found.
> Because of this, it is better if statically linked DPDK apps do not load
> drivers from the standard paths automatically. The user can always have
> this behaviour by explicitly specifying the path using -d flag, if so
> desired.
> Not loading the libraries automatically can also prevent potential issues
> with a user building and running a statically-linked DPDK binary based off
> a private copy of DPDK, while there exists on the same machine a
> system-wide installation of DPDK in the default locations. Without this
> change, the system-installed drivers will be loaded to the binary alongside
> the statically-linked drivers, which is not what the user would have
> intended.
> To detect whether we are in a statically or dynamically linked binary, we
> can have EAL try to get a dlopen handle to its own shared library, by
> calling dlopen with the RTLD_NOLOAD flag. This will return NULL if there is
> no such shared lib loaded i.e. the code is executing from a static library,
> or a handle to the lib if it is loaded.
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

+1, been bitten by this more than... ummm... well, a lot.

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>


  parent reply	other threads:[~2020-06-29 14:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26 14:59 Bruce Richardson
2020-06-26 17:05 ` Stephen Hemminger
2020-06-29  9:11   ` Bruce Richardson
2020-06-29  9:19     ` Bruce Richardson
2020-06-29 15:41       ` Stephen Hemminger
2020-06-29 16:15         ` Bruce Richardson
2020-07-05 18:01           ` Thomas Monjalon
2020-06-29 14:53 ` Burakov, Anatoly [this message]
2020-06-30 15:39 Pai G, Sunil

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:

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

  git send-email \
    --in-reply-to=0f1ee479-b6be-23d8-15a5-daec8368d627@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git