Skip to content

Commit 96435af

Browse files
committed
[libc++] Enable compiler-rt when performing a bootstrapping build
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 2fd3bf3 commit 96435af

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
@@ -391,11 +391,12 @@ bootstrapping-build)
391391
-DCMAKE_BUILD_TYPE=Release \
392392
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
393393
-DLLVM_ENABLE_PROJECTS="clang;lldb" \
394-
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
394+
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind;compiler-rt" \
395395
-DLLVM_RUNTIME_TARGETS="$(${CXX} --print-target-triple)" \
396396
-DLLVM_HOST_TRIPLE="$(${CXX} --print-target-triple)" \
397397
-DLLVM_TARGETS_TO_BUILD="host" \
398398
-DRUNTIMES_BUILD_ALLOW_DARWIN=ON \
399+
-DCOMPILER_RT_INCLUDE_TESTS=OFF \
399400
-DLLVM_ENABLE_ASSERTIONS=ON \
400401
-DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests"
401402

0 commit comments

Comments
 (0)