From d7f6af28a38d4cc34e7876f340d072c4e6cc36a3 Mon Sep 17 00:00:00 2001 From: dianlujitao Date: Thu, 2 Mar 2023 20:29:25 +0800 Subject: [PATCH] kernel: Check HIP support of clang before disabling it Old clang releases don't support --hip-path, so passing this flag will break the build. Change-Id: If36defb0e74893581849700fb67e6aa4617908a8 --- build/tasks/kernel.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/tasks/kernel.mk b/build/tasks/kernel.mk index fe7abf6..84195ff 100644 --- a/build/tasks/kernel.mk +++ b/build/tasks/kernel.mk @@ -231,7 +231,11 @@ ifneq ($(TARGET_KERNEL_CLANG_COMPILE),false) endif PATH_OVERRIDE += PATH=$(TARGET_KERNEL_CLANG_PATH)/bin:$$PATH ifeq ($(KERNEL_CC),) - KERNEL_CC := CC="$(CCACHE_BIN) clang --cuda-path=/dev/null --hip-path=/dev/null" + CLANG_EXTRA_FLAGS := --cuda-path=/dev/null + ifeq ($(shell $(TARGET_KERNEL_CLANG_PATH)/bin/clang -v --hip-path=/dev/null >/dev/null 2>&1; echo $$?),0) + CLANG_EXTRA_FLAGS += --hip-path=/dev/null + endif + KERNEL_CC := CC="$(CCACHE_BIN) clang $(CLANG_EXTRA_FLAGS)" endif endif