Skip to content

Commit 2c20c90

Browse files
author
Siva Chandra Reddy
committed
[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
1 parent 75c8585 commit 2c20c90

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libc/cmake/modules/LLVMLibCTestRules.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,12 @@ function(add_integration_test test_name)
389389
${LIBC_BUILD_DIR}
390390
${LIBC_BUILD_DIR}/include
391391
)
392-
target_link_options(${fq_target_name} PRIVATE --sysroot=${sysroot} -static -stdlib=libc++)
392+
# We set a number of link options to prevent picking up system libc binaries.
393+
# Also, we restrict the integration tests to fully static executables. The
394+
# rtlib is set to compiler-rt to make the compiler drivers pick up the compiler
395+
# runtime binaries using full paths. Otherwise, files like crtbegin.o are passed
396+
# as is (and not as paths like /usr/lib/.../crtbegin.o).
397+
target_link_options(${fq_target_name} PRIVATE --sysroot=${sysroot} -static -stdlib=libc++ --rtlib=compiler-rt)
393398
add_dependencies(${fq_target_name}
394399
${fq_target_name}.__copy_loader__
395400
${fq_libc_target_name}

0 commit comments

Comments
 (0)