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 DE95BA0032;
	Fri, 12 Nov 2021 22:48:45 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 1720C4113E;
	Fri, 12 Nov 2021 22:48:40 +0100 (CET)
Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com
 [209.85.208.174])
 by mails.dpdk.org (Postfix) with ESMTP id A2CEC40692;
 Fri, 12 Nov 2021 22:48:38 +0100 (CET)
Received: by mail-lj1-f174.google.com with SMTP id v15so21216410ljc.0;
 Fri, 12 Nov 2021 13:48:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=X8gVx2IHG5AOAvkwCD85HSCXNw60KEsgMx+g4CRtPrM=;
 b=mbGMlmY9OpptK2GVZVUJhPXVX0ZsV5rHCPzpYjhm0iMZTFGUs3QApAdO9AlogmPQB5
 yRMKDHK33kk9WB6okzXgUB8T3LDTLLwo5lnCkG6rBz6KPGQVCo6lkKHZOY4bJPDQ5KL+
 HsXrSzrfQQ0WjjRF/wP1mAcZT8ihXy+DJi7/vSlh8lgiibWXLcEfMvhQAKh69jfxvHPo
 ZeTSoisQNkog/qEhdVfwfVRumLYNuSgEyuPiMWk1hsXXap1okzlr1McAUj0DWiaRJJOh
 TzG0/SoOVsiQ9ZSbdkJYxjJ4wy7eVfnDYzZALUvIS/LuozgAMH0b8lHJnCzQXnXczrqO
 XI5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=X8gVx2IHG5AOAvkwCD85HSCXNw60KEsgMx+g4CRtPrM=;
 b=tqMGKbMsOFT4f8lYEgeJlna6VdaDBWJ+DXQv/nekdrmFvs23Dq4PHYxTxnH/bNXEZe
 /cDWqk3+yL9B0CdW/xha69jT0IzGTUY/P/g8f7PjzlXGebZsTryw5COmPHYJmH0uhxFM
 pLCKNdC6xEDJsiKqWbQ3pattocsdZ16ySkV27M7sYVxG8BHDRbWIoOS57cTKBgGORvSN
 2ETv9Uz5xxarvj05BTGDB7lFMuKDsrYQxUjaFABOwRVgXlg7viuDJm94Q13kfgVWi2zB
 96ocIl5jV1VBKM5q9E59kWbctVI0HKVczHrcyFp001opFVHqfg7qmJFSqyGSDtrAtd6y
 60WQ==
X-Gm-Message-State: AOAM533X9+EEZWk8l5TQ90cn6PGUAlhYEwvV45X3aR8WS8IKazkKLQyA
 Ok7L5D/vJg4CnX4YLqgxP9+9dhZPSPI=
X-Google-Smtp-Source: ABdhPJyt0f82BSrzD3aYVYbZlyRtaF+O/yvrf3EaA+NNWXyYNydkAkpBOd5xLm2qOVoz46/Tez8aZg==
X-Received: by 2002:a05:651c:a0f:: with SMTP id
 k15mr19005913ljq.298.1636753718148; 
 Fri, 12 Nov 2021 13:48:38 -0800 (PST)
Received: from sovereign.. (broadband-37-110-65-23.ip.moscow.rt.ru.
 [37.110.65.23])
 by smtp.gmail.com with ESMTPSA id l5sm647917ljh.66.2021.11.12.13.48.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 12 Nov 2021 13:48:37 -0800 (PST)
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
To: dev@dpdk.org
Cc: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>, stable@dpdk.org,
 bruce.richardson@intel.com,
 Konstantin Ananyev <konstantin.ananyev@intel.com>,
 Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Subject: [PATCH 1/3] config/x86: skip GNU binutils bug check for LLVM
Date: Sat, 13 Nov 2021 00:48:24 +0300
Message-Id: <20211112214826.333853-2-dmitry.kozliuk@gmail.com>
X-Mailer: git-send-email 2.29.3
In-Reply-To: <20211112214826.333853-1-dmitry.kozliuk@gmail.com>
References: <20211112214826.333853-1-dmitry.kozliuk@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
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

AVX512 was disabled when GNU binutils were missing or had a known bug,
even if LLVM binutils were used for the build,
because binutils-avx512-check.sh was invoked regardless and failed.
In particular, this was the case for FreeBSD with clang (default).
Run the check only when GNU binutils are used.

Fixes: 68b1f1cda5b4 ("build: check AVX512 rather than binutils version")
Cc: stable@dpdk.org
Cc: bruce.richardson@intel.com

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
 config/x86/meson.build | 7 ++++---
 lib/acl/meson.build    | 2 +-
 lib/fib/meson.build    | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/config/x86/meson.build b/config/x86/meson.build
index 29f3dea181..603359e55a 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -2,9 +2,10 @@
 # Copyright(c) 2017-2020 Intel Corporation
 
 # get binutils version for the workaround of Bug 97
-if not is_windows
-    binutils_ok = run_command(binutils_avx512_check)
-    if binutils_ok.returncode() != 0 and cc.has_argument('-mno-avx512f')
+binutils_ok = true
+if not is_windows and (is_linux or cc.get_id() == 'gcc')
+    binutils_ok = run_command(binutils_avx512_check).returncode() == 0
+    if not binutils_ok and cc.has_argument('-mno-avx512f')
         machine_args += '-mno-avx512f'
         warning('Binutils error with AVX512 assembly, disabling AVX512 support')
     endif
diff --git a/lib/acl/meson.build b/lib/acl/meson.build
index f3dc513846..fbe17f9454 100644
--- a/lib/acl/meson.build
+++ b/lib/acl/meson.build
@@ -36,7 +36,7 @@ if dpdk_conf.has('RTE_ARCH_X86')
     # compile AVX512 version if:
     # we are building 64-bit binary AND binutils can generate proper code
 
-    if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok.returncode() == 0
+    if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
 
         # compile AVX512 version if either:
         # a. we have AVX512 supported in minimum instruction set
diff --git a/lib/fib/meson.build b/lib/fib/meson.build
index 593c8c47c8..9b848d0841 100644
--- a/lib/fib/meson.build
+++ b/lib/fib/meson.build
@@ -14,7 +14,7 @@ deps += ['rib']
 
 # compile AVX512 version if:
 # we are building 64-bit binary AND binutils can generate proper code
-if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok.returncode() == 0
+if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
     # compile AVX512 version if either:
     # a. we have AVX512F supported in minimum instruction set baseline
     # b. it's not minimum instruction set, but supported by compiler
-- 
2.29.3