]> git.droids-corp.org - dpdk.git/commitdiff
dma/idxd: fix non-AVX builds with old compilers
authorBruce Richardson <bruce.richardson@intel.com>
Thu, 23 Jun 2022 13:49:33 +0000 (14:49 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 26 Jun 2022 08:27:15 +0000 (10:27 +0200)
When building without AVX2 support using an older compiler e.g. gcc 4.8
on Centos/RHEL 7, we get build errors due to the use of AVX2 intrinsics.
This is because the compiler does not support
"__attribute__((target(AVX2)))" function attribute. Disable build of
this driver such edge cases.

Generic builds using recent compilers, and all builds with a minimum
baseline of AVX2 are unaffected by this change.

Fixes: aa802b10237c ("dma/idxd: fix AVX2 in non-datapath functions")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Yu Jiang <yux.jiang@intel.com>
drivers/dma/idxd/meson.build

index dcc0a297d7ee3aa43250186bfa2ec92d2e715bc4..c5403b431c8fb6230c6b11930a10a4e5c0d02c4a 100644 (file)
@@ -4,6 +4,17 @@
 build = dpdk_conf.has('RTE_ARCH_X86')
 reason = 'only supported on x86'
 
+test_avx2_code = '''
+#include <x86intrin.h>
+__attribute__((target("avx2")))
+__m256i fn(void *x) { return _mm256_loadu_si256(x); }
+'''
+if build and not cc.compiles(test_avx2_code, args:machine_args)
+    build = false
+    reason = 'missing support for AVX2 function attribute'
+    subdir_done()
+endif
+
 deps += ['bus_pci']
 sources = files(
         'idxd_common.c',