From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 312D7A0A0C;
	Thu,  1 Jul 2021 14:34:46 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id D601740141;
	Thu,  1 Jul 2021 14:34:45 +0200 (CEST)
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [216.205.24.124])
 by mails.dpdk.org (Postfix) with ESMTP id 8FE684003E
 for <dev@dpdk.org>; Thu,  1 Jul 2021 14:34:43 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1625142882;
 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=JeIlrclR5MDEWdhp6OOYUp3cydd0U1Pbg5DubZPVjxw=;
 b=BB47OBKbdLKLeatKeGn6SF+8uUBDc/tUbvE3Yhd9m08mx46+pV9h2oFqL8VlarneEqEYyH
 FU8/hU55LF1LIgwC4n8SnQ5yeIjVCqtiBYmcyZlcaty1PpAwAu0Y+nZi2QVrZjBQgu7hza
 C64ORMu6B8rUwfLTJqRJQYdl/hyFizE=
Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com
 [209.85.221.197]) (Using TLS) by relay.mimecast.com with ESMTP id
 us-mta-349-OpYvaSZBOVStfFetnX4pnw-1; Thu, 01 Jul 2021 08:34:39 -0400
X-MC-Unique: OpYvaSZBOVStfFetnX4pnw-1
Received: by mail-vk1-f197.google.com with SMTP id
 z16-20020a0561221490b029024cf7dcad61so1207916vkp.14
 for <dev@dpdk.org>; Thu, 01 Jul 2021 05:34:39 -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=JeIlrclR5MDEWdhp6OOYUp3cydd0U1Pbg5DubZPVjxw=;
 b=aEED22Le9jxLAXCb5zTKDBPmGsfgLtIuKpRgSLF6T+KpAi+ZqAd1cngfS49pFKdooP
 z8MtsJYHOAByp9F3zczNDKnrJqxJpf5qMIvQJOghNmiFnFccW6yDJRifAz5AjqYa5F+d
 Kz5sVpVdgzWYplDpzmYKvwoi+qieZwvWxP403Rs/1LgYa89lGZ+agq99oFL6A1baNwyN
 jwxr6Oc6MzqG/oQLb7WF2ZA+GWBWmaWrhLd9xicuwNwTEug4ZaRBWmtd05cRjrJQa5nb
 H0zEANBGJrmrye7A/DEd+fYx04eKCG5ii/vpjq9mSbJj9ReCqWwkuIDsuKsNHmHaaOdN
 lTeg==
X-Gm-Message-State: AOAM533EMmgDoiLIGfzwg9BvUu6hvj22wlXtvRi3Ki/T3haXNuzuBaKI
 hhm21KQ+lxhSVBoDxs9MTFyVVB+BYNSS7DcyeqNuIZWG2fFnZ4CeQRan2Gss6PlUY1JneezMO9p
 ivvdBsdjLavWTcfNy3Tg=
X-Received: by 2002:ab0:1484:: with SMTP id d4mr25135803uae.86.1625142878745; 
 Thu, 01 Jul 2021 05:34:38 -0700 (PDT)
X-Google-Smtp-Source: ABdhPJwKW9/FS8n1a39PmOOA2M0lzwQmvdBHl7Am5oMEUQe2JtyzZZokafBD/L8WmJ0eKzrWW/EYwOLIUE1KVjEoX2w=
X-Received: by 2002:ab0:1484:: with SMTP id d4mr25135773uae.86.1625142878577; 
 Thu, 01 Jul 2021 05:34:38 -0700 (PDT)
MIME-Version: 1.0
References: <20210527152510.1551026-1-andrew.rybchenko@oktetlabs.ru>
 <20210618134032.1922012-20-andrew.rybchenko@oktetlabs.ru>
 <CAJFAV8xhbDtLjQ-mEjU=WQ3qQ9E=DFO+zRqWFfY_E5pjTUu9YA@mail.gmail.com>
 <23888533.A65Z59arLz@thomas>
 <8a3c653e-65db-fc48-253c-db78037635f3@oktetlabs.ru>
In-Reply-To: <8a3c653e-65db-fc48-253c-db78037635f3@oktetlabs.ru>
From: David Marchand <david.marchand@redhat.com>
Date: Thu, 1 Jul 2021 14:34:27 +0200
Message-ID: <CAJFAV8xnBu1RZAhsYWefS=DmKN8hB9kFSgnmvufFVHNdc-qhaw@mail.gmail.com>
To: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>, 
 Bruce Richardson <bruce.richardson@intel.com>
Cc: Thomas Monjalon <thomas@monjalon.net>, dev <dev@dpdk.org>, 
 Igor Romanov <igor.romanov@oktetlabs.ru>, Andy Moreton <amoreton@xilinx.com>, 
 Ivan Malov <ivan.malov@oktetlabs.ru>
Authentication-Results: relay.mimecast.com;
 auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Subject: Re: [dpdk-dev] [PATCH v3 19/20] net/sfc: support flow action COUNT
 in transfer rules
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Thu, Jul 1, 2021 at 11:22 AM Andrew Rybchenko
<andrew.rybchenko@oktetlabs.ru> wrote:
> The build works fine for me on FC34, but it has
> libatomic-11.1.1-3.fc34.x86_64 installed.

I first produced the issue on my "old" FC32.
Afaics, for FC33 and later, gcc now depends on libatomic and the
problem won't be noticed.
FC32 and before are EOL, but I then reproduced the issue on RHEL 8
(and Intel CI reported it on Centos 8 too).


>
> I'd like to understand what we're trying to solve here.
> Are we trying to make meson to report the missing library
> correctly?
>
> If so, I think I can do simple check using cc.links()
> which will fail if the library is not found. I'll
> test that it works as expected if the library is not
> completely installed.
>

I tried below diff, and it works for me.
"works" as in net/sfc gets disabled without libatomic installed:

diff --git a/drivers/net/sfc/meson.build b/drivers/net/sfc/meson.build
index 32b58e3d76..8d62aad774 100644
--- a/drivers/net/sfc/meson.build
+++ b/drivers/net/sfc/meson.build
@@ -15,6 +15,7 @@ endif
 if (arch_subdir != 'x86' or not dpdk_conf.get('RTE_ARCH_64')) and
(arch_subdir != 'arm' or not
host_machine.cpu_family().startswith('aarch64'))
     build = false
     reason = 'only supported on x86_64 and aarch64'
+    subdir_done()
 endif

 extra_flags = []
@@ -46,6 +47,14 @@ endif

 # for gcc compiles we need -latomic for 128-bit atomic ops
 if cc.get_id() == 'gcc'
+    code = '''#include <stdio.h>
+    void main() { printf("Atomilink me.\n"); }
+    '''
+    if not cc.links(code, args: '-latomic', name: 'libatomic link check')
+        build = false
+        reason = 'missing dependency, "libatomic"'
+        subdir_done()
+    endif
     ext_deps += cc.find_library('atomic')
 endif



-- 
David Marchand