From 62c1374385b31f33e1ca02d394bc8d6f5ede97a6 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 80a895f0..9189864d 100644 --- a/build/tasks/kernel.mk +++ b/build/tasks/kernel.mk @@ -239,7 +239,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