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 4A25CA04BF; Wed, 2 Sep 2020 17:06:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 252071C07E; Wed, 2 Sep 2020 17:06:10 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 1C72CDE0 for ; Wed, 2 Sep 2020 17:06:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599059167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4TNfxZZlvhIF8Hx33yMjUaRSBZKJkRtkHu4jsZcXv60=; b=BE+R+pVFMzhztNWi67emsMkcyzaDS97JSuouDDo5PXBdCS3h+qpK6KWDs3YBeUnBDGZ6YF 3fV1JP9ez8Bm7ZEvjrr86MWqKcEWRQc9DUjmfJNMrQuiBapfa0ljWhTykd+L3xqLvxF0X/ UQlqROxt+r3N5rwV37rwR8x53uraJz8= Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-568-0g-cbYEXNh6AYT0aEwqZmQ-1; Wed, 02 Sep 2020 11:06:04 -0400 X-MC-Unique: 0g-cbYEXNh6AYT0aEwqZmQ-1 Received: by mail-vs1-f71.google.com with SMTP id f129so251980vsc.0 for ; Wed, 02 Sep 2020 08:06:04 -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=4TNfxZZlvhIF8Hx33yMjUaRSBZKJkRtkHu4jsZcXv60=; b=t3JV0KnANHBwqgjp60EINnXo+n0PJ29H/xYacHlurRxzJJi53zO/D86NWJj+xg02EK jwI2ZujjuKv+J7zYDu6XzCQONLchiNCwmfEt4n+sqs+9MC5Akm9KFEPVRSvGAIOkOTFV 8doYiTNRl1mAwkEeWgosD9MCwbuEemZ2xYuV47ptaAz6Sy70uOLP/dAstIGOORYEoRU2 3zKDZ9WN4qGpjwSeW8Hu9s7XgaD4fJcURXpHTMjfKvx9CCqRhwPtCWWSSBbNMwdcUI3I Y21/krGemIHfK4g2kQunNQpf5jKr38Mh+g/Hu4MUnQMcM7oCHbqC9y8xmE9ScsVrMz0Z NC1A== X-Gm-Message-State: AOAM530XIp7YBngx2LKNoC8q+Ems0d3BltxT4wZL4Gvjshfx9qYTTppx WRbDEJ9xzhP+I1i1LInygAJ5eppyffzsg75cFawcMh/aH9RtC5SjUjZwV9shXoK629J++eOkwsf XqwtCUrNO5uOjigFF0RA= X-Received: by 2002:a67:68c2:: with SMTP id d185mr1041582vsc.65.1599059163508; Wed, 02 Sep 2020 08:06:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBhCVUux9wwEVjZM5xNs7ZmeJzpw3k43Lv+fNLvwonDggCuEEl8fAZsMmLroaMws5qjDoRJHtsDowsdXdV/7s= X-Received: by 2002:a67:68c2:: with SMTP id d185mr1041540vsc.65.1599059163137; Wed, 02 Sep 2020 08:06:03 -0700 (PDT) MIME-Version: 1.0 References: <20200902123903.803110-1-christian.ehrhardt@canonical.com> In-Reply-To: <20200902123903.803110-1-christian.ehrhardt@canonical.com> From: David Marchand Date: Wed, 2 Sep 2020 17:05:52 +0200 Message-ID: To: Christian Ehrhardt Cc: dev , Bruce Richardson , Thomas Monjalon , Luca Boccassi Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2] 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 2, 2020 at 2:39 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. > > 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 > Reviewed-by: Bruce Richardson > --- > 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..83611cfead 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 not has_libfdt "not" expects a boolean, this can be seen in Travis and OBS builds for Debian (at least 10 and Next). OVS robot travis: https://travis-ci.com/github/ovsrobot/dpdk/jobs/380310104#L721 My OBS: [ 143s] Compiler for C supports arguments -mavx2: YES (cached) [ 143s] Message: drivers/net/ice: Defining dependency "pmd_ice" [ 143s] Message: drivers/net/igc: Defining dependency "pmd_igc" [ 143s] [ 143s] ../drivers/net/ipn3ke/meson.build:12:7: ERROR: Argument to "not" is not a boolean. [ 143s] dh_auto_configure: error: cd obj-x86_64-linux-gnu && LC_ALL=C.UTF-8 meson .. --wrap-mode=nodownload --buildtype=plain --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=lib/x86_64-linux-gnu --libexecdir=lib/x86_64-linux-gnu --includedir=include/dpdk -Dper_library_versions=false -Dinclude_subdir_arch=../x86_64-linux-gnu/dpdk -Dmachine=default -Dkernel_dir=/lib/modules/5.7.0-3-amd64 -Denable_kmods=true returned exit code 1 [ 143s] make[2]: *** [debian/rules:114: override_dh_auto_configure] Error 25 [ 143s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 143s] make[1]: *** [debian/rules:92: build] Error 2 [ 143s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 143s] make: *** [debian/rules:96: binary] Error 2 -- David Marchand