diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake --- a/libc/cmake/modules/LLVMLibCTestRules.cmake +++ b/libc/cmake/modules/LLVMLibCTestRules.cmake @@ -484,6 +484,8 @@ add_executable( ${fq_build_target_name} EXCLUDE_FROM_ALL + # The NVIDIA 'nvlink' linker does not currently support static libraries. + $<$:${link_object_files}> ${INTEGRATION_TEST_SRCS} ${INTEGRATION_TEST_HDRS} ) @@ -510,9 +512,12 @@ endif() target_link_options(${fq_build_target_name} PRIVATE -nostdlib -static) - target_link_libraries(${fq_build_target_name} ${fq_target_name}.__libc__ - libc.startup.${LIBC_TARGET_OS}.crt1 - libc.test.IntegrationTest.test) + target_link_libraries( + ${fq_build_target_name} + # The NVIDIA 'nvlink' linker does not currently support static libraries. + $<$>:${fq_target_name}.__libc__> + libc.startup.${LIBC_TARGET_OS}.crt1 + libc.test.IntegrationTest.test) add_dependencies(${fq_build_target_name} libc.test.IntegrationTest.test ${INTEGRATION_TEST_DEPENDS}) diff --git a/libc/utils/gpu/loader/CMakeLists.txt b/libc/utils/gpu/loader/CMakeLists.txt --- a/libc/utils/gpu/loader/CMakeLists.txt +++ b/libc/utils/gpu/loader/CMakeLists.txt @@ -24,4 +24,12 @@ PROPERTIES EXECUTABLE "$" ) +elseif(TARGET nvptx_loader AND LIBC_GPU_TARGET_ARCHITECTURE_IS_NVPTX) + add_custom_target(libc.utils.gpu.loader) + add_dependencies(libc.utils.gpu.loader nvptx_loader) + set_target_properties( + libc.utils.gpu.loader + PROPERTIES + EXECUTABLE "$" + ) endif()