[libc-commits] [libc] 2069bce - [libc][fix] Only use the object files when targeting NVPTX

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Mon Apr 17 07:38:35 PDT 2023


Author: Joseph Huber
Date: 2023-04-17T09:37:08-05:00
New Revision: 2069bce4cfef31468c979e7d157d8fe84bfd2a70

URL: https://github.com/llvm/llvm-project/commit/2069bce4cfef31468c979e7d157d8fe84bfd2a70
DIFF: https://github.com/llvm/llvm-project/commit/2069bce4cfef31468c979e7d157d8fe84bfd2a70.diff

LOG: [libc][fix] Only use the object files when targeting NVPTX

Summary:
The `nvlink` linker doesn't support static libraries, so we just pass in
the object files. The condition was erroneously doing this for every
single GPU architecture and not just NVIDIA. The AMDGPU support handles
static libraries just fine.

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCTestRules.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index d1ce34f91576..592b632bbc11 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -516,7 +516,7 @@ function(add_integration_test test_name)
   target_link_libraries(
     ${fq_build_target_name}
     # The NVIDIA 'nvlink' linker does not currently support static libraries.
-    $<$<NOT:$<BOOL:${LIBC_TARGET_ARCHITECTURE_IS_GPU}>>:${fq_target_name}.__libc__>
+    $<$<NOT:$<BOOL:${LIBC_GPU_TARGET_ARCHITECTURE_IS_NVPTX}>>:${fq_target_name}.__libc__>
     libc.startup.${LIBC_TARGET_OS}.crt1
     libc.test.IntegrationTest.test)
   add_dependencies(${fq_build_target_name}


        


More information about the libc-commits mailing list