[libc-commits] [clang] [libc] [llvm] [libc] Add support to build and run libc tests with spirv backend (PR #208129)

via libc-commits libc-commits at lists.llvm.org
Wed Jul 29 18:22:31 PDT 2026


================
@@ -586,16 +589,18 @@ function(add_integration_test test_name)
   list(REMOVE_DUPLICATES link_object_files)
 
   # Make a library of all deps
-  add_library(
-    ${fq_target_name}.__libc__
-    STATIC
-    EXCLUDE_FROM_ALL
-    ${link_object_files}
-  )
-  set_target_properties(${fq_target_name}.__libc__
-      PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-  set_target_properties(${fq_target_name}.__libc__
-      PROPERTIES ARCHIVE_OUTPUT_NAME ${fq_target_name}.libc)
+  if(NOT LIBC_TARGET_ARCHITECTURE_IS_SPIRV)
----------------
fineg74 wrote:

The issue is that some object files are linked multiple times into different submodules which causes spirv-link to fail when building the actual libc complaining about symbols that already defined elsewhere. So, for spirv,  instead of building multiple libraries it links all the object files together as one step. It looks like that standard llvm linker behaves differently so there is no such problem for amd and nvidia

https://github.com/llvm/llvm-project/pull/208129


More information about the libc-commits mailing list