Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | #===----------------------------------------------------------------------===## |
| 3 | # |
| 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 |
| 7 | # |
| 8 | #===----------------------------------------------------------------------===## |
| 9 | |
| 10 | set -ex |
Marek Kurdej | 1361c5e | 2021-02-04 20:13:22 | [diff] [blame] | 11 | set -o pipefail |
Arthur O'Dwyer | c92cdb4 | 2021-04-30 18:43:33 | [diff] [blame] | 12 | unset LANG |
| 13 | unset LC_ALL |
| 14 | unset LC_COLLATE |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 15 | |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 16 | PROGNAME="$(basename "${0}")" |
| 17 | |
| 18 | function usage() { |
| 19 | cat <<EOF |
| 20 | Usage: |
| 21 | ${PROGNAME} [options] <BUILDER> |
| 22 | |
| 23 | [-h|--help] Display this help and exit. |
| 24 | |
| 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. |
| 27 | |
Louis Dionne | 75b6726 | 2020-11-06 00:09:03 | [diff] [blame] | 28 | --build-dir <DIR> The directory to use for building the library. By default, |
| 29 | this is '<llvm-root>/build/<builder>'. |
| 30 | |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 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. |
| 35 | EOF |
| 36 | } |
| 37 | |
| 38 | while [[ $# -gt 0 ]]; do |
| 39 | case ${1} in |
| 40 | -h|--help) |
| 41 | usage |
| 42 | exit 0 |
| 43 | ;; |
| 44 | --llvm-root) |
| 45 | MONOREPO_ROOT="${2}" |
| 46 | shift; shift |
| 47 | ;; |
Louis Dionne | 75b6726 | 2020-11-06 00:09:03 | [diff] [blame] | 48 | --build-dir) |
| 49 | BUILD_DIR="${2}" |
| 50 | shift; shift |
| 51 | ;; |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 52 | --osx-roots) |
| 53 | OSX_ROOTS="${2}" |
| 54 | shift; shift |
| 55 | ;; |
| 56 | *) |
| 57 | BUILDER="${1}" |
| 58 | shift |
| 59 | ;; |
| 60 | esac |
| 61 | done |
| 62 | |
| 63 | MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}" |
Louis Dionne | 75b6726 | 2020-11-06 00:09:03 | [diff] [blame] | 64 | BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build/${BUILDER}}" |
Louis Dionne | c01202a | 2021-01-07 22:37:09 | [diff] [blame] | 65 | INSTALL_DIR="${BUILD_DIR}/install" |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 66 | |
Louis Dionne | c42007e | 2021-05-07 17:14:57 | [diff] [blame] | 67 | # If we can find Ninja/CMake provided by Xcode, use those since we know their |
| 68 | # version will generally work with the Clang shipped in Xcode (e.g. if Clang |
| 69 | # knows about -std=c++20, the CMake bundled in Xcode will probably know about |
| 70 | # that flag too). |
| 71 | if xcrun --find ninja &>/dev/null; then NINJA="$(xcrun --find ninja)"; else NINJA="ninja"; fi |
| 72 | if xcrun --find cmake &>/dev/null; then CMAKE="$(xcrun --find cmake)"; else CMAKE="cmake"; fi |
Louis Dionne | c7f244b | 2021-03-04 21:01:36 | [diff] [blame] | 73 | |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 74 | function clean() { |
| 75 | rm -rf "${BUILD_DIR}" |
| 76 | } |
| 77 | |
Martin Storsjö | 9b24ff9 | 2021-04-05 21:17:30 | [diff] [blame] | 78 | function generate-cmake-base() { |
Louis Dionne | 2f8dd26 | 2020-10-23 14:02:14 | [diff] [blame] | 79 | echo "--- Generating CMake" |
Louis Dionne | c42007e | 2021-05-07 17:14:57 | [diff] [blame] | 80 | ${CMAKE} \ |
Louis Dionne | 79175f3 | 2021-10-07 20:19:11 | [diff] [blame] | 81 | -S "${MONOREPO_ROOT}/runtimes" \ |
Louis Dionne | 2f8dd26 | 2020-10-23 14:02:14 | [diff] [blame] | 82 | -B "${BUILD_DIR}" \ |
Louis Dionne | c7f244b | 2021-03-04 21:01:36 | [diff] [blame] | 83 | -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ |
Louis Dionne | 2f8dd26 | 2020-10-23 14:02:14 | [diff] [blame] | 84 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
| 85 | -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ |
Martin Storsjö | 7420cf1 | 2022-02-10 11:08:24 | [diff] [blame] | 86 | -DLIBCXX_ENABLE_WERROR=YES \ |
Martin Storsjö | 64d7f77 | 2022-03-31 08:51:30 | [diff] [blame] | 87 | -DLIBCXXABI_ENABLE_WERROR=YES \ |
| 88 | -DLIBUNWIND_ENABLE_WERROR=YES \ |
Louis Dionne | 222bd83 | 2022-06-07 14:01:01 | [diff] [blame] | 89 | -DLLVM_LIT_ARGS="-sv --show-unsupported --xunit-xml-output test-results.xml --timeout=1500 --time-tests" \ |
Martin Storsjö | 9b24ff9 | 2021-04-05 21:17:30 | [diff] [blame] | 90 | "${@}" |
| 91 | } |
| 92 | |
| 93 | function generate-cmake() { |
| 94 | generate-cmake-base \ |
Louis Dionne | 79175f3 | 2021-10-07 20:19:11 | [diff] [blame] | 95 | -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \ |
Louis Dionne | 2f8dd26 | 2020-10-23 14:02:14 | [diff] [blame] | 96 | -DLIBCXX_CXX_ABI=libcxxabi \ |
Louis Dionne | bb43a0c | 2020-11-05 15:47:06 | [diff] [blame] | 97 | "${@}" |
| 98 | } |
| 99 | |
Martin Storsjö | 9b24ff9 | 2021-04-05 21:17:30 | [diff] [blame] | 100 | function generate-cmake-libcxx-win() { |
| 101 | # TODO: Clang-cl in MSVC configurations don't have access to compiler_rt |
| 102 | # builtins helpers for int128 division. See |
| 103 | # https://reviews.llvm.org/D91139#2429595 for a comment about longterm |
| 104 | # intent for handling the issue. In the meantime, define |
| 105 | # -D_LIBCPP_HAS_NO_INT128 (both when building the library itself and |
| 106 | # when building tests) to allow enabling filesystem for running tests, |
| 107 | # even if it uses a non-permanent ABI. |
Martin Storsjö | 9b24ff9 | 2021-04-05 21:17:30 | [diff] [blame] | 108 | generate-cmake-base \ |
Louis Dionne | 79175f3 | 2021-10-07 20:19:11 | [diff] [blame] | 109 | -DLLVM_ENABLE_RUNTIMES="libcxx" \ |
Martin Storsjö | 9b24ff9 | 2021-04-05 21:17:30 | [diff] [blame] | 110 | -DCMAKE_C_COMPILER=clang-cl \ |
| 111 | -DCMAKE_CXX_COMPILER=clang-cl \ |
| 112 | -DLIBCXX_ENABLE_FILESYSTEM=YES \ |
Martin Storsjö | f68e890 | 2021-12-20 23:19:34 | [diff] [blame] | 113 | -DLIBCXX_EXTRA_SITE_DEFINES="_LIBCPP_HAS_NO_INT128" \ |
Martin Storsjö | 9b24ff9 | 2021-04-05 21:17:30 | [diff] [blame] | 114 | "${@}" |
| 115 | } |
| 116 | |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 117 | function check-runtimes() { |
| 118 | echo "--- Installing libc++, libc++abi and libunwind to a fake location" |
| 119 | ${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi install-unwind |
Louis Dionne | c504c68 | 2021-03-24 13:50:59 | [diff] [blame] | 120 | |
Louis Dionne | 2f8dd26 | 2020-10-23 14:02:14 | [diff] [blame] | 121 | echo "+++ Running the libc++ tests" |
Louis Dionne | 116b852 | 2021-03-19 23:26:15 | [diff] [blame] | 122 | ${NINJA} -vC "${BUILD_DIR}" check-cxx |
Louis Dionne | 2f8dd26 | 2020-10-23 14:02:14 | [diff] [blame] | 123 | |
| 124 | echo "+++ Running the libc++abi tests" |
Louis Dionne | 116b852 | 2021-03-19 23:26:15 | [diff] [blame] | 125 | ${NINJA} -vC "${BUILD_DIR}" check-cxxabi |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 126 | |
| 127 | echo "+++ Running the libunwind tests" |
| 128 | ${NINJA} -vC "${BUILD_DIR}" check-unwind |
Louis Dionne | 2f8dd26 | 2020-10-23 14:02:14 | [diff] [blame] | 129 | } |
| 130 | |
Louis Dionne | da1b50d | 2020-11-26 20:00:42 | [diff] [blame] | 131 | # TODO: The goal is to test this against all configurations. We should also move |
| 132 | # this to the Lit test suite instead of being a separate CMake target. |
| 133 | function check-abi-list() { |
| 134 | echo "+++ Running the libc++ ABI list test" |
Louis Dionne | 116b852 | 2021-03-19 23:26:15 | [diff] [blame] | 135 | ${NINJA} -vC "${BUILD_DIR}" check-cxx-abilist || ( |
Marek Kurdej | a984dca | 2020-12-02 07:57:02 | [diff] [blame] | 136 | echo "+++ Generating the libc++ ABI list after failed check" |
Louis Dionne | 116b852 | 2021-03-19 23:26:15 | [diff] [blame] | 137 | ${NINJA} -vC "${BUILD_DIR}" generate-cxx-abilist |
Marek Kurdej | a984dca | 2020-12-02 07:57:02 | [diff] [blame] | 138 | false |
| 139 | ) |
Louis Dionne | da1b50d | 2020-11-26 20:00:42 | [diff] [blame] | 140 | } |
| 141 | |
Louis Dionne | 2f8dd26 | 2020-10-23 14:02:14 | [diff] [blame] | 142 | function check-cxx-benchmarks() { |
| 143 | echo "--- Running the benchmarks" |
Louis Dionne | 116b852 | 2021-03-19 23:26:15 | [diff] [blame] | 144 | ${NINJA} -vC "${BUILD_DIR}" check-cxx-benchmarks |
Louis Dionne | 2f8dd26 | 2020-10-23 14:02:14 | [diff] [blame] | 145 | } |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 146 | |
Louis Dionne | e93c95d | 2021-04-01 17:40:04 | [diff] [blame] | 147 | # Print the version of a few tools to aid diagnostics in some cases |
Louis Dionne | c42007e | 2021-05-07 17:14:57 | [diff] [blame] | 148 | ${CMAKE} --version |
Louis Dionne | e93c95d | 2021-04-01 17:40:04 | [diff] [blame] | 149 | ${NINJA} --version |
| 150 | |
Mark de Wever | c632ee1 | 2022-09-01 16:38:03 | [diff] [blame] | 151 | if [ ! -z "${CXX}" ]; then ${CXX} --version; fi |
| 152 | |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 153 | case "${BUILDER}" in |
Marek Kurdej | 1361c5e | 2021-02-04 20:13:22 | [diff] [blame] | 154 | check-format) |
| 155 | clean |
| 156 | echo "+++ Checking formatting" |
| 157 | # We need to set --extensions so that clang-format checks extensionless files. |
| 158 | mkdir -p ${BUILD_DIR} |
| 159 | git-clang-format \ |
| 160 | --binary /usr/bin/clang-format --diff \ |
| 161 | --extensions ',h,hh,hpp,hxx,c,cc,cxx,cpp' HEAD~1 \ |
| 162 | -- \ |
| 163 | libcxx/{benchmarks,include,src,test} \ |
| 164 | libcxxabi/{fuzz,include,src,test} \ |
| 165 | | tee ${BUILD_DIR}/clang-format.patch |
| 166 | # Check if the diff is empty, fail otherwise. |
| 167 | ! grep -q '^--- a' ${BUILD_DIR}/clang-format.patch |
| 168 | ;; |
Mark de Wever | ae10300 | 2021-04-04 18:11:48 | [diff] [blame] | 169 | check-generated-output) |
Mark de Wever | bf72f6b | 2021-04-28 17:13:52 | [diff] [blame] | 170 | # `! foo` doesn't work properly with `set -e`, use `! foo || false` instead. |
| 171 | # https://stackoverflow.com/questions/57681955/set-e-does-not-respect-logical-not |
Mark de Wever | ae10300 | 2021-04-04 18:11:48 | [diff] [blame] | 172 | clean |
Louis Dionne | 1f8e286 | 2021-07-15 14:19:39 | [diff] [blame] | 173 | generate-cmake |
| 174 | |
| 175 | # Reject patches that forgot to re-run the generator scripts. |
| 176 | echo "+++ Making sure the generator scripts were run" |
| 177 | ${NINJA} -vC "${BUILD_DIR}" libcxx-generate-files |
Mark de Wever | ae10300 | 2021-04-04 18:11:48 | [diff] [blame] | 178 | git diff | tee ${BUILD_DIR}/generated_output.patch |
Mark de Wever | 1139fd4 | 2021-07-22 09:17:53 | [diff] [blame] | 179 | git ls-files -o --exclude-standard | tee ${BUILD_DIR}/generated_output.status |
Mark de Wever | bf72f6b | 2021-04-28 17:13:52 | [diff] [blame] | 180 | ! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false |
Mark de Wever | 1139fd4 | 2021-07-22 09:17:53 | [diff] [blame] | 181 | if [ -s ${BUILD_DIR}/generated_output.status ]; then |
| 182 | echo "It looks like not all the generator scripts were run," |
| 183 | echo "did you forget to build the libcxx-generate-files target?" |
| 184 | echo "Did you add all new files it generated?" |
| 185 | false |
| 186 | fi |
Louis Dionne | 1f8e286 | 2021-07-15 14:19:39 | [diff] [blame] | 187 | |
Mark de Wever | bf72f6b | 2021-04-28 17:13:52 | [diff] [blame] | 188 | # Reject patches that introduce non-ASCII characters or hard tabs. |
Arthur O'Dwyer | c92cdb4 | 2021-04-30 18:43:33 | [diff] [blame] | 189 | # Depends on LC_COLLATE set at the top of this script. |
Louis Dionne | 355e0ce | 2022-08-18 21:41:13 | [diff] [blame] | 190 | ! grep -rn '[^ -~]' libcxx/include libcxx/src libcxx/test libcxx/benchmarks \ |
| 191 | --exclude '*.dat' \ |
Mark de Wever | a480073 | 2022-05-05 06:03:58 | [diff] [blame^] | 192 | --exclude 'escaped_output.*.pass.cpp' \ |
Mark de Wever | e5d2d3e | 2022-03-20 12:40:02 | [diff] [blame] | 193 | --exclude 'format_tests.h' \ |
Mark de Wever | 3eb4f16 | 2022-03-20 12:40:02 | [diff] [blame] | 194 | --exclude 'formatter.*.pass.cpp' \ |
Louis Dionne | 355e0ce | 2022-08-18 21:41:13 | [diff] [blame] | 195 | --exclude 'grep.pass.cpp' \ |
| 196 | --exclude 'locale-specific_form.pass.cpp' \ |
Mark de Wever | 1522f19 | 2022-03-20 12:40:02 | [diff] [blame] | 197 | --exclude 'ostream.pass.cpp' \ |
Mark de Wever | e5d2d3e | 2022-03-20 12:40:02 | [diff] [blame] | 198 | --exclude 'std_format_spec_string_unicode.bench.cpp' \ |
| 199 | || false |
Louis Dionne | 1f8e286 | 2021-07-15 14:19:39 | [diff] [blame] | 200 | |
Louis Dionne | 89469df | 2022-08-18 20:49:06 | [diff] [blame] | 201 | # Reject code with trailing whitespace |
| 202 | ! grep -rn '[[:blank:]]$' libcxx/include libcxx/src libcxx/test libcxx/benchmarks || false |
Mark de Wever | ae10300 | 2021-04-04 18:11:48 | [diff] [blame] | 203 | ;; |
Louis Dionne | ba9b150 | 2020-10-01 17:55:39 | [diff] [blame] | 204 | generic-cxx03) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 205 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 206 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 207 | check-runtimes |
Louis Dionne | da1b50d | 2020-11-26 20:00:42 | [diff] [blame] | 208 | check-abi-list |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 209 | ;; |
Louis Dionne | ba9b150 | 2020-10-01 17:55:39 | [diff] [blame] | 210 | generic-cxx11) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 211 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 212 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 213 | check-runtimes |
Louis Dionne | da1b50d | 2020-11-26 20:00:42 | [diff] [blame] | 214 | check-abi-list |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 215 | ;; |
Louis Dionne | ba9b150 | 2020-10-01 17:55:39 | [diff] [blame] | 216 | generic-cxx14) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 217 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 218 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 219 | check-runtimes |
Louis Dionne | da1b50d | 2020-11-26 20:00:42 | [diff] [blame] | 220 | check-abi-list |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 221 | ;; |
Louis Dionne | ba9b150 | 2020-10-01 17:55:39 | [diff] [blame] | 222 | generic-cxx17) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 223 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 224 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 225 | check-runtimes |
Louis Dionne | da1b50d | 2020-11-26 20:00:42 | [diff] [blame] | 226 | check-abi-list |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 227 | ;; |
Marek Kurdej | 044b892 | 2021-01-07 11:29:04 | [diff] [blame] | 228 | generic-cxx20) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 229 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 230 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 231 | check-runtimes |
Louis Dionne | da1b50d | 2020-11-26 20:00:42 | [diff] [blame] | 232 | check-abi-list |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 233 | ;; |
Marek Kurdej | 95729f9 | 2021-01-08 17:40:42 | [diff] [blame] | 234 | generic-cxx2b) |
Marek Kurdej | 95729f9 | 2021-01-08 17:40:42 | [diff] [blame] | 235 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 236 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 237 | check-runtimes |
Marek Kurdej | 95729f9 | 2021-01-08 17:40:42 | [diff] [blame] | 238 | check-abi-list |
| 239 | ;; |
Louis Dionne | b648c61 | 2021-06-09 13:41:27 | [diff] [blame] | 240 | generic-assertions) |
Louis Dionne | b648c61 | 2021-06-09 13:41:27 | [diff] [blame] | 241 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 242 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 243 | check-runtimes |
Louis Dionne | b648c61 | 2021-06-09 13:41:27 | [diff] [blame] | 244 | check-abi-list |
| 245 | ;; |
Louis Dionne | f3966ea | 2022-04-01 20:38:30 | [diff] [blame] | 246 | generic-debug-mode) |
Arthur O'Dwyer | 86d1f59 | 2021-04-20 15:27:03 | [diff] [blame] | 247 | clean |
Louis Dionne | f3966ea | 2022-04-01 20:38:30 | [diff] [blame] | 248 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-mode.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 249 | check-runtimes |
Louis Dionne | f1c3013 | 2022-07-19 15:04:31 | [diff] [blame] | 250 | # We don't check the ABI lists because the debug mode ABI is not stable |
Arthur O'Dwyer | 86d1f59 | 2021-04-20 15:27:03 | [diff] [blame] | 251 | ;; |
Louis Dionne | ba9b150 | 2020-10-01 17:55:39 | [diff] [blame] | 252 | generic-noexceptions) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 253 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 254 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 255 | check-runtimes |
Louis Dionne | 0e628a7 | 2022-02-14 19:39:17 | [diff] [blame] | 256 | check-abi-list |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 257 | ;; |
Louis Dionne | 4d680b0 | 2021-06-02 21:07:57 | [diff] [blame] | 258 | generic-modules) |
Louis Dionne | 4d680b0 | 2021-06-02 21:07:57 | [diff] [blame] | 259 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 260 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 261 | check-runtimes |
Louis Dionne | 0e628a7 | 2022-02-14 19:39:17 | [diff] [blame] | 262 | check-abi-list |
Louis Dionne | 4d680b0 | 2021-06-02 21:07:57 | [diff] [blame] | 263 | ;; |
Louis Dionne | c504c68 | 2021-03-24 13:50:59 | [diff] [blame] | 264 | generic-static) |
Louis Dionne | c504c68 | 2021-03-24 13:50:59 | [diff] [blame] | 265 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 266 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 267 | check-runtimes |
Louis Dionne | c504c68 | 2021-03-24 13:50:59 | [diff] [blame] | 268 | ;; |
Louis Dionne | fa7ce8e | 2022-05-18 16:05:45 | [diff] [blame] | 269 | generic-merged) |
| 270 | clean |
| 271 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-merged.cmake" \ |
| 272 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \ |
| 273 | -DLIBCXXABI_TEST_CONFIG="llvm-libc++abi-merged.cfg.in" \ |
| 274 | -DLIBUNWIND_TEST_CONFIG="llvm-libunwind-merged.cfg.in" |
| 275 | check-runtimes |
| 276 | ;; |
Louis Dionne | ba9b150 | 2020-10-01 17:55:39 | [diff] [blame] | 277 | generic-gcc) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 278 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 279 | generate-cmake -DLIBCXX_ENABLE_WERROR=NO \ |
Martin Storsjö | 64d7f77 | 2022-03-31 08:51:30 | [diff] [blame] | 280 | -DLIBCXXABI_ENABLE_WERROR=NO \ |
| 281 | -DLIBUNWIND_ENABLE_WERROR=NO |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 282 | check-runtimes |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 283 | ;; |
Louis Dionne | 851a335 | 2021-07-15 13:46:36 | [diff] [blame] | 284 | generic-gcc-cxx11) |
Louis Dionne | 851a335 | 2021-07-15 13:46:36 | [diff] [blame] | 285 | clean |
Louis Dionne | c07b80c | 2021-10-07 18:54:14 | [diff] [blame] | 286 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \ |
Martin Storsjö | 64d7f77 | 2022-03-31 08:51:30 | [diff] [blame] | 287 | -DLIBCXX_ENABLE_WERROR=NO \ |
| 288 | -DLIBCXXABI_ENABLE_WERROR=NO \ |
| 289 | -DLIBUNWIND_ENABLE_WERROR=NO |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 290 | check-runtimes |
Louis Dionne | 851a335 | 2021-07-15 13:46:36 | [diff] [blame] | 291 | ;; |
Louis Dionne | ba9b150 | 2020-10-01 17:55:39 | [diff] [blame] | 292 | generic-asan) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 293 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 294 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 295 | check-runtimes |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 296 | ;; |
Louis Dionne | ba9b150 | 2020-10-01 17:55:39 | [diff] [blame] | 297 | generic-msan) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 298 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 299 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 300 | check-runtimes |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 301 | ;; |
Louis Dionne | ba9b150 | 2020-10-01 17:55:39 | [diff] [blame] | 302 | generic-tsan) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 303 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 304 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 305 | check-runtimes |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 306 | ;; |
Louis Dionne | ba9b150 | 2020-10-01 17:55:39 | [diff] [blame] | 307 | generic-ubsan) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 308 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 309 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 310 | check-runtimes |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 311 | ;; |
Louis Dionne | ba9b150 | 2020-10-01 17:55:39 | [diff] [blame] | 312 | generic-with_llvm_unwinder) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 313 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 314 | generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 315 | check-runtimes |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 316 | ;; |
Louis Dionne | de4a57c | 2022-06-27 19:53:41 | [diff] [blame] | 317 | generic-no-transitive-includes) |
| 318 | clean |
| 319 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-transitive-includes.cmake" |
| 320 | check-runtimes |
| 321 | ;; |
Louis Dionne | a9a6e20 | 2022-05-24 13:58:04 | [diff] [blame] | 322 | generic-no-threads) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 323 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 324 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-threads.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 325 | check-runtimes |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 326 | ;; |
Louis Dionne | 933518f | 2021-01-18 17:18:18 | [diff] [blame] | 327 | generic-no-filesystem) |
Louis Dionne | 933518f | 2021-01-18 17:18:18 | [diff] [blame] | 328 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 329 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 330 | check-runtimes |
Louis Dionne | 933518f | 2021-01-18 17:18:18 | [diff] [blame] | 331 | ;; |
Louis Dionne | e0d0129 | 2020-10-15 14:32:09 | [diff] [blame] | 332 | generic-no-random_device) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 333 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 334 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 335 | check-runtimes |
Louis Dionne | e0d0129 | 2020-10-15 14:32:09 | [diff] [blame] | 336 | ;; |
Louis Dionne | 88ffc72 | 2020-10-09 19:31:05 | [diff] [blame] | 337 | generic-no-localization) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 338 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 339 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 340 | check-runtimes |
Louis Dionne | 88ffc72 | 2020-10-09 19:31:05 | [diff] [blame] | 341 | ;; |
Mark de Wever | df2af99 | 2021-05-25 18:11:08 | [diff] [blame] | 342 | generic-no-unicode) |
Mark de Wever | df2af99 | 2021-05-25 18:11:08 | [diff] [blame] | 343 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 344 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 345 | check-runtimes |
Mark de Wever | df2af99 | 2021-05-25 18:11:08 | [diff] [blame] | 346 | ;; |
Louis Dionne | f4c1258 | 2021-08-23 19:32:36 | [diff] [blame] | 347 | generic-no-wide-characters) |
| 348 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 349 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake" |
Louis Dionne | f4c1258 | 2021-08-23 19:32:36 | [diff] [blame] | 350 | check-runtimes |
| 351 | ;; |
Louis Dionne | 99ae458 | 2022-02-01 21:32:39 | [diff] [blame] | 352 | generic-no-experimental) |
| 353 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 354 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-experimental.cmake" |
Louis Dionne | 99ae458 | 2022-02-01 21:32:39 | [diff] [blame] | 355 | check-runtimes |
Louis Dionne | 0e628a7 | 2022-02-14 19:39:17 | [diff] [blame] | 356 | check-abi-list |
Louis Dionne | 99ae458 | 2022-02-01 21:32:39 | [diff] [blame] | 357 | ;; |
Nikolas Klauser | 5488021 | 2022-02-05 13:09:45 | [diff] [blame] | 358 | generic-abi-unstable) |
| 359 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 360 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-abi-unstable.cmake" |
Nikolas Klauser | 5488021 | 2022-02-05 13:09:45 | [diff] [blame] | 361 | check-runtimes |
| 362 | ;; |
Louis Dionne | 25cbf72 | 2021-10-15 04:21:26 | [diff] [blame] | 363 | apple-system) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 364 | clean |
Louis Dionne | 25cbf72 | 2021-10-15 04:21:26 | [diff] [blame] | 365 | |
Louis Dionne | 25cbf72 | 2021-10-15 04:21:26 | [diff] [blame] | 366 | arch="$(uname -m)" |
Louis Dionne | 1b06d2c | 2022-02-03 15:57:49 | [diff] [blame] | 367 | xcrun --sdk macosx \ |
| 368 | ${MONOREPO_ROOT}/libcxx/utils/ci/apple-install-libcxx.sh \ |
| 369 | --llvm-root ${MONOREPO_ROOT} \ |
| 370 | --build-dir ${BUILD_DIR} \ |
| 371 | --install-dir ${INSTALL_DIR} \ |
| 372 | --symbols-dir "${BUILD_DIR}/symbols" \ |
| 373 | --architectures "${arch}" \ |
| 374 | --version "999.99" |
Louis Dionne | 25cbf72 | 2021-10-15 04:21:26 | [diff] [blame] | 375 | |
| 376 | # TODO: It would be better to run the tests against the fake-installed version of libc++ instead |
Louis Dionne | 0e628a7 | 2022-02-14 19:39:17 | [diff] [blame] | 377 | xcrun --sdk macosx ninja -vC "${BUILD_DIR}/${arch}" check-cxx check-cxxabi check-cxx-abilist |
Louis Dionne | 79410dd | 2020-10-01 12:55:40 | [diff] [blame] | 378 | ;; |
Louis Dionne | e36f9e1 | 2022-08-04 19:25:48 | [diff] [blame] | 379 | apple-system-backdeployment-assertions-*) |
| 380 | clean |
| 381 | |
| 382 | if [[ "${OSX_ROOTS}" == "" ]]; then |
| 383 | echo "--- Downloading previous macOS dylibs" |
| 384 | PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz" |
| 385 | OSX_ROOTS="${BUILD_DIR}/macos-roots" |
| 386 | mkdir -p "${OSX_ROOTS}" |
| 387 | curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}" |
| 388 | fi |
| 389 | |
| 390 | DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-assertions-}" |
| 391 | |
| 392 | # TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib, |
| 393 | # only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the |
| 394 | # tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib. |
| 395 | cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \ |
| 396 | "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib" |
| 397 | cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \ |
| 398 | "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib" |
| 399 | |
| 400 | arch="$(uname -m)" |
| 401 | PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}" |
| 402 | PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}" |
| 403 | PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}" |
| 404 | PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}" |
| 405 | PARAMS+=";use_system_cxx_lib=True" |
| 406 | PARAMS+=";enable_assertions=True" |
| 407 | # TODO: Enable experimental features during back-deployment -- right now some of the availability |
| 408 | # annotations are incorrect, leading to test failures that could be avoided. |
| 409 | PARAMS+=";enable_experimental=False" |
| 410 | |
| 411 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ |
| 412 | -DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \ |
| 413 | -DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \ |
| 414 | -DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \ |
| 415 | -DLIBCXX_TEST_PARAMS="${PARAMS}" \ |
| 416 | -DLIBCXXABI_TEST_PARAMS="${PARAMS}" \ |
| 417 | -DLIBUNWIND_TEST_PARAMS="${PARAMS}" |
| 418 | |
| 419 | check-runtimes |
| 420 | ;; |
Louis Dionne | 25cbf72 | 2021-10-15 04:21:26 | [diff] [blame] | 421 | apple-system-backdeployment-*) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 422 | clean |
Louis Dionne | bb43a0c | 2020-11-05 15:47:06 | [diff] [blame] | 423 | |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 424 | if [[ "${OSX_ROOTS}" == "" ]]; then |
| 425 | echo "--- Downloading previous macOS dylibs" |
Louis Dionne | d4d8f03 | 2022-03-15 20:18:45 | [diff] [blame] | 426 | PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz" |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 427 | OSX_ROOTS="${BUILD_DIR}/macos-roots" |
| 428 | mkdir -p "${OSX_ROOTS}" |
| 429 | curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}" |
| 430 | fi |
Louis Dionne | bb43a0c | 2020-11-05 15:47:06 | [diff] [blame] | 431 | |
Louis Dionne | 25cbf72 | 2021-10-15 04:21:26 | [diff] [blame] | 432 | DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-}" |
Louis Dionne | 60ba1fe | 2020-07-08 20:38:54 | [diff] [blame] | 433 | |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 434 | # TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib, |
| 435 | # only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the |
| 436 | # tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib. |
Louis Dionne | 60ba1fe | 2020-07-08 20:38:54 | [diff] [blame] | 437 | cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \ |
| 438 | "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib" |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 439 | cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \ |
| 440 | "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib" |
Louis Dionne | 60ba1fe | 2020-07-08 20:38:54 | [diff] [blame] | 441 | |
Louis Dionne | 25cbf72 | 2021-10-15 04:21:26 | [diff] [blame] | 442 | arch="$(uname -m)" |
| 443 | PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}" |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 444 | PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}" |
Louis Dionne | 60ba1fe | 2020-07-08 20:38:54 | [diff] [blame] | 445 | PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}" |
Louis Dionne | 8c06061 | 2022-02-10 19:03:05 | [diff] [blame] | 446 | PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}" |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 447 | PARAMS+=";use_system_cxx_lib=True" |
Louis Dionne | 8711fca | 2022-06-30 15:57:52 | [diff] [blame] | 448 | # TODO: Enable experimental features during back-deployment -- right now some of the availability |
| 449 | # annotations are incorrect, leading to test failures that could be avoided. |
| 450 | PARAMS+=";enable_experimental=False" |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 451 | |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 452 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ |
Louis Dionne | 768b50d | 2022-02-07 22:25:41 | [diff] [blame] | 453 | -DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \ |
Louis Dionne | 8c06061 | 2022-02-10 19:03:05 | [diff] [blame] | 454 | -DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \ |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 455 | -DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \ |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 456 | -DLIBCXX_TEST_PARAMS="${PARAMS}" \ |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 457 | -DLIBCXXABI_TEST_PARAMS="${PARAMS}" \ |
| 458 | -DLIBUNWIND_TEST_PARAMS="${PARAMS}" |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 459 | |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 460 | check-runtimes |
Louis Dionne | bb43a0c | 2020-11-05 15:47:06 | [diff] [blame] | 461 | ;; |
Louis Dionne | 2f8dd26 | 2020-10-23 14:02:14 | [diff] [blame] | 462 | benchmarks) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 463 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 464 | generate-cmake |
Louis Dionne | 2f8dd26 | 2020-10-23 14:02:14 | [diff] [blame] | 465 | check-cxx-benchmarks |
Louis Dionne | 79410dd | 2020-10-01 12:55:40 | [diff] [blame] | 466 | ;; |
Louis Dionne | f7e4f04 | 2020-11-05 19:34:29 | [diff] [blame] | 467 | documentation) |
Louis Dionne | 3790e17 | 2020-11-06 00:02:32 | [diff] [blame] | 468 | clean |
| 469 | generate-cmake -DLLVM_ENABLE_SPHINX=ON |
| 470 | |
| 471 | echo "+++ Generating documentation" |
Louis Dionne | 116b852 | 2021-03-19 23:26:15 | [diff] [blame] | 472 | ${NINJA} -vC "${BUILD_DIR}" docs-libcxx-html |
Louis Dionne | f7e4f04 | 2020-11-05 19:34:29 | [diff] [blame] | 473 | ;; |
Louis Dionne | 3cea250 | 2021-10-20 21:43:55 | [diff] [blame] | 474 | bootstrapping-build) |
Louis Dionne | 180e9e5 | 2021-03-16 18:57:42 | [diff] [blame] | 475 | clean |
| 476 | |
| 477 | echo "--- Generating CMake" |
Louis Dionne | c42007e | 2021-05-07 17:14:57 | [diff] [blame] | 478 | ${CMAKE} \ |
| 479 | -S "${MONOREPO_ROOT}/llvm" \ |
Louis Dionne | 180e9e5 | 2021-03-16 18:57:42 | [diff] [blame] | 480 | -B "${BUILD_DIR}" \ |
Louis Dionne | c42007e | 2021-05-07 17:14:57 | [diff] [blame] | 481 | -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ |
Mark de Wever | ade336de | 2021-12-08 16:58:51 | [diff] [blame] | 482 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
Louis Dionne | 180e9e5 | 2021-03-16 18:57:42 | [diff] [blame] | 483 | -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ |
| 484 | -DLLVM_ENABLE_PROJECTS="clang" \ |
Louis Dionne | 5082b94 | 2022-03-18 14:03:01 | [diff] [blame] | 485 | -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \ |
Louis Dionne | 3016ceb | 2021-11-11 16:55:20 | [diff] [blame] | 486 | -DLLVM_RUNTIME_TARGETS="$(c++ --print-target-triple)" \ |
Matheus Izvekov | 35f798d | 2021-11-15 23:32:48 | [diff] [blame] | 487 | -DLLVM_TARGETS_TO_BUILD="host" \ |
Louis Dionne | 3016ceb | 2021-11-11 16:55:20 | [diff] [blame] | 488 | -DRUNTIMES_BUILD_ALLOW_DARWIN=ON \ |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 489 | -DLLVM_ENABLE_ASSERTIONS=ON |
Louis Dionne | 180e9e5 | 2021-03-16 18:57:42 | [diff] [blame] | 490 | |
| 491 | echo "+++ Running the libc++ and libc++abi tests" |
| 492 | ${NINJA} -C "${BUILD_DIR}" check-runtimes |
| 493 | |
| 494 | echo "--- Installing libc++ and libc++abi to a fake location" |
Louis Dionne | 2ce0df4 | 2021-07-06 14:39:01 | [diff] [blame] | 495 | ${NINJA} -C "${BUILD_DIR}" install-runtimes |
Louis Dionne | 180e9e5 | 2021-03-16 18:57:42 | [diff] [blame] | 496 | ;; |
David Spickett | 6e5342a | 2021-02-08 10:43:21 | [diff] [blame] | 497 | aarch64) |
| 498 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 499 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 500 | check-runtimes |
David Spickett | 6e5342a | 2021-02-08 10:43:21 | [diff] [blame] | 501 | ;; |
| 502 | aarch64-noexceptions) |
| 503 | clean |
| 504 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \ |
Louis Dionne | 4628ff4 | 2021-07-15 17:29:47 | [diff] [blame] | 505 | -DLIBCXX_ENABLE_EXCEPTIONS=OFF \ |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 506 | -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 507 | check-runtimes |
David Spickett | 6e5342a | 2021-02-08 10:43:21 | [diff] [blame] | 508 | ;; |
David Spickett | 44e36fc | 2021-03-02 15:07:19 | [diff] [blame] | 509 | # Aka Armv8 32 bit |
| 510 | armv8) |
| 511 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 512 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 513 | check-runtimes |
David Spickett | 44e36fc | 2021-03-02 15:07:19 | [diff] [blame] | 514 | ;; |
| 515 | armv8-noexceptions) |
| 516 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 517 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 518 | check-runtimes |
David Spickett | 44e36fc | 2021-03-02 15:07:19 | [diff] [blame] | 519 | ;; |
| 520 | # Armv7 32 bit. One building Arm only one Thumb only code. |
| 521 | armv7) |
| 522 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 523 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 524 | check-runtimes |
David Spickett | 44e36fc | 2021-03-02 15:07:19 | [diff] [blame] | 525 | ;; |
| 526 | armv7-noexceptions) |
| 527 | clean |
Louis Dionne | 92bbcfa | 2022-05-26 14:19:25 | [diff] [blame] | 528 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake" |
Louis Dionne | 60fe1f5 | 2021-09-30 19:11:48 | [diff] [blame] | 529 | check-runtimes |
David Spickett | 44e36fc | 2021-03-02 15:07:19 | [diff] [blame] | 530 | ;; |
Martin Storsjö | f5ca3ac | 2021-10-01 20:08:57 | [diff] [blame] | 531 | clang-cl-dll) |
Martin Storsjö | 740e349 | 2021-03-17 10:10:42 | [diff] [blame] | 532 | clean |
Martin Storsjö | 740e349 | 2021-03-17 10:10:42 | [diff] [blame] | 533 | # TODO: Currently, building with the experimental library breaks running |
| 534 | # tests (the test linking look for the c++experimental library with the |
| 535 | # wrong name, and the statically linked c++experimental can't be linked |
| 536 | # correctly when libc++ visibility attributes indicate dllimport linkage |
| 537 | # anyway), thus just disable the experimental library. Remove this |
| 538 | # setting when cmake and the test driver does the right thing automatically. |
Louis Dionne | 7300a65 | 2022-07-19 14:44:06 | [diff] [blame] | 539 | generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS="enable_experimental=False" |
Martin Storsjö | 9b24ff9 | 2021-04-05 21:17:30 | [diff] [blame] | 540 | echo "+++ Running the libc++ tests" |
| 541 | ${NINJA} -vC "${BUILD_DIR}" check-cxx |
| 542 | ;; |
Martin Storsjö | f5ca3ac | 2021-10-01 20:08:57 | [diff] [blame] | 543 | clang-cl-static) |
Martin Storsjö | 9b24ff9 | 2021-04-05 21:17:30 | [diff] [blame] | 544 | clean |
Louis Dionne | d0af427 | 2022-03-14 18:23:38 | [diff] [blame] | 545 | generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF |
Martin Storsjö | 740e349 | 2021-03-17 10:10:42 | [diff] [blame] | 546 | echo "+++ Running the libc++ tests" |
| 547 | ${NINJA} -vC "${BUILD_DIR}" check-cxx |
| 548 | ;; |
Paul Kirth | 56a3445 | 2022-08-17 20:57:59 | [diff] [blame] | 549 | clang-cl-no-vcruntime) |
| 550 | clean |
| 551 | # Building libc++ in the same way as in clang-cl-dll above, but running |
| 552 | # tests with -D_HAS_EXCEPTIONS=0, which users might set in certain |
| 553 | # translation units while using libc++, even if libc++ is built with |
| 554 | # exceptions enabled. |
| 555 | generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS="enable_experimental=False" \ |
| 556 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-no-vcruntime-clangcl.cfg.in" |
| 557 | echo "+++ Running the libc++ tests" |
| 558 | ${NINJA} -vC "${BUILD_DIR}" check-cxx |
| 559 | ;; |
Martin Storsjö | f5ca3ac | 2021-10-01 20:08:57 | [diff] [blame] | 560 | mingw-dll) |
| 561 | clean |
| 562 | # Explicitly specify the compiler with a triple prefix. The CI |
| 563 | # environment has got two installations of Clang; the default one |
| 564 | # defaults to MSVC mode, while there's an installation of llvm-mingw |
| 565 | # further back in PATH. By calling the compiler with an explicit |
| 566 | # triple prefix, we use the one that is bundled with a mingw sysroot. |
| 567 | generate-cmake \ |
| 568 | -DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \ |
| 569 | -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \ |
| 570 | -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake" |
| 571 | echo "+++ Running the libc++ tests" |
| 572 | ${NINJA} -vC "${BUILD_DIR}" check-cxx |
| 573 | ;; |
| 574 | mingw-static) |
| 575 | clean |
| 576 | generate-cmake \ |
| 577 | -DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \ |
| 578 | -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \ |
| 579 | -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake" \ |
| 580 | -DLIBCXX_ENABLE_SHARED=OFF \ |
| 581 | -DLIBUNWIND_ENABLE_SHARED=OFF |
| 582 | echo "+++ Running the libc++ tests" |
| 583 | ${NINJA} -vC "${BUILD_DIR}" check-cxx |
| 584 | ;; |
Martin Storsjö | 30194d4 | 2022-05-04 08:05:44 | [diff] [blame] | 585 | mingw-dll-i686) |
| 586 | clean |
| 587 | generate-cmake \ |
| 588 | -DCMAKE_C_COMPILER=i686-w64-mingw32-clang \ |
| 589 | -DCMAKE_CXX_COMPILER=i686-w64-mingw32-clang++ \ |
| 590 | -C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake" |
| 591 | echo "+++ Running the libc++ tests" |
| 592 | ${NINJA} -vC "${BUILD_DIR}" check-cxx |
| 593 | ;; |
David Tenty | 228b3b7 | 2021-10-13 15:41:47 | [diff] [blame] | 594 | aix) |
David Tenty | 228b3b7 | 2021-10-13 15:41:47 | [diff] [blame] | 595 | clean |
David Tenty | 2b416b4 | 2021-11-09 17:44:44 | [diff] [blame] | 596 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AIX.cmake" \ |
David Tenty | 228b3b7 | 2021-10-13 15:41:47 | [diff] [blame] | 597 | -DLIBCXX_TEST_CONFIG="ibm-libc++-shared.cfg.in" \ |
David Tenty | 2b416b4 | 2021-11-09 17:44:44 | [diff] [blame] | 598 | -DLIBCXXABI_TEST_CONFIG="ibm-libc++abi-shared.cfg.in" \ |
Xing Xue | dfaee3c | 2022-06-02 13:03:10 | [diff] [blame] | 599 | -DLIBUNWIND_TEST_CONFIG="ibm-libunwind-shared.cfg.in" |
Jake Egan | 3af7aa5 | 2022-06-14 17:15:46 | [diff] [blame] | 600 | check-abi-list |
Xing Xue | dfaee3c | 2022-06-02 13:03:10 | [diff] [blame] | 601 | check-runtimes |
David Tenty | 228b3b7 | 2021-10-13 15:41:47 | [diff] [blame] | 602 | ;; |
Louis Dionne | aad878f | 2021-05-27 20:51:38 | [diff] [blame] | 603 | ################################################################# |
| 604 | # Insert vendor-specific internal configurations below. |
| 605 | # |
| 606 | # This allows vendors to extend this file with their own internal |
| 607 | # configurations without running into merge conflicts with upstream. |
| 608 | ################################################################# |
| 609 | |
| 610 | ################################################################# |
Louis Dionne | 9f21d34 | 2020-09-23 13:20:03 | [diff] [blame] | 611 | *) |
| 612 | echo "${BUILDER} is not a known configuration" |
| 613 | exit 1 |
| 614 | ;; |
| 615 | esac |