From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5627EA04BB; Wed, 2 Sep 2020 13:25:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B03E2E07; Wed, 2 Sep 2020 13:25:09 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 72A93255 for ; Wed, 2 Sep 2020 13:25:08 +0200 (CEST) IronPort-SDR: 2bEaVcRbHVswAZ0vUITMtlu81qYfqmJ2d/LqcplKTCm8whAm6UiLi6plfDacNIU+PSvh/BEdXa D+F/W05xKUVg== X-IronPort-AV: E=McAfee;i="6000,8403,9731"; a="221584140" X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="221584140" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 04:25:07 -0700 IronPort-SDR: lUZ6hXPE28WSFM9xdAmKfeDVZYMBndn/j8aNNV7x7YzMSO9F2qGhYlrXifU0Z+1ChCQs4ergtC tF4Y09atpbjg== X-IronPort-AV: E=Sophos;i="5.76,381,1592895600"; d="scan'208";a="477602151" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.3.68]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 02 Sep 2020 04:25:05 -0700 Date: Wed, 2 Sep 2020 12:25:02 +0100 From: Bruce Richardson To: Christian Ehrhardt Cc: dev , Thomas Monjalon , Luca Boccassi Message-ID: <20200902112502.GD1064@bricha3-MOBL.ger.corp.intel.com> References: <20200902111030.731593-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200902111030.731593-1-christian.ehrhardt@canonical.com> Subject: Re: [dpdk-dev] [PATCH] avoid libfdt checks adding full paths to pkg-config 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Sep 02, 2020 at 01:10:30PM +0200, Christian Ehrhardt wrote: > The checks for libfdt try dependency() first which would only work if > a pkg-config would be present but libfdt has none. > Then it probes for the lib path itself via cc.find_library. > > But later it adds the result of either probe to ext_deps which ends up > in build and also the resulting pkg-config to contain toolchain versioned > paths in Libs.private like: > /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libfdt.so > which obviously breaks on toolchain updates. > > In general libs used multiple times - ipn3ke + ifpga in this case - are > checked centrally in config/meson.build so move it there and fix the > adding of dependencies to not use the full file path. > > The result is libfdt in pkg-config now showing up as: > Libs.private: -pthread -lm -ldl -lnuma -lfdt -lpcap > > Signed-off-by: Christian Ehrhardt > Reviewed-by: Luca Boccassi > --- > config/meson.build | 9 +++++++++ > drivers/net/ipn3ke/meson.build | 6 +----- > drivers/raw/ifpga/meson.build | 7 +------ > 3 files changed, 11 insertions(+), 11 deletions(-) > > diff --git a/config/meson.build b/config/meson.build > index cff8b33dd2..1c8317e750 100644 > --- a/config/meson.build > +++ b/config/meson.build > @@ -150,6 +150,15 @@ if numa_dep.found() and cc.has_header('numaif.h') > dpdk_extra_ldflags += '-lnuma' > endif > > +has_libfdt = 0 > +fdt_dep = cc.find_library('libfdt', required: false) > +if fdt_dep.found() and cc.has_header('fdt.h') > + dpdk_conf.set10('RTE_HAS_LIBFDT', true) > + has_libfdt = 1 > + add_project_link_arguments('-lfdt', language: 'c') > + dpdk_extra_ldflags += '-lfdt' > +endif > + > # check for libbsd > libbsd = dependency('libbsd', required: false) > if libbsd.found() > diff --git a/drivers/net/ipn3ke/meson.build b/drivers/net/ipn3ke/meson.build > index ec9cb7daf0..d5000d807c 100644 > --- a/drivers/net/ipn3ke/meson.build > +++ b/drivers/net/ipn3ke/meson.build > @@ -9,11 +9,7 @@ > # rte_eth_switch_domain_free() > # > > -dep = dependency('libfdt', required: false) > -if not dep.found() > - dep = cc.find_library('libfdt', required: false) > -endif > -if not dep.found() > +if has_libfdt == 0 Minor nit, for readability, I'd suggest using "not has_libfdt", but what is here can work too. > build = false > reason = 'missing dependency, "libfdt"' > subdir_done() > diff --git a/drivers/raw/ifpga/meson.build b/drivers/raw/ifpga/meson.build > index 05a1711b5d..da454b1942 100644 > --- a/drivers/raw/ifpga/meson.build > +++ b/drivers/raw/ifpga/meson.build > @@ -1,11 +1,7 @@ > # SPDX-License-Identifier: BSD-3-Clause > # Copyright(c) 2018 Intel Corporation > > -dep = dependency('libfdt', required: false) > -if not dep.found() > - dep = cc.find_library('libfdt', required: false) > -endif > -if not dep.found() > +if has_libfdt == 0 > build = false > reason = 'missing dependency, "libfdt"' > subdir_done() > @@ -16,7 +12,6 @@ objs = [base_objs] > > deps += ['ethdev', 'rawdev', 'pci', 'bus_pci', 'kvargs', > 'bus_vdev', 'bus_ifpga', 'net', 'pmd_i40e', 'pmd_ipn3ke'] > -ext_deps += dep > > sources = files('ifpga_rawdev.c') > > -- Reviewed-by: Bruce Richardson