[libcxx-commits] [PATCH] D101565: [libcxx] [ci] Add a Windows CI configuration for a statically linked libc++

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun May 2 12:38:09 PDT 2021

mstorsjo added inline comments.

Comment at: libcxx/utils/ci/buildkite-pipeline.yml:321
+  - label: "Windows (DLL)"
+    command: "bash libcxx/utils/ci/run-buildbot win-dll"
+    artifact_paths:
ldionne wrote:
> Please use `windows-dll` instead of `win-dll`. Same for `-static`.
Sure, yes that's definitely better.

Comment at: libcxx/utils/ci/run-buildbot:97-108
+    echo "--- Generating CMake"
+    cmake -S "${MONOREPO_ROOT}/libcxx" \
+          -B "${BUILD_DIR}" \
+          -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
+          -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+          -DCMAKE_C_COMPILER=clang-cl \
+          -DCMAKE_CXX_COMPILER=clang-cl \
ldionne wrote:
> Could we instead do this to reuse as much between the Windows and non-Windows cases? I'm a bit worried that the two invocations are going to diverge with time.
> ```
> generate-cmake -DCMAKE_CXX_FLAGS="-D_LIBCPP_HAS_NO_INT128" \
> ```
> Then, from below:
> ```
> export CC=clang-cl
> export CXX=clang-cl
> generate-cmake-libcxx-windows -DOPTIONS
> ```
Yeah we could do something like that.

I'd have to split up the existing `generate-cmake` into a base configuration usable for the windows target though - using the current `generate-cmake` as such doesn't work for the clang-cl targets for a number of reasons.

The current `generate-cmake` configures cmake pointing at the llvm subdir. It's possible to build libcxx for windows that way, but it requires adding the option `LLVM_FORCE_BUILD_RUNTIME` (see llvm/projects/CMakeLists.txt). Additionally the current `generate-cmake` adds libunwind and libcxxabi to the build; libunwind fails to cmake configure for clang-cl targets, and adding libcxxabi also isn't buildable as such for clang-cl targets. Finally `generate-cmake` also adds `LIBCXX_CXX_ABI=libcxxabi` which isn't right for our configuration.

(As an aside - would it be good to have a CI configuration where libcxx is built on top of another ABI library like libsupc++?)

I kinda also prefer using `LIBCXX_CXX_COMPILER=clang-cl` instead of `export CXX=clang-cl` even though both would work.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list