2 #===----------------------------------------------------------------------===##
4 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 # See https://llvm.org/LICENSE.txt for license information.
6 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 #===----------------------------------------------------------------------===##
16 PROGNAME
="$(basename "${0}")"
21 ${PROGNAME} [options] <BUILDER>
23 [-h|--help] Display this help and exit.
25 --llvm-root <DIR> Path to the root of the LLVM monorepo. By default, we try
26 to figure it out based on the current working directory.
28 --build-dir <DIR> The directory to use for building the library. By default,
29 this is '<llvm-root>/build/<builder>'.
31 --osx-roots <DIR> Path to pre-downloaded macOS dylibs. By default, we download
32 them from Green Dragon. This is only relevant at all when
33 running back-deployment testing if one wants to override
34 the old dylibs we use to run the tests with different ones.
36 CC The C compiler to use, this value is used by CMake. This
39 CXX The C++ compiler to use, this value is used by CMake. This
42 CMAKE The CMake binary to use. This variable is optional.
44 CLANG_FORMAT The clang-format binary to use when generating the format
50 if [[ $# == 0 ]]; then
55 while [[ $# -gt 0 ]]; do
80 MONOREPO_ROOT
="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
81 BUILD_DIR
="${BUILD_DIR:=${MONOREPO_ROOT}/build/${BUILDER}}"
82 INSTALL_DIR
="${BUILD_DIR}/install"
84 # If we can find Ninja/CMake provided by Xcode, use those since we know their
85 # version will generally work with the Clang shipped in Xcode (e.g. if Clang
86 # knows about -std=c++20, the CMake bundled in Xcode will probably know about
88 if xcrun
--find ninja
&>/dev
/null
; then
89 NINJA
="$(xcrun --find ninja)"
90 elif which ninja
&>/dev
/null
; then
91 # The current implementation of modules needs the absolute path to the ninja
93 # TODO MODULES Is this still needed when CMake has libc++ module support?
94 NINJA
="$(which ninja)"
99 if [ -z "${CMAKE}" ]; then
100 if xcrun
--find cmake
&>/dev
/null
; then
101 CMAKE
="$(xcrun --find cmake)"
108 rm -rf "${BUILD_DIR}"
111 function generate-cmake-base
() {
112 echo "--- Generating CMake"
114 -S "${MONOREPO_ROOT}/runtimes" \
116 -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
117 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
118 -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
119 -DLIBCXX_ENABLE_WERROR=YES \
120 -DLIBCXXABI_ENABLE_WERROR=YES \
121 -DLIBUNWIND_ENABLE_WERROR=YES \
122 -DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests" \
126 function generate-cmake
() {
127 generate-cmake-base \
128 -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
129 -DLIBCXX_CXX_ABI=libcxxabi \
133 function generate-cmake-libcxx-win
() {
134 generate-cmake-base \
135 -DLLVM_ENABLE_RUNTIMES="libcxx" \
136 -DCMAKE_C_COMPILER=clang-cl \
137 -DCMAKE_CXX_COMPILER=clang-cl \
141 function generate-cmake-android
() {
142 generate-cmake-base \
143 -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
144 -DLIBCXX_CXX_ABI=libcxxabi \
148 function check-runtimes
() {
149 echo "+++ Running the libc++ tests"
150 ${NINJA} -vC "${BUILD_DIR}" check-cxx
152 echo "+++ Running the libc++abi tests"
153 ${NINJA} -vC "${BUILD_DIR}" check-cxxabi
155 echo "+++ Running the libunwind tests"
156 ${NINJA} -vC "${BUILD_DIR}" check-unwind
158 # TODO: On macOS 13.5, the linker seems to have an issue where it will pick up
159 # a library if it exists inside a -L search path, even if we don't link
160 # against that library. This happens with libunwind.dylib if it is built
161 # at the point when we run the libc++ tests, which causes issues cause we
162 # are also linking against the system unwinder.
164 # I believe this is a linker regression and I reported it as rdar://115842730.
165 # It should be possible to move this installation step back to the top once
166 # that issue has been resolved, but in the meantime it doesn't really hurt to
168 echo "--- Installing libc++, libc++abi and libunwind to a fake location"
169 ${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi install-unwind
172 # TODO: The goal is to test this against all configurations. We should also move
173 # this to the Lit test suite instead of being a separate CMake target.
174 function check-abi-list
() {
175 echo "+++ Running the libc++ ABI list test"
176 ${NINJA} -vC "${BUILD_DIR}" check-cxx-abilist ||
(
177 echo "+++ Generating the libc++ ABI list after failed check"
178 ${NINJA} -vC "${BUILD_DIR}" generate-cxx-abilist
183 function check-cxx-benchmarks
() {
184 echo "--- Running the benchmarks"
185 ${NINJA} -vC "${BUILD_DIR}" check-cxx-benchmarks
188 function test-armv7m-picolibc
() {
191 # To make it easier to get this builder up and running, build picolibc
192 # from scratch. Anecdotally, the build-picolibc script takes about 16 seconds.
193 # This could be optimised by building picolibc into the Docker container.
194 ${MONOREPO_ROOT}/libcxx
/utils
/ci
/build-picolibc.sh \
195 --build-dir "${BUILD_DIR}" \
196 --install-dir "${INSTALL_DIR}" \
197 --target armv7m-none-eabi
199 echo "--- Generating CMake"
200 flags
="--sysroot=${INSTALL_DIR}"
202 -S "${MONOREPO_ROOT}/compiler-rt" \
203 -B "${BUILD_DIR}/compiler-rt" \
204 -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
205 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
206 -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
207 -DCMAKE_C_FLAGS="${flags}" \
208 -DCMAKE_CXX_FLAGS="${flags}" \
209 -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON \
212 -DLIBCXX_TEST_CONFIG="armv7m-picolibc-libc++.cfg.in" \
213 -DLIBCXXABI_TEST_CONFIG="armv7m-picolibc-libc++abi.cfg.in" \
214 -DLIBUNWIND_TEST_CONFIG="armv7m-picolibc-libunwind.cfg.in" \
215 -DCMAKE_C_FLAGS="${flags}" \
216 -DCMAKE_CXX_FLAGS="${flags}" \
219 ${NINJA} -vC "${BUILD_DIR}/compiler-rt" install
221 # Prior to clang 19, armv7m-none-eabi normalised to armv7m-none-unknown-eabi.
222 # clang 19 changed this to armv7m-unknown-none-eabi. So for as long as 18.x
223 # is supported, we have to ask clang what the triple will be.
224 NORMALISED_TARGET_TRIPLE
=$
(${CC-cc} --target=armv7m-none-eabi
-print-target-triple)
225 # Without this step linking fails later in the build.
226 mv "${BUILD_DIR}/install/lib/${NORMALISED_TARGET_TRIPLE}"/* "${BUILD_DIR}/install/lib"
231 # Print the version of a few tools to aid diagnostics in some cases
235 if [ ! -z "${CXX}" ]; then ${CXX} --version; fi
238 check-generated-output
)
239 # `! foo` doesn't work properly with `set -e`, use `! foo || false` instead.
240 # https://stackoverflow.com/questions/57681955/set-e-does-not-respect-logical-not
244 set +x
# Printing all the commands below just creates extremely confusing output
246 # Reject patches that forgot to re-run the generator scripts.
247 echo "+++ Making sure the generator scripts were run"
248 ${NINJA} -vC "${BUILD_DIR}" libcxx-generate-files
249 git
diff |
tee ${BUILD_DIR}/generated_output.
patch
250 git ls-files
-o --exclude-standard |
tee ${BUILD_DIR}/generated_output.status
251 ! grep -q '^--- a' ${BUILD_DIR}/generated_output.
patch || false
252 if [ -s ${BUILD_DIR}/generated_output.status
]; then
253 echo "It looks like not all the generator scripts were run,"
254 echo "did you forget to build the libcxx-generate-files target?"
255 echo "Did you add all new files it generated?"
259 # Reject patches that introduce non-ASCII characters or hard tabs.
260 # Depends on LC_COLLATE set at the top of this script.
262 ! grep -rn '[^ -~]' libcxx
/include libcxx
/src libcxx
/test libcxx
/benchmarks \
264 --exclude '*unicode*.cpp' \
265 --exclude '*print*.sh.cpp' \
266 --exclude 'escaped_output.*.pass.cpp' \
267 --exclude 'format_tests.h' \
268 --exclude 'format.functions.tests.h' \
269 --exclude 'formatter.*.pass.cpp' \
270 --exclude 'grep.pass.cpp' \
271 --exclude 'locale-specific_form.pass.cpp' \
272 --exclude 'ostream.pass.cpp' \
273 --exclude 'transcoding.pass.cpp' \
274 --exclude 'underflow.pass.cpp' \
278 # Various Standard modes
282 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake"
288 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake"
294 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake"
300 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake"
306 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake"
312 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx23.cmake"
318 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx26.cmake"
323 # Other compiler support
327 generate-cmake
-DLIBCXX_ENABLE_WERROR=NO \
328 -DLIBCXXABI_ENABLE_WERROR=NO \
329 -DLIBUNWIND_ENABLE_WERROR=NO
334 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
335 -DLIBCXX_ENABLE_WERROR=NO \
336 -DLIBCXXABI_ENABLE_WERROR=NO \
337 -DLIBUNWIND_ENABLE_WERROR=NO
345 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake"
350 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake"
355 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake"
360 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake"
364 # Various build configurations
369 echo "--- Generating CMake"
371 -S "${MONOREPO_ROOT}/llvm" \
373 -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
374 -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
375 -DCMAKE_BUILD_TYPE=Release \
376 -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
377 -DLLVM_ENABLE_PROJECTS="clang;lldb" \
378 -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
379 -DLLVM_RUNTIME_TARGETS="$(${CXX} --print-target-triple)" \
380 -DLLVM_HOST_TRIPLE="$(${CXX} --print-target-triple)" \
381 -DLLVM_TARGETS_TO_BUILD="host" \
382 -DRUNTIMES_BUILD_ALLOW_DARWIN=ON \
383 -DLLVM_ENABLE_ASSERTIONS=ON \
384 -DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests"
386 echo "+++ Running the LLDB libc++ data formatter tests"
387 ${NINJA} -vC "${BUILD_DIR}" check-lldb-api-functionalities-data-formatter-data-formatter-stl-libcxx
389 echo "--- Running the libc++ and libc++abi tests"
390 ${NINJA} -vC "${BUILD_DIR}" check-runtimes
392 echo "+++ Installing libc++ and libc++abi to a fake location"
393 ${NINJA} -vC "${BUILD_DIR}" install-runtimes
399 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake"
404 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-merged.cmake" \
405 -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
406 -DLIBCXXABI_TEST_CONFIG="llvm-libc++abi-merged.cfg.in" \
407 -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-merged.cfg.in"
410 generic-hardening-mode-fast
)
412 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardening-mode-fast.cmake"
416 generic-hardening-mode-fast-with-abi-breaks
)
418 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardening-mode-fast-with-abi-breaks.cmake"
422 generic-hardening-mode-extensive
)
424 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardening-mode-extensive.cmake"
428 generic-hardening-mode-debug
)
430 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-hardening-mode-debug.cmake"
439 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake"
445 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules-lsv.cmake"
454 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-threads.cmake"
457 generic-no-filesystem
)
459 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake"
462 generic-no-random_device
)
464 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake"
467 generic-no-localization
)
469 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake"
474 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake"
477 generic-no-wide-characters
)
479 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake"
484 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-tzdb.cmake"
487 generic-no-experimental
)
489 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-experimental.cmake"
493 generic-no-exceptions
)
495 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-exceptions.cmake"
501 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-rtti.cmake"
505 # Other miscellaneous jobs
507 generic-abi-unstable
)
509 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-abi-unstable.cmake"
512 generic-optimized-speed
)
514 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-optimized-speed.cmake"
522 ${MONOREPO_ROOT}/libcxx
/utils
/ci
/apple-install-libcxx.sh \
523 --llvm-root ${MONOREPO_ROOT} \
524 --build-dir ${BUILD_DIR} \
525 --install-dir ${INSTALL_DIR} \
526 --symbols-dir "${BUILD_DIR}/symbols" \
527 --architectures "${arch}" \
530 # TODO: It would be better to run the tests against the fake-installed version of libc++ instead
531 xcrun
--sdk macosx ninja
-vC "${BUILD_DIR}/${arch}" check-cxx check-cxxabi check-cxx-abilist
533 apple-system-backdeployment-hardened-
*)
536 if [[ "${OSX_ROOTS}" == "" ]]; then
537 echo "--- Downloading previous macOS dylibs"
538 PREVIOUS_DYLIBS_URL
="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz"
539 OSX_ROOTS
="${BUILD_DIR}/macos-roots"
540 mkdir
-p "${OSX_ROOTS}"
541 curl
"${PREVIOUS_DYLIBS_URL}" |
tar -xz --strip-components=1 -C "${OSX_ROOTS}"
544 DEPLOYMENT_TARGET
="${BUILDER#apple-system-backdeployment-hardened-}"
546 # TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib,
547 # only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the
548 # tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib.
549 cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \
550 "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib"
551 cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \
552 "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib"
555 PARAMS
="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}"
556 PARAMS
+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
557 PARAMS
+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
558 PARAMS
+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}"
559 PARAMS
+=";hardening_mode=fast"
561 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
562 -DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
563 -DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \
564 -DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \
565 -DLIBCXX_TEST_PARAMS="${PARAMS}" \
566 -DLIBCXXABI_TEST_PARAMS="${PARAMS}" \
567 -DLIBUNWIND_TEST_PARAMS="${PARAMS}"
571 apple-system-backdeployment-
*)
574 if [[ "${OSX_ROOTS}" == "" ]]; then
575 echo "--- Downloading previous macOS dylibs"
576 PREVIOUS_DYLIBS_URL
="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz"
577 OSX_ROOTS
="${BUILD_DIR}/macos-roots"
578 mkdir
-p "${OSX_ROOTS}"
579 curl
"${PREVIOUS_DYLIBS_URL}" |
tar -xz --strip-components=1 -C "${OSX_ROOTS}"
582 DEPLOYMENT_TARGET
="${BUILDER#apple-system-backdeployment-}"
584 # TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib,
585 # only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the
586 # tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib.
587 cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \
588 "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib"
589 cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \
590 "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib"
593 PARAMS
="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}"
594 PARAMS
+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
595 PARAMS
+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
596 PARAMS
+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}"
598 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
599 -DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
600 -DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \
601 -DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \
602 -DLIBCXX_TEST_PARAMS="${PARAMS}" \
603 -DLIBCXXABI_TEST_PARAMS="${PARAMS}" \
604 -DLIBUNWIND_TEST_PARAMS="${PARAMS}"
615 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake"
618 aarch64-no-exceptions
)
620 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
621 -DLIBCXX_ENABLE_EXCEPTIONS=OFF \
622 -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF
628 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake"
633 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-no-exceptions.cmake"
636 # Armv7 32 bit. One building Arm only one Thumb only code.
639 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake"
644 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-no-exceptions.cmake"
648 test-armv7m-picolibc \
649 -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7M-picolibc.cmake"
651 armv7m-picolibc-no-exceptions
)
652 test-armv7m-picolibc \
653 -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7M-picolibc.cmake" \
654 -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \
655 -DLIBCXXABI_ENABLE_STATIC_UNWINDER=OFF \
656 -DLIBCXX_ENABLE_EXCEPTIONS=OFF \
657 -DLIBCXX_ENABLE_RTTI=OFF
661 # TODO: Currently, building with the experimental library breaks running
662 # tests (the test linking look for the c++experimental library with the
663 # wrong name, and the statically linked c++experimental can't be linked
664 # correctly when libc++ visibility attributes indicate dllimport linkage
665 # anyway), thus just disable the experimental library. Remove this
666 # setting when cmake and the test driver does the right thing automatically.
667 generate-cmake-libcxx-win
-DLIBCXX_TEST_PARAMS="enable_experimental=False"
668 echo "+++ Running the libc++ tests"
669 ${NINJA} -vC "${BUILD_DIR}" check-cxx
673 generate-cmake-libcxx-win
-DLIBCXX_ENABLE_SHARED=OFF
674 echo "+++ Running the libc++ tests"
675 ${NINJA} -vC "${BUILD_DIR}" check-cxx
677 clang-cl-no-vcruntime
)
679 # Building libc++ in the same way as in clang-cl-dll above, but running
680 # tests with -D_HAS_EXCEPTIONS=0, which users might set in certain
681 # translation units while using libc++, even if libc++ is built with
682 # exceptions enabled.
683 generate-cmake-libcxx-win
-DLIBCXX_TEST_PARAMS="enable_experimental=False" \
684 -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-no-vcruntime-clangcl.cfg.in"
685 echo "+++ Running the libc++ tests"
686 ${NINJA} -vC "${BUILD_DIR}" check-cxx
690 generate-cmake-libcxx-win
-DLIBCXX_TEST_PARAMS="enable_experimental=False" \
691 -DCMAKE_BUILD_TYPE=Debug
692 echo "+++ Running the libc++ tests"
693 ${NINJA} -vC "${BUILD_DIR}" check-cxx
697 # Test linking a static libc++ with the static CRT ("MultiThreaded" denotes
698 # the static CRT, as opposed to "MultiThreadedDLL" which is the default).
699 generate-cmake-libcxx-win
-DLIBCXX_ENABLE_SHARED=OFF \
700 -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
701 echo "+++ Running the libc++ tests"
702 ${NINJA} -vC "${BUILD_DIR}" check-cxx
707 -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake"
713 -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake" \
714 -DLIBCXX_ENABLE_SHARED=OFF \
715 -DLIBUNWIND_ENABLE_SHARED=OFF
721 -DCMAKE_C_COMPILER=i686-w64-mingw32-clang \
722 -DCMAKE_CXX_COMPILER=i686-w64-mingw32-clang
++ \
723 -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake"
728 generate-cmake
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/AIX.cmake" \
729 -DLIBCXX_TEST_CONFIG="ibm-libc++-shared.cfg.in" \
730 -DLIBCXXABI_TEST_CONFIG="ibm-libc++abi-shared.cfg.in" \
731 -DLIBUNWIND_TEST_CONFIG="ibm-libunwind-shared.cfg.in"
738 ANDROID_EMU_IMG
="${BUILDER#android-ndk-}"
739 .
"${MONOREPO_ROOT}/libcxx/utils/ci/vendor/android/emulator-functions.sh"
740 if ! validate_emu_img
"${ANDROID_EMU_IMG}"; then
741 echo "error: android-ndk suffix must be a valid emulator image (${ANDROID_EMU_IMG})" >&2
744 ARCH
=$
(arch_of_emu_img
${ANDROID_EMU_IMG})
746 # Use the Android compiler by default.
747 export CC
=${CC:-/opt/android/clang/clang-current/bin/clang}
748 export CXX
=${CXX:-/opt/android/clang/clang-current/bin/clang++}
750 # The NDK libc++_shared.so is always built against the oldest supported API
751 # level. When tests are run against a device with a newer API level, test
752 # programs can be built for any supported API level, but building for the
753 # newest API (i.e. the system image's API) is probably the most interesting.
754 PARAMS
="executor=${MONOREPO_ROOT}/libcxx/utils/adb_run.py;target_triple=$(triple_of_arch ${ARCH})$(api_of_emu_img ${ANDROID_EMU_IMG})"
755 generate-cmake-android
-C "${MONOREPO_ROOT}/runtimes/cmake/android/Arch-${ARCH}.cmake" \
756 -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AndroidNDK.cmake" \
757 -DCMAKE_SYSROOT=/opt
/android
/ndk
/sysroot \
758 -DLIBCXX_TEST_PARAMS="${PARAMS}" \
759 -DLIBCXXABI_TEST_PARAMS="${PARAMS}"
761 ${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi
763 # Start the emulator and make sure we can connect to the adb server running
765 "${MONOREPO_ROOT}/libcxx/utils/ci/vendor/android/start-emulator.sh" ${ANDROID_EMU_IMG}
766 trap "${MONOREPO_ROOT}/libcxx/utils/ci/vendor/android/stop-emulator.sh" EXIT
767 .
"${MONOREPO_ROOT}/libcxx/utils/ci/vendor/android/setup-env-for-emulator.sh"
769 # Create adb_run early to avoid concurrent `mkdir -p` of common parent
771 adb shell mkdir
-p /data
/local
/tmp
/adb_run
772 adb push
"${BUILD_DIR}/lib/libc++_shared.so" /data
/local
/tmp
/libc
++/libc
++_shared.so
773 echo "+++ Running the libc++ tests"
774 ${NINJA} -vC "${BUILD_DIR}" check-cxx
775 echo "+++ Running the libc++abi tests"
776 ${NINJA} -vC "${BUILD_DIR}" check-cxxabi
778 #################################################################
779 # Insert vendor-specific internal configurations below.
781 # This allows vendors to extend this file with their own internal
782 # configurations without running into merge conflicts with upstream.
783 #################################################################
785 #################################################################
787 echo "${BUILDER} is not a known configuration"