mk: Check if compiler supports -mno-avx512f

Some old compilers like gcc 4.8.5 don't support
this flag, that leads to compilation failure.
Add a check that the compiler supports the flag,
it will allow to compile SPDK with old versions
of gcc

Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: I80fd6e4f1f792be107ecac593318e1da877219c4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15688
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
Alexey Marchuk 2022-11-29 16:37:44 +01:00 committed by Konrad Sztyber
parent 1c6f808277
commit 6733af8d6f

View File

@ -71,11 +71,13 @@ COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE)
endif
ifeq ($(TARGET_MACHINE),x86_64)
ifneq (,$(shell $(CC) --target-help | grep -qe -mavx512f && echo 1))
# Don't use AVX-512 instructions in SPDK code - it breaks Valgrind for
# some cases where compiler decides to hyper-optimize a relatively
# simple operation (like int-to-float converstion) using AVX-512
COMMON_CFLAGS += -mno-avx512f
endif
endif
ifeq ($(CONFIG_WERROR), y)
COMMON_CFLAGS += -Werror