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
This commit is contained in:
dianlujitao 2023-03-02 20:29:25 +08:00
parent ef68678120
commit 62c1374385

View file

@ -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