From 7b4c152c8ff9feffb81648e36180b5d65f1a7e89 Mon Sep 17 00:00:00 2001 From: Trevor Gamblin Date: Wed, 23 Sep 2026 17:22:12 -0400 Subject: [PATCH] Makefile: don't grep when setting CC_SUPPORT_ZICSR_ZIFENCEI Check exit status from the compiler/linker check directly (similar to OPENSBI_LD_PIE), rather than using grep to search for a pattern. This avoids potential unrelated matches in the command. Signed-off-by: Trevor Gamblin Reviewed-by: Anup Patel Link: https://lore.kernel.org/r/20260923-makefile_extension_grep-v2-1-0eb97b8ac076@baylibre.com Signed-off-by: Anup Patel --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1b3333f3..d704b0b6 100644 --- a/Makefile +++ b/Makefile @@ -204,7 +204,7 @@ CC_SUPPORT_SAVE_RESTORE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib CC_SUPPORT_STRICT_ALIGN := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -mstrict-align -x c /dev/null -o /dev/null 2>&1 | grep -e "-mstrict-align" -e "-mno-unaligned-access" >/dev/null && echo n || echo y) # Check whether the assembler and the compiler support the Zicsr and Zifencei extensions -CC_SUPPORT_ZICSR_ZIFENCEI := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -march=rv$(OPENSBI_CC_XLEN)imafd_zicsr_zifencei -x c /dev/null -o /dev/null 2>&1 | grep -e "zicsr" -e "zifencei" > /dev/null && echo n || echo y) +CC_SUPPORT_ZICSR_ZIFENCEI := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -march=rv$(OPENSBI_CC_XLEN)imafd_zicsr_zifencei -x c /dev/null -o /dev/null >/dev/null 2>&1 && echo y || echo n) # Check whether the assembler and the compiler support the Vector extension CC_SUPPORT_VECTOR := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -march=rv$(OPENSBI_CC_XLEN)gv -dM -E -x c /dev/null 2>&1 | grep -q riscv.*vector && echo y || echo n)