From 1c04e7fada2cf1eccdc4177b446ee4c81ea5e4ee Mon Sep 17 00:00:00 2001 From: Wenju He Date: Tue, 17 Mar 2026 07:59:14 +0800 Subject: [PATCH] [libclc] fix compiler check with --target=spirv64 and -disable-llvm-passes (#185376) Fix "unknown target triple" errors when LLVM_TARGETS_TO_BUILD is empty. Adding -disable-llvm-passes reduces this to a very basic sanity check of Clang frontend. This allows the test to pass even if SPIR-V backend is not enabled, as the frontend can still generate IR for the target. --- libclc/cmake/modules/CMakeTestCLCCompiler.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libclc/cmake/modules/CMakeTestCLCCompiler.cmake b/libclc/cmake/modules/CMakeTestCLCCompiler.cmake index d18a818f93bf..b6b6a33aad19 100644 --- a/libclc/cmake/modules/CMakeTestCLCCompiler.cmake +++ b/libclc/cmake/modules/CMakeTestCLCCompiler.cmake @@ -15,8 +15,8 @@ file(MAKE_DIRECTORY "${_test_dir}") message(STATUS "Check for working CLC compiler: ${CMAKE_CLC_COMPILER}") execute_process( - COMMAND "${CMAKE_CLC_COMPILER}" -x cl -c -flto - -o "${_test_out}" "${_test_file}" + COMMAND "${CMAKE_CLC_COMPILER}" --target=spirv64-unknown-unknown -x cl -c -flto + -disable-llvm-passes -o "${_test_out}" "${_test_file}" RESULT_VARIABLE _clc_result ERROR_VARIABLE _clc_error )