[libc-commits] [PATCH] D122617: [libc] Set rtlib to compiler-rt in integration tests.
Siva Chandra via Phabricator via libc-commits
libc-commits at lists.llvm.org
Mon Mar 28 14:20:11 PDT 2022
sivachandra created this revision.
sivachandra added reviewers: lntue, michaelrj.
Herald added subscribers: libc-commits, ecnelises, tschuett, kristof.beyls, mgorny, dberris.
Herald added projects: libc-project, All.
sivachandra requested review of this revision.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D122617
Files:
libc/cmake/modules/LLVMLibCTestRules.cmake
Index: libc/cmake/modules/LLVMLibCTestRules.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCTestRules.cmake
+++ libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -389,7 +389,12 @@
${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 hte 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}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122617.418704.patch
Type: text/x-patch
Size: 1025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220328/e0ba8138/attachment.bin>
More information about the libc-commits
mailing list