[libc-commits] [libc] db171f2 - [libc] Use -nolibc -nostdlib++ -nostartfiles for hermetic test link.

Siva Chandra Reddy via libc-commits libc-commits at lists.llvm.org
Tue May 2 23:29:33 PDT 2023


Author: Siva Chandra Reddy
Date: 2023-05-03T06:29:09Z
New Revision: db171f2fb53a3c10b6fe1a69aad09f4fbdf6ed1c

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

LOG: [libc] Use -nolibc -nostdlib++ -nostartfiles for hermetic test link.

We previously used a more stricter -nostdlib option which was also removing
compiler-rt/libgcc.

Reviewed By: jhuber6

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

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCTestRules.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index d1d536cb97dc..0f82c49f26b7 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -658,7 +658,7 @@ 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 -nostdlib -static)
+  target_link_options(${fq_build_target_name} PRIVATE -nolibc -nostartfiles -nostdlib++ -static)
   target_link_libraries(
     ${fq_build_target_name}
     PRIVATE


        


More information about the libc-commits mailing list