From a3ec812b09b24cabaeb11717c58b1f7585c3a10c Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Thu, 8 Dec 2022 11:46:02 +0100 Subject: [PATCH] mk: replace [[ command with /dev/null redirection make uses /bin/sh as its shell and some distributions set it to shells that don't support [[ command (e.g. ubuntu and dash). This causes the check to fail with the following error: /bin/sh: 1: [[: not found So, replaced the [[ command with a redirection to /dev/null, which should work on all shells. Signed-off-by: Konrad Sztyber Change-Id: Idcae094e8faa3da6faac16754bb0484bd91363d8 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15852 Tested-by: SPDK CI Jenkins Reviewed-by: Mike Gerdts Reviewed-by: Aleksey Marchuk Reviewed-by: Jim Harris Community-CI: Mellanox Build Bot --- mk/spdk.common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/spdk.common.mk b/mk/spdk.common.mk index c7b3b5d0c..df485810e 100644 --- a/mk/spdk.common.mk +++ b/mk/spdk.common.mk @@ -71,7 +71,7 @@ COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE) endif ifeq ($(TARGET_MACHINE),x86_64) -ifneq (,$(shell [[ $$($(CC) --target-help) == *-mavx512f* ]] && echo 1)) +ifneq (,$(shell $(CC) --target-help | grep -e -mavx512f >/dev/null && 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 conversion) using AVX-512