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 099CEA04AC; Tue, 1 Sep 2020 18:10:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 161FC1C0B1; Tue, 1 Sep 2020 18:10:52 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id 780F21C0B0 for ; Tue, 1 Sep 2020 18:10:50 +0200 (CEST) Received: from mail-ua1-f72.google.com ([209.85.222.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kD8ry-0000Yo-1K for dev@dpdk.org; Tue, 01 Sep 2020 16:10:50 +0000 Received: by mail-ua1-f72.google.com with SMTP id p65so267129uap.22 for ; Tue, 01 Sep 2020 09:10:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Lhr6PYRRLMa1qDST8Tqk2LvwKr3W26XRRIN+U56gG7A=; b=pEg9cTfOqkJVuL7TdR+B3yC2sJg+0YnrYivupvDqZkN91oB8y4lMFIwJGPPm35Xzdj 8pgDIw7pdcft9LveYemTITT4REVDcK5KtPOgefE2E9r23Ki7qogiGDaq3GxIyHLOCUvL mL0ocfKRu2Q1kwWnhmXnH4NZfvosKjnxEhOjJa5e6AeDIuTuvOocJdptWCZ/aGgo3MgI qg1diILP5rLsjK/jFLdM7k0jgltOvTNv3kNM8iyW7bAyfNk06J16xoo8h58OlwEXyXv5 HSTP/7s3ooO5Sb3C+zZyIVOnQVORO1E0bJc2hjKq3AnUCDrMnJ92TJvWwgbe7Rbzq644 geVQ== X-Gm-Message-State: AOAM530nG/EOM2kJZ5xVr2MBL+cRivP8o1AIGYfhzcFJZfpRS4eH1Es8 CuUAmnFzIOQhvqI47LHjxEu/XPZmzyhCEbB5hO4DaOZoyaSnZNF8ndR3opqnlvz8CGGCjNkSkmL dwoMOAHqYDM8CGY6qm6FGgnhNfOGNXgnxMtSY X-Received: by 2002:a67:8e88:: with SMTP id q130mr2105820vsd.197.1598976648917; Tue, 01 Sep 2020 09:10:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7HaefBh0CPuQ0odhh45Z/xrZ74aPOBg8TZL4wn5QgkDJQh4a0d7m9SGzS+hkNyuehtff6MiN9TKKGPZC42Po= X-Received: by 2002:a67:8e88:: with SMTP id q130mr2105790vsd.197.1598976648624; Tue, 01 Sep 2020 09:10:48 -0700 (PDT) MIME-Version: 1.0 References: <20200901155847.3528114-1-christian.ehrhardt@canonical.com> In-Reply-To: <20200901155847.3528114-1-christian.ehrhardt@canonical.com> From: Christian Ehrhardt Date: Tue, 1 Sep 2020 18:10:22 +0200 Message-ID: To: dev Cc: Luca Boccassi Content-Type: text/plain; charset="UTF-8" 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, Sep 1, 2020 at 5:58 PM 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. It worked on top of 19.11.4 but the pipeline on top of master complains. I beg your pardon that I don't have the time left today for a v2, but as an RFC it should already be enough to get the discussion started on the topic. > The result is libfdt in pkg-config now showing up as: > Libs.private: -pthread -lm -ldl -lnuma -lfdt -lpcap > > 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(-) > > 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..de6e03ca65 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_libnuma == 0 > build = false > reason = 'missing dependency, "libfdt"' > subdir_done() > diff --git a/drivers/raw/ifpga/meson.build b/drivers/raw/ifpga/meson.build > 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 > > -dep = dependency('libfdt', required: false) > -if not dep.found() > - dep = cc.find_library('libfdt', required: false) > -endif > -if not dep.found() > +if has_libnuma == 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') > > -- > 2.28.0 > -- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd