From patchwork Thu Jan 17 17:17:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Van Haaren, Harry" X-Patchwork-Id: 49924 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 80D142BD3; Thu, 17 Jan 2019 18:17:11 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 9BE552082 for ; Thu, 17 Jan 2019 18:17:10 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2019 09:17:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,489,1539673200"; d="scan'208";a="115468417" Received: from silpixa00399779.ir.intel.com (HELO silpixa00399779.ger.corp.intel.com) ([10.237.222.118]) by fmsmga007.fm.intel.com with ESMTP; 17 Jan 2019 09:17:08 -0800 From: Harry van Haaren To: dev@dpdk.org Cc: ferruh.yigit@intel.com, bruce.richardson@intel.com, thomas@monjalon.net, Harry van Haaren Date: Thu, 17 Jan 2019 17:17:44 +0000 Message-Id: <20190117171744.63455-1-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] meson: fix compilation with binutils version 2.30 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" This commit reworks the checks for binutils 2.30 and how the flags to disable AVX512F are passed to the compiler. Previously the #define for including AVX512 code was set, while the -mno-avx512f argument was given to the compiler. This would cause gcc to correctly refuse to emit AVX512 instructions, but the rte_memcpy code that includes AVX512 optimizations was being added to the build. The check for binutils check is now moved to x86 as it is irrelevant for other architectures, and the -mno-avx512f flag is passed to a march_opts array in meson. As the -mno-avx512 flag is added earlier in the build, the code in rte_memcpy is no longer attempted to be compiled. This commit also adds a message print in the meson configure stage to alert the user of the workaround being employed. Fixes: a32ca9a4ebc1 ("mk: fix scope of disabling AVX512F support") Signed-off-by: Harry van Haaren Tested-by: Ferruh Yigit --- config/meson.build | 8 -------- config/x86/meson.build | 11 ++++++++++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/config/meson.build b/config/meson.build index 40802fc88..db32499b3 100644 --- a/config/meson.build +++ b/config/meson.build @@ -43,14 +43,6 @@ toolchain = cc.get_id() dpdk_conf.set_quoted('RTE_TOOLCHAIN', toolchain) dpdk_conf.set('RTE_TOOLCHAIN_' + toolchain.to_upper(), 1) -# get binutils version for the workaround of Bug 97 -ldver = run_command('ld', '-v').stdout().strip() -if ldver.contains('2.30') - if cc.has_argument('-mno-avx512f') - machine_args += '-mno-avx512f' - endif -endif - add_project_link_arguments('-Wl,--no-as-needed', language: 'c') dpdk_extra_ldflags += '-Wl,--no-as-needed' diff --git a/config/x86/meson.build b/config/x86/meson.build index 33efb5e54..935ce22eb 100644 --- a/config/x86/meson.build +++ b/config/x86/meson.build @@ -2,7 +2,16 @@ # Copyright(c) 2017 Intel Corporation # for checking defines we need to use the correct compiler flags -march_opt = '-march=@0@'.format(machine) +march_opt = ['-march=@0@'.format(machine)] + +# get binutils version for the workaround of Bug 97 +ldver = run_command('ld', '-v').stdout().strip() +if ldver.contains('2.30') + if cc.has_argument('-mno-avx512f') + march_opt += '-mno-avx512f' + message('Binutils 2.30 detected, disabling AVX512 support due to workaround for DPDK bugzilla bug #97') + endif +endif # we require SSE4.2 for DPDK sse_errormsg = '''SSE4.2 instruction set is required for DPDK.