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 36FA1A04AC; Tue, 1 Sep 2020 18:16:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0C0F91C0B1; Tue, 1 Sep 2020 18:16:18 +0200 (CEST) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id E1CD41C0AE for ; Tue, 1 Sep 2020 18:16:15 +0200 (CEST) Received: by mail-wm1-f68.google.com with SMTP id a9so1763070wmm.2 for ; Tue, 01 Sep 2020 09:16:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:content-transfer-encoding:user-agent:mime-version; bh=FcnaovnN3DGUsvqjUVQznFjAYasyr125bqLmDI9jz78=; b=lOP9rD9IzKKqzgU5zXZs9Rvoz6/ae7lyUtS2g/TtX959khGt5fQf5s9i1Unl665vL+ K1PJGg3r1NNQkeKk3TOk3aW3kBkEsT7qvMbNJaAQELG2CtEgluZ7ertXJOn1iajg7g3k o1JjQF8VMP++4tE3BureZGqfGV8E7ZCfjurzOGNPyt6CH6P7K79lvN5IyNzem16ehK4t ckOt1CKj2IdouBfBGwS43yjfSSF2Own9NiuwnjUpH4b2jt2elD0C55gBoyDNwLcroo7a sSb+m7V/UOYt9Gtiij3o7vY1JBNyvIqbRXmyhtd34+3EqHtmRZaOnELy3ODlUH4OVy9P aiLQ== X-Gm-Message-State: AOAM532N+mS/nx5ODxmImuPim1PuJBQXwjT5GsycLarLX46ML+DDEaCm QZsABHjfMLNJky9ypZJN14s= X-Google-Smtp-Source: ABdhPJxrjT2T3GeQnXqiZygVOtB5IdRYJRcnQ3kCIA/QSwPMKLkzlNyxIY7lRlvg/Dx7kQmYm11KhA== X-Received: by 2002:a1c:2742:: with SMTP id n63mr2453398wmn.24.1598976975602; Tue, 01 Sep 2020 09:16:15 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id c14sm2716134wrv.12.2020.09.01.09.16.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 09:16:14 -0700 (PDT) Message-ID: <9bf44dac86b43740e608b8592a0696c07cc2afa8.camel@debian.org> From: Luca Boccassi To: Christian Ehrhardt , dev Date: Tue, 01 Sep 2020 17:16:14 +0100 In-Reply-To: <20200901155847.3528114-1-christian.ehrhardt@canonical.com> References: <20200901155847.3528114-1-christian.ehrhardt@canonical.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Subject: Re: [dpdk-dev] [RFC] 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 Tue, 2020-09-01 at 17:58 +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. >=20 > 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. >=20 > 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. >=20 > The result is libfdt in pkg-config now showing up as: > Libs.private: -pthread -lm -ldl -lnuma -lfdt -lpcap >=20 > Signed-off-by: Christian Ehrhardt > --- > config/meson.build | 9 +++++++++ > drivers/net/ipn3ke/meson.build | 6 +----- > drivers/raw/ifpga/meson.build | 7 +------ > 3 files changed, 11 insertions(+), 11 deletions(-) >=20 > 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 +=3D '-lnuma' > endif > =20 > +has_libfdt =3D 0 > +fdt_dep =3D 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 =3D 1 > + add_project_link_arguments('-lfdt', language: 'c') > + dpdk_extra_ldflags +=3D '-lfdt' > +endif > + > # check for libbsd > libbsd =3D dependency('libbsd', required: false) > if libbsd.found() > diff --git a/drivers/net/ipn3ke/meson.build b/drivers/net/ipn3ke/meson.bu= ild > index ec9cb7daf0..de6e03ca65 100644 > --- a/drivers/net/ipn3ke/meson.build > +++ b/drivers/net/ipn3ke/meson.build > @@ -9,11 +9,7 @@ > # rte_eth_switch_domain_free() > # > =20 > -dep =3D dependency('libfdt', required: false) > -if not dep.found() > - dep =3D cc.find_library('libfdt', required: false) > -endif > -if not dep.found() > +if has_libnuma =3D=3D 0 > build =3D false > reason =3D 'missing dependency, "libfdt"' > subdir_done() > diff --git a/drivers/raw/ifpga/meson.build b/drivers/raw/ifpga/meson.buil= d > index 05a1711b5d..d4a128d67e 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 > =20 > -dep =3D dependency('libfdt', required: false) > -if not dep.found() > - dep =3D cc.find_library('libfdt', required: false) > -endif > -if not dep.found() > +if has_libnuma =3D=3D 0 if has_libfdt =3D=3D 0 ? Same above > build =3D false > reason =3D 'missing dependency, "libfdt"' > subdir_done() > @@ -16,7 +12,6 @@ objs =3D [base_objs] > =20 > deps +=3D ['ethdev', 'rawdev', 'pci', 'bus_pci', 'kvargs', > 'bus_vdev', 'bus_ifpga', 'net', 'pmd_i40e', 'pmd_ipn3ke'] > -ext_deps +=3D dep > =20 > sources =3D files('ifpga_rawdev.c') With the above correction, LGTM. Reviewed-by: Luca Boccassi --=20 Kind regards, Luca Boccassi