summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorHarry van Haaren <harry.van.haaren@intel.com>2019-01-17 17:17:44 +0000
committerThomas Monjalon <thomas@monjalon.net>2019-01-17 19:19:57 +0100
commit566b4d7a968fa454ff7deab7c43216712878af30 (patch)
treee5addec6d454e581934c1e39895d466340f86bc6 /config
parent6406d70561e44474b27646f74b3863929019b1f1 (diff)
downloaddpdk-next-eventdev-566b4d7a968fa454ff7deab7c43216712878af30.zip
dpdk-next-eventdev-566b4d7a968fa454ff7deab7c43216712878af30.tar.gz
dpdk-next-eventdev-566b4d7a968fa454ff7deab7c43216712878af30.tar.xz
build: fix meson check for binutils 2.30
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 <harry.van.haaren@intel.com> Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'config')
-rw-r--r--config/meson.build8
-rw-r--r--config/x86/meson.build11
2 files changed, 10 insertions, 9 deletions
diff --git a/config/meson.build b/config/meson.build
index 40802fc..db32499 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 33efb5e..9e5952a 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 as workaround for bug #97')
+ endif
+endif
# we require SSE4.2 for DPDK
sse_errormsg = '''SSE4.2 instruction set is required for DPDK.