Skip to content

Commit 24c524d

Browse files
authored
[libc++] Enable compiler-rt when performing a bootstrapping build (#167065)
Otherwise, we end up using whatever system-provided compiler runtime is available, which doesn't work on macOS since compiler-rt is located inside the toolchain path, which can't be found by default. However, disable the tests for compiler-rt since those are linking against the system C++ standard library while using the just-built libc++ headers, which is non-sensical and leads to undefined references on macOS.
1 parent 54c2c7c commit 24c524d

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

libcxx/docs/VendorDocumentation.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,14 @@ CMake invocation at ``<monorepo>/llvm``:
8181
.. code-block:: bash
8282
8383
$ mkdir build
84-
$ cmake -G Ninja -S llvm -B build -DLLVM_ENABLE_PROJECTS="clang" \ # Configure
85-
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
86-
-DLLVM_RUNTIME_TARGETS="<target-triple>"
87-
$ ninja -C build runtimes # Build
88-
$ ninja -C build check-runtimes # Test
89-
$ ninja -C build install-runtimes # Install
84+
$ cmake -G Ninja -S llvm -B build \
85+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
86+
-DLLVM_ENABLE_PROJECTS="clang" \ # Configure
87+
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind;compiler-rt" \
88+
-DLLVM_RUNTIME_TARGETS="<target-triple>"
89+
$ ninja -C build runtimes # Build
90+
$ ninja -C build check-runtimes # Test
91+
$ ninja -C build install-runtimes # Install
9092
9193
.. note::
9294
- This type of build is also commonly called a "Runtimes build", but we would like to move

libcxx/utils/ci/run-buildbot

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,12 @@ bootstrapping-build)
366366
-DCMAKE_BUILD_TYPE=Release \
367367
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
368368
-DLLVM_ENABLE_PROJECTS="clang;lldb" \
369-
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
369+
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind;compiler-rt" \
370370
-DLLVM_RUNTIME_TARGETS="$(${CXX} --print-target-triple)" \
371371
-DLLVM_HOST_TRIPLE="$(${CXX} --print-target-triple)" \
372372
-DLLVM_TARGETS_TO_BUILD="host" \
373373
-DRUNTIMES_BUILD_ALLOW_DARWIN=ON \
374+
-DCOMPILER_RT_INCLUDE_TESTS=OFF \
374375
-DLLVM_ENABLE_ASSERTIONS=ON \
375376
-DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests"
376377

0 commit comments

Comments
 (0)