[PATCH 09/12] selftests/nolibc: add support for LLVM= parameter

From: Thomas Weißschuh
Date: Sun Jul 28 2024 - 06:12:11 EST


Makefile.include can modify CC and CFLAGS for usage with clang.
Make use of it.

Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
---
tools/testing/selftests/nolibc/Makefile | 3 +++
1 file changed, 3 insertions(+)

diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 8000bc3c408b..cdff317c35f2 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -155,6 +155,9 @@ CFLAGS ?= -Os -fno-ident -fno-asynchronous-unwind-tables -std=c89 -W -Wall -Wex
$(CFLAGS_$(XARCH)) $(CFLAGS_STACKPROTECTOR) $(CFLAGS_EXTRA)
LDFLAGS :=

+# Modify CFLAGS based on LLVM=
+include $(srctree)/tools/scripts/Makefile.include
+
REPORT ?= awk '/\[OK\][\r]*$$/{p++} /\[FAIL\][\r]*$$/{if (!f) printf("\n"); f++; print;} /\[SKIPPED\][\r]*$$/{s++} \
END{ printf("\n%3d test(s): %3d passed, %3d skipped, %3d failed => status: ", p+s+f, p, s, f); \
if (f || !p) printf("failure\n"); else if (s) printf("warning\n"); else printf("success\n");; \

--
2.45.2