From 6733af8d6f77959c2daff77db70c14129cb9419d Mon Sep 17 00:00:00 2001 From: Alexey Marchuk Date: Tue, 29 Nov 2022 16:37:44 +0100 Subject: [PATCH] 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 Change-Id: I80fd6e4f1f792be107ecac593318e1da877219c4 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15688 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris Reviewed-by: Konrad Sztyber --- mk/spdk.common.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk index 1a5608658..59a6c41f4 100644 --- a/mk/spdk.common.mk +++ b/mk/spdk.common.mk @@ -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