DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: luca.boccassi@gmail.com, aconole@redhat.com,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH 5/6] build: symlink drivers to library directory
Date: Tue, 12 Dec 2017 16:59:39 +0000	[thread overview]
Message-ID: <20171212165940.272969-6-bruce.richardson@intel.com> (raw)
In-Reply-To: <20171212165940.272969-1-bruce.richardson@intel.com>

With the introduction of bus drivers, we now have a situation where
driver libraries will start to depend upon each other. Because of this,
the driver libs need to be discoverable by the dynamic loader.

There are three options to fix this:
1. Force the user to put the $libdir/dpdk/drivers folder into their
	library path.
2. Move all libraries from drivers sub-directory to $libdir.
3. Symlink all libraries from the subfolder to the main library dir.

Option 1 is not great for usability or distro packaging, and option 2
means that we can't have EAL load all drivers from a known path
automatically (as it would error out on non-PMD libs), so option 3 was
chosen as the best fix. The only downside is that on a "ninja uninstall"
the symlinks are not removed, as they are unknown to meson/ninja.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 buildtools/symlink-drivers-solibs.sh | 16 ++++++++++++++++
 meson.build                          |  7 +++++++
 2 files changed, 23 insertions(+)
 create mode 100644 buildtools/symlink-drivers-solibs.sh

diff --git a/buildtools/symlink-drivers-solibs.sh b/buildtools/symlink-drivers-solibs.sh
new file mode 100644
index 000000000..f2657afe8
--- /dev/null
+++ b/buildtools/symlink-drivers-solibs.sh
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+#
+# Copyright(c) 2017 Intel Corporation.
+# All rights reserved.
+#
+# SPDX-License-Identifier:        BSD-3-Clause
+
+# post-install script for meson/ninja builds to symlink the PMDs stored in
+# $libdir/dpdk/drivers/ to $libdir. This is needed as some PMDs depend on
+# others, e.g. PCI device PMDs depending on the PCI bus driver.
+
+# parameters to script are paths relative to install prefix:
+# 1. directory containing driver files e.g. lib64/dpdk/drivers
+# 2. directory for installed regular libs e.g. lib64
+ln -sf ${DESTDIR}/${MESON_INSTALL_PREFIX}/$1/* ${DESTDIR}/${MESON_INSTALL_PREFIX}/$2
diff --git a/meson.build b/meson.build
index 35d303d5a..04eea721d 100644
--- a/meson.build
+++ b/meson.build
@@ -77,6 +77,13 @@ configure_file(output: build_cfg,
 # them.
 dpdk_drivers = ['-Wl,--whole-archive'] + dpdk_drivers + ['-Wl,--no-whole-archive']
 
+# driver .so files often depend upon the bus drivers for their connect bus,
+# e.g. ixgbe depends on librte_bus_pci. This means that the bus drivers need
+# to be in the library path, so symlink the drivers from the main lib directory.
+meson.add_install_script('buildtools/symlink-drivers-solibs.sh',
+		driver_install_path,
+		get_option('libdir'))
+
 pkg = import('pkgconfig')
 pkg.generate(name: meson.project_name(),
 	filebase: 'lib' + meson.project_name().to_lower(),
-- 
2.14.3

  parent reply	other threads:[~2017-12-12 17:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12 16:59 [dpdk-dev] [PATCH 0/6] next-build: create both static and shared libs Bruce Richardson
2017-12-12 16:59 ` [dpdk-dev] [PATCH 1/6] build: remove library special cases Bruce Richardson
2017-12-12 16:59 ` [dpdk-dev] [PATCH 2/6] eal: fix list of source files to meson build Bruce Richardson
2017-12-12 16:59 ` [dpdk-dev] [PATCH 3/6] build: build all libs and drivers as both static and shared Bruce Richardson
2017-12-12 16:59 ` [dpdk-dev] [PATCH 4/6] build: change default library type to static Bruce Richardson
2017-12-12 16:59 ` Bruce Richardson [this message]
2017-12-12 16:59 ` [dpdk-dev] [PATCH 6/6] examples: enable linking examples both static and shared Bruce Richardson
2017-12-12 17:14 ` [dpdk-dev] [PATCH 0/6] next-build: create both static and shared libs Bruce Richardson
2017-12-13 12:10   ` Luca Boccassi
2017-12-13 13:28     ` Bruce Richardson
2017-12-18 18:05     ` Aaron Conole
2017-12-19 10:07       ` Bruce Richardson
2017-12-13 12:11 ` Luca Boccassi
2017-12-15 12:02   ` Bruce Richardson

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=20171212165940.272969-6-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=aconole@redhat.com \
    --cc=dev@dpdk.org \
    --cc=luca.boccassi@gmail.com \
    /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).