[libc-commits] [PATCH] D145298: [libc] Simplify integration tests by eliminating the artificial sysroot.

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Sat Mar 4 10:22:13 PST 2023


jhuber6 accepted this revision.
jhuber6 added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libc/cmake/modules/LLVMLibCTestRules.cmake:493
   target_compile_options(${fq_build_target_name} PRIVATE -ffreestanding ${INTEGRATION_TEST_COMPILE_OPTIONS})
-  # 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_build_target_name} PRIVATE --sysroot=${sysroot} -static -stdlib=libc++ --rtlib=compiler-rt)
+  target_link_options(${fq_build_target_name} PRIVATE -nostdlib -static)
+  target_link_libraries(${fq_build_target_name} ${INTEGRATION_TEST_STARTUP} ${link_object_files})
----------------
sivachandra wrote:
> jhuber6 wrote:
> > Should we use `-nostdinc` as well? Or do we still expect to pick up some system libraries.
> Our libc does not [yet] provide the free standing headers like `stddef.h` and `stdint.h`. Using `-nostdinc` eliminates the paths to the compiler's freestanding headers also. So, we cannot [yet] use `-nostdinc`.
Alright, we can update this when `libc` is fully self supported.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145298/new/

https://reviews.llvm.org/D145298



More information about the libc-commits mailing list