[libc-commits] [libc] 2c20c90 - [libc] Set rtlib to compiler-rt in integration tests.

Siva Chandra Reddy via libc-commits libc-commits at lists.llvm.org
Mon Mar 28 16:46:36 PDT 2022


Author: Siva Chandra Reddy
Date: 2022-03-28T23:46:21Z
New Revision: 2c20c9003baa2ac69d847fa8384dcdca5b878ebd

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

LOG: [libc] Set rtlib to compiler-rt in integration tests.

The clang driver to picks up compiler runtime files using full paths.
Without this, at least for aarch64, the driver tries to pick up the
compiler runtime files from the working directory.

Reviewed By: michaelrj

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

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCTestRules.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 3bbebb0cc11a9..4fe6834aecf73 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -389,7 +389,12 @@ function(add_integration_test test_name)
       ${LIBC_BUILD_DIR}
       ${LIBC_BUILD_DIR}/include
   )
-  target_link_options(${fq_target_name} PRIVATE --sysroot=${sysroot} -static -stdlib=libc++)
+  # We set a number of link options to prevent picking up system libc binaries.
+  # Also, we restrict the integration tests to fully static executables. The
+  # rtlib is set to compiler-rt to make the compiler drivers pick up the compiler
+  # runtime binaries using full paths. Otherwise, files like crtbegin.o are passed
+  # as is (and not as paths like /usr/lib/.../crtbegin.o).
+  target_link_options(${fq_target_name} PRIVATE --sysroot=${sysroot} -static -stdlib=libc++ --rtlib=compiler-rt)
   add_dependencies(${fq_target_name}
                    ${fq_target_name}.__copy_loader__
                    ${fq_libc_target_name}


        


More information about the libc-commits mailing list