From 1318b3e434c53f077e949615322aa7cebd6dece1 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Tue, 5 Jul 2022 17:02:29 -0700 Subject: [PATCH] build: add -mno-avx512f to x86_64 builds valgrind doesn't support AVX-512, and latest compilers will use newfangled instructions to do simple integer-to-fp conversions which then break valgrind. The only place where we would really use or need AVX-512 is in ISA-L, so disabling those instructions in SPDK is fine. Signed-off-by: Jim Harris Change-Id: I48f3dd4f1b5813485a92c81d01e513c950ada205 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13554 Tested-by: SPDK CI Jenkins Reviewed-by: Artur Paszkiewicz Reviewed-by: Ben Walker Reviewed-by: Konrad Sztyber --- mk/spdk.common.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk index d7fa73327..dfe837755 100644 --- a/mk/spdk.common.mk +++ b/mk/spdk.common.mk @@ -70,6 +70,13 @@ else COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE) endif +ifeq ($(TARGET_MACHINE),x86_64) +# 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 + ifeq ($(CONFIG_WERROR), y) COMMON_CFLAGS += -Werror endif