From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 7998A1B161 for ; Tue, 12 Dec 2017 18:04:37 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2017 09:04:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,395,1508828400"; d="scan'208";a="1856203" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.223]) by fmsmga007.fm.intel.com with ESMTP; 12 Dec 2017 09:04:35 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: luca.boccassi@gmail.com, aconole@redhat.com, Bruce Richardson Date: Tue, 12 Dec 2017 16:59:39 +0000 Message-Id: <20171212165940.272969-6-bruce.richardson@intel.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171212165940.272969-1-bruce.richardson@intel.com> References: <20171212165940.272969-1-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH 5/6] build: symlink drivers to library directory X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Dec 2017 17:04:38 -0000 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 --- 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