From 5b1e739428fecb1bb107276442143fb18e4003f4 Mon Sep 17 00:00:00 2001 From: Trevor Gamblin Date: Wed, 23 Sep 2026 17:22:14 -0400 Subject: [PATCH] Makefile: don't grep when setting CC_SUPPORT_SAVE_RESTORE 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-3-0eb97b8ac076@baylibre.com Signed-off-by: Anup Patel --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b0a23ce0..90bf7d5d 100644 --- a/Makefile +++ b/Makefile @@ -198,7 +198,7 @@ OPENSBI_LD_PIE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) $(USE_LD_FLAG) -fP OPENSBI_LD_EXCLUDE_LIBS := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) $(USE_LD_FLAG) "-Wl,--exclude-libs,ALL" -x c /dev/null -o /dev/null >/dev/null 2>&1 && echo y || echo n) # Check whether the compiler supports -m(no-)save-restore -CC_SUPPORT_SAVE_RESTORE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -mno-save-restore -x c /dev/null -o /dev/null 2>&1 | grep -e "-save-restore" >/dev/null && echo n || echo y) +CC_SUPPORT_SAVE_RESTORE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -mno-save-restore -x c /dev/null -o /dev/null 2>&1 && echo y || echo n) # Check whether the compiler supports -m(no-)strict-align CC_SUPPORT_STRICT_ALIGN := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -mstrict-align -x c /dev/null -o /dev/null 2>&1 && echo y || echo n)