[libc-commits] [libc] fe710ff - [libc] Don't use '-nolibc' on the GPU build

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Wed May 3 09:38:04 PDT 2023


Author: Joseph Huber
Date: 2023-05-03T11:37:51-05:00
New Revision: fe710ffe97333d4a9e5af182cc213bbddc45ed66

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

LOG: [libc] Don't use '-nolibc' on the GPU build

We previously changed this to use `nolibc` to allow it to link in
compiler builtins for the CPU build. However, these options are unused
on the GPU and create a lot of noise. Furthermore, we want to use
`nogpulib` to prevent the linking in of the vendor libraries.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D149753

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCTestRules.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 0f82c49f26b7b..b9c05a1d0c8d6 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -658,7 +658,11 @@ function(add_libc_hermetic_test test_name)
   target_compile_options(${fq_build_target_name}
       PRIVATE ${LIBC_HERMETIC_TEST_COMPILE_OPTIONS} ${HERMETIC_TEST_COMPILE_OPTIONS})
 
-  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}
     PRIVATE


        


More information about the libc-commits mailing list