[libc-commits] [libc] 22ebf1e - [libc][Obvious] Do not pass 'nolibc' and other flags to the GPU build

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Fri Sep 29 10:57:14 PDT 2023


Author: Joseph Huber
Date: 2023-09-29T12:57:02-05:00
New Revision: 22ebf1e9b702e59077d668f3fc07632970db5968

URL: https://github.com/llvm/llvm-project/commit/22ebf1e9b702e59077d668f3fc07632970db5968
DIFF: https://github.com/llvm/llvm-project/commit/22ebf1e9b702e59077d668f3fc07632970db5968.diff

LOG: [libc][Obvious] Do not pass 'nolibc' and other flags to the GPU build

Summary:
Previously this code was applied to the integration tests but did not
copy the logic that stopped this from being passed to the GPU build.
Copy the full line to avoid the warnings and prevent any libraries from
being included.

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCTestRules.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 3a6e0b8e3fcf903..fc66c129609456e 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -525,7 +525,11 @@ function(add_integration_test test_name)
                            --target=${LIBC_GPU_TARGET_TRIPLE})
   endif()
 
-  target_link_options(${fq_build_target_name} PRIVATE -nolibc -nostartfiles -nostdlib++ -static)
+  if(LIBC_TARGET_ARCHITECTURE_IS_GPU)
+    target_link_options(${fq_build_target_name} PRIVATE -nostdlib -static)
+  else()
+    target_link_options(${fq_build_target_name} PRIVATE -nolibc -nostartfiles -nostdlib++ -static)
+  endif()
   target_link_libraries(
     ${fq_build_target_name}
     # The NVIDIA 'nvlink' linker does not currently support static libraries.


        


More information about the libc-commits mailing list