Author: Wenju He
Date: 2026-03-17T07:59:14+08:00
New Revision: 1c04e7fada2cf1eccdc4177b446ee4c81ea5e4ee

URL: 
https://github.com/llvm/llvm-project/commit/1c04e7fada2cf1eccdc4177b446ee4c81ea5e4ee
DIFF: 
https://github.com/llvm/llvm-project/commit/1c04e7fada2cf1eccdc4177b446ee4c81ea5e4ee.diff

LOG: [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.

Added: 
    

Modified: 
    libclc/cmake/modules/CMakeTestCLCCompiler.cmake

Removed: 
    


################################################################################
diff  --git a/libclc/cmake/modules/CMakeTestCLCCompiler.cmake 
b/libclc/cmake/modules/CMakeTestCLCCompiler.cmake
index d18a818f93bfb..b6b6a33aad19d 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
 )


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to