From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 190EFA0C4E; Thu, 22 Jul 2021 11:13:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 062514014D; Thu, 22 Jul 2021 11:13:04 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 71CA740040 for ; Thu, 22 Jul 2021 11:13:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626945181; 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=UCbdKIaJGV0MFXo8OoTPu5ht655S/EIADs7AgAHO098=; b=d6hk5YKQgSdvQMdmClyxC57qAAbXt8uwLXO6OE+7hDItQFyEub1I5EYVveOoSULNui9EEN n9N8ppPE2fmK9+YNOP9o/gQxq1JaAaOsblWqIT3vfWH5X5O5VKlzmIRl6kyqf/CfABPs5n r3nkb/+IcodX6LuY52YQoGJ5fZnTmGE= Received: from mail-ua1-f69.google.com (mail-ua1-f69.google.com [209.85.222.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-258-TpMmVTjdPpKDKx2DxXqm_w-1; Thu, 22 Jul 2021 05:13:00 -0400 X-MC-Unique: TpMmVTjdPpKDKx2DxXqm_w-1 Received: by mail-ua1-f69.google.com with SMTP id r10-20020ab0330a0000b02902a1547abcd1so2005815uao.16 for ; Thu, 22 Jul 2021 02:13:00 -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=UCbdKIaJGV0MFXo8OoTPu5ht655S/EIADs7AgAHO098=; b=M2QsyrBRNSZaY9kwkWCyUm/CGWrrYjYCUUBCZi5CUOvyQVr8JzraDcaCffMRov0gPM fEcVdR+a8Ukks7EqZo8MuGdpO1IymXKduvZP259qjzyFtBoeQVLlxeBT0TsWyFoHHQTz pMqagUuaMV+JBwICJl5Kx9K9WqKhQiYvMqTPK6hVwxpTbyEMDM4YoCsIgwMfKOOjR39z qvuXPOr2DyLstXL1Xlo8vDCIimOcooiN44vhN6DP0LWPjSfSUDoCssQKKztJMeJ+4vWj zXgsaCIkBOOg+jcd6xlGxdx7AuZmxuHMvwapByqDj1lPQBTL0Kk7bMeP/p/VCvSOEU1r 5OkA== X-Gm-Message-State: AOAM531Tv66VJOxYA56nyi3Asg7pGfKxkHMX+5lsCuSW3Cfu92QNhP7H BtDdKF4PlR75GvZ2TwKUooAeQnhFNgin+HULnZOPKKN9gvQzmZyRKvyNG82N66EtUrx2THRsJX2 oA8HcU5/7/Oso3E/N3lA= X-Received: by 2002:a1f:2608:: with SMTP id m8mr34610326vkm.17.1626945179651; Thu, 22 Jul 2021 02:12:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkdbV551nHh+ZIlOhfPu/kReR9kE+3Ve2AzPFtzzOB9WIqKTq+10LuFknwmGxZbSuk9jTTkXajElAVvUsFUXY= X-Received: by 2002:a1f:2608:: with SMTP id m8mr34610320vkm.17.1626945179456; Thu, 22 Jul 2021 02:12:59 -0700 (PDT) MIME-Version: 1.0 References: <20210722074651.1837621-1-andrew.rybchenko@oktetlabs.ru> <20210722074905.1838130-1-andrew.rybchenko@oktetlabs.ru> In-Reply-To: <20210722074905.1838130-1-andrew.rybchenko@oktetlabs.ru> From: David Marchand Date: Thu, 22 Jul 2021 11:12:48 +0200 Message-ID: To: Andrew Rybchenko Cc: dev , Ali Alnubani , Bruce Richardson 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 v2] net/sfc: fix broken build with clang 3.4.x X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Hi Andrew, On Thu, Jul 22, 2021 at 9:49 AM Andrew Rybchenko wrote: > > Old clanng requires libatomic as well as gcc. Avoid compiler name and s/nn/n/ > version based checks. Add custom test for 16-byte atomic operations > to find out if libatomic is required to build. > > Bugzilla ID: 760 > Fixes: 96fd2bd69b58 ("net/sfc: support flow action count in transfer rules") > > Signed-off-by: Andrew Rybchenko > --- > drivers/net/sfc/meson.build | 22 +++++++++++++++------- > 1 file changed, 15 insertions(+), 7 deletions(-) > > diff --git a/drivers/net/sfc/meson.build b/drivers/net/sfc/meson.build > index 4625859077..a1ad792b80 100644 > --- a/drivers/net/sfc/meson.build > +++ b/drivers/net/sfc/meson.build > @@ -40,8 +40,20 @@ foreach flag: extra_flags > endif > endforeach > > -# for gcc compiles we need -latomic for 128-bit atomic ops > -if cc.get_id() == 'gcc' > +# for gcc and old Clang compiles we need -latomic for 128-bit atomic ops > +atomic_check_code = ''' > +int main(void) > +{ > + __int128 a = 0; > + __int128 b; > + > + b = __atomic_load_n(&a, __ATOMIC_RELAXED); > + __atomic_store(&b, &a, __ATOMIC_RELAXED); > + __atomic_store_n(&b, a, __ATOMIC_RELAXED); > + return 0; > +} > +''' > +if not cc.links(atomic_check_code) Nice. > libatomic_dep = cc.find_library('atomic', required: false) > if not libatomic_dep.found() > build = false > @@ -51,11 +63,7 @@ if cc.get_id() == 'gcc' > > # libatomic could be half-installed when above check finds it but > # linkage fails > - atomic_link_code = ''' > - #include > - void main() { printf("libatomic link check\n"); } > - ''' > - if not cc.links(atomic_link_code, dependencies: libatomic_dep) > + if not cc.links(atomic_check_code, dependencies: libatomic_dep) > build = false > reason = 'broken dependency, "libatomic"' > subdir_done() > -- > 2.30.2 > Such a check will have its place in a common place if another component in DPDK starts to depend on libatomic in the future. But for now, this patch lgtm. Thanks. Acked-by: David Marchand -- David Marchand