[libcxx-commits] [libcxx] [llvm] [libcxx] [ci] Add a test configuration with an incomplete sysroot (PR #107089)

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 3 11:44:51 PDT 2024


================
@@ -715,6 +715,29 @@ mingw-dll-i686)
           -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake"
     check-runtimes
 ;;
+mingw-incomplete-sysroot)
+    # When bringing up a new cross compiler from scratch, we build
+    # libunwind/libcxx in a setup where the toolchain is incomplete and
+    # unable to perform the normal linker checks; this requires a few
+    # special cases in the CMake files.
+    #
+    # Building in an incomplete setup requires setting CMAKE_*_COMPILER_WORKS,
+    # as CMake fails to probe the compiler. This case also requires
+    # setting CMAKE_CXX_COMPILER_TARGET, as LLVM's heuristics for setting
+    # the triple fails when CMake hasn't been able to probe the environment.
+    # (This is what one has to do when building the initial libunwind/libcxx
+    # for a new toolchain.)
+    clean
+    generate-cmake \
+          -DCMAKE_C_COMPILER_WORKS=TRUE \
+          -DCMAKE_CXX_COMPILER_WORKS=TRUE \
+          -DCMAKE_C_COMPILER_TARGET=x86_64-w64-windows-gnu \
+          -DCMAKE_CXX_COMPILER_TARGET=x86_64-w64-windows-gnu \
----------------
mstorsjo wrote:

And as for needing to pass the `*_COMPILER_WORKS` flag, that’s also required to get cmake pass the very first sanity checks. It is possible to avoid that by setting `CMAKE_TRY_COMPILE_TARGET_TYPE` to `STATIC_LIBRARY`, but that gives false positives on all further checks for whether libraries exist.

We’ve looked into reducing the number of extra flags one has to set when doing the initial build, but these couple flags are the ones that the caller do need to set in such situations. Trying to get rid of it isn’t worth it - we’ve tried.

https://github.com/llvm/llvm-project/pull/107089


More information about the libcxx-commits mailing list