Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [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 | 0544936 | 2021-02-04 21:13:22 +0100 | [diff] [blame] | 11 | set -o pipefail |
Arthur O'Dwyer | 757d5bd | 2021-04-30 14:43:33 -0400 | [diff] [blame] | 12 | unset LANG |
| 13 | unset LC_ALL |
| 14 | unset LC_COLLATE |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 15 | |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [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 | 04bf103 | 2020-11-05 19:09:03 -0500 | [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 | bb7be75 | 2020-11-05 19:02:32 -0500 | [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 | 04bf103 | 2020-11-05 19:09:03 -0500 | [diff] [blame] | 48 | --build-dir) |
| 49 | BUILD_DIR="${2}" |
| 50 | shift; shift |
| 51 | ;; |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [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 | 04bf103 | 2020-11-05 19:09:03 -0500 | [diff] [blame] | 64 | BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build/${BUILDER}}" |
Louis Dionne | 485f4c0 | 2021-01-07 17:37:09 -0500 | [diff] [blame] | 65 | INSTALL_DIR="${BUILD_DIR}/install" |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 66 | |
Louis Dionne | 6f96e99 | 2021-05-07 13:14:57 -0400 | [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 | 7a8d536 | 2021-03-04 16:01:36 -0500 | [diff] [blame] | 73 | |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 74 | function clean() { |
| 75 | rm -rf "${BUILD_DIR}" |
| 76 | } |
| 77 | |
Martin Storsjö | 47cd346 | 2021-04-06 00:17:30 +0300 | [diff] [blame] | 78 | function generate-cmake-base() { |
Louis Dionne | f9c11b0 | 2020-10-23 10:02:14 -0400 | [diff] [blame] | 79 | echo "--- Generating CMake" |
Louis Dionne | 6f96e99 | 2021-05-07 13:14:57 -0400 | [diff] [blame] | 80 | ${CMAKE} \ |
Louis Dionne | f9c11b0 | 2020-10-23 10:02:14 -0400 | [diff] [blame] | 81 | -B "${BUILD_DIR}" \ |
Louis Dionne | 7a8d536 | 2021-03-04 16:01:36 -0500 | [diff] [blame] | 82 | -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ |
Louis Dionne | f9c11b0 | 2020-10-23 10:02:14 -0400 | [diff] [blame] | 83 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
| 84 | -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ |
Louis Dionne | f9c11b0 | 2020-10-23 10:02:14 -0400 | [diff] [blame] | 85 | -DLLVM_LIT_ARGS="-sv --show-unsupported --xunit-xml-output test-results.xml" \ |
Martin Storsjö | 47cd346 | 2021-04-06 00:17:30 +0300 | [diff] [blame] | 86 | "${@}" |
| 87 | } |
| 88 | |
| 89 | function generate-cmake() { |
| 90 | generate-cmake-base \ |
| 91 | -S "${MONOREPO_ROOT}/llvm" \ |
| 92 | -DLLVM_ENABLE_PROJECTS="libcxx;libunwind;libcxxabi" \ |
Louis Dionne | f9c11b0 | 2020-10-23 10:02:14 -0400 | [diff] [blame] | 93 | -DLIBCXX_CXX_ABI=libcxxabi \ |
Louis Dionne | 662aaa2 | 2020-11-05 10:47:06 -0500 | [diff] [blame] | 94 | "${@}" |
| 95 | } |
| 96 | |
Martin Storsjö | 47cd346 | 2021-04-06 00:17:30 +0300 | [diff] [blame] | 97 | function generate-cmake-libcxx-win() { |
| 98 | # TODO: Clang-cl in MSVC configurations don't have access to compiler_rt |
| 99 | # builtins helpers for int128 division. See |
| 100 | # https://reviews.llvm.org/D91139#2429595 for a comment about longterm |
| 101 | # intent for handling the issue. In the meantime, define |
| 102 | # -D_LIBCPP_HAS_NO_INT128 (both when building the library itself and |
| 103 | # when building tests) to allow enabling filesystem for running tests, |
| 104 | # even if it uses a non-permanent ABI. |
| 105 | |
| 106 | generate-cmake-base \ |
| 107 | -S "${MONOREPO_ROOT}/libcxx" \ |
| 108 | -DCMAKE_C_COMPILER=clang-cl \ |
| 109 | -DCMAKE_CXX_COMPILER=clang-cl \ |
| 110 | -DLIBCXX_ENABLE_FILESYSTEM=YES \ |
| 111 | -DCMAKE_CXX_FLAGS="-D_LIBCPP_HAS_NO_INT128" \ |
| 112 | -DLIBCXX_TEST_COMPILER_FLAGS="-D_LIBCPP_HAS_NO_INT128" \ |
| 113 | "${@}" |
| 114 | } |
| 115 | |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 116 | function check-runtimes() { |
| 117 | echo "--- Installing libc++, libc++abi and libunwind to a fake location" |
| 118 | ${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi install-unwind |
Louis Dionne | eacce54 | 2021-03-24 09:50:59 -0400 | [diff] [blame] | 119 | |
Louis Dionne | f9c11b0 | 2020-10-23 10:02:14 -0400 | [diff] [blame] | 120 | echo "+++ Running the libc++ tests" |
Louis Dionne | 1fcb041 | 2021-03-19 16:26:15 -0700 | [diff] [blame] | 121 | ${NINJA} -vC "${BUILD_DIR}" check-cxx |
Louis Dionne | f9c11b0 | 2020-10-23 10:02:14 -0400 | [diff] [blame] | 122 | |
| 123 | echo "+++ Running the libc++abi tests" |
Louis Dionne | 1fcb041 | 2021-03-19 16:26:15 -0700 | [diff] [blame] | 124 | ${NINJA} -vC "${BUILD_DIR}" check-cxxabi |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 125 | |
| 126 | echo "+++ Running the libunwind tests" |
| 127 | ${NINJA} -vC "${BUILD_DIR}" check-unwind |
Louis Dionne | f9c11b0 | 2020-10-23 10:02:14 -0400 | [diff] [blame] | 128 | } |
| 129 | |
Louis Dionne | dfbd00e | 2020-11-26 15:00:42 -0500 | [diff] [blame] | 130 | # TODO: The goal is to test this against all configurations. We should also move |
| 131 | # this to the Lit test suite instead of being a separate CMake target. |
| 132 | function check-abi-list() { |
| 133 | echo "+++ Running the libc++ ABI list test" |
Louis Dionne | 1fcb041 | 2021-03-19 16:26:15 -0700 | [diff] [blame] | 134 | ${NINJA} -vC "${BUILD_DIR}" check-cxx-abilist || ( |
Marek Kurdej | 718b62c | 2020-12-02 08:57:02 +0100 | [diff] [blame] | 135 | echo "+++ Generating the libc++ ABI list after failed check" |
Louis Dionne | 1fcb041 | 2021-03-19 16:26:15 -0700 | [diff] [blame] | 136 | ${NINJA} -vC "${BUILD_DIR}" generate-cxx-abilist |
Marek Kurdej | 718b62c | 2020-12-02 08:57:02 +0100 | [diff] [blame] | 137 | false |
| 138 | ) |
Louis Dionne | dfbd00e | 2020-11-26 15:00:42 -0500 | [diff] [blame] | 139 | } |
| 140 | |
Louis Dionne | f9c11b0 | 2020-10-23 10:02:14 -0400 | [diff] [blame] | 141 | function check-cxx-benchmarks() { |
| 142 | echo "--- Running the benchmarks" |
Louis Dionne | 1fcb041 | 2021-03-19 16:26:15 -0700 | [diff] [blame] | 143 | ${NINJA} -vC "${BUILD_DIR}" check-cxx-benchmarks |
Louis Dionne | f9c11b0 | 2020-10-23 10:02:14 -0400 | [diff] [blame] | 144 | } |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 145 | |
Louis Dionne | 6bd3e65 | 2021-04-01 13:40:04 -0400 | [diff] [blame] | 146 | # Print the version of a few tools to aid diagnostics in some cases |
Louis Dionne | 6f96e99 | 2021-05-07 13:14:57 -0400 | [diff] [blame] | 147 | ${CMAKE} --version |
Louis Dionne | 6bd3e65 | 2021-04-01 13:40:04 -0400 | [diff] [blame] | 148 | ${NINJA} --version |
| 149 | |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 150 | case "${BUILDER}" in |
Marek Kurdej | 0544936 | 2021-02-04 21:13:22 +0100 | [diff] [blame] | 151 | check-format) |
| 152 | clean |
| 153 | echo "+++ Checking formatting" |
| 154 | # We need to set --extensions so that clang-format checks extensionless files. |
| 155 | mkdir -p ${BUILD_DIR} |
| 156 | git-clang-format \ |
| 157 | --binary /usr/bin/clang-format --diff \ |
| 158 | --extensions ',h,hh,hpp,hxx,c,cc,cxx,cpp' HEAD~1 \ |
| 159 | -- \ |
| 160 | libcxx/{benchmarks,include,src,test} \ |
| 161 | libcxxabi/{fuzz,include,src,test} \ |
| 162 | | tee ${BUILD_DIR}/clang-format.patch |
| 163 | # Check if the diff is empty, fail otherwise. |
| 164 | ! grep -q '^--- a' ${BUILD_DIR}/clang-format.patch |
| 165 | ;; |
Mark de Wever | 53efa10 | 2021-04-04 20:11:48 +0200 | [diff] [blame] | 166 | check-generated-output) |
Mark de Wever | b10c97d | 2021-04-28 19:13:52 +0200 | [diff] [blame] | 167 | # `! foo` doesn't work properly with `set -e`, use `! foo || false` instead. |
| 168 | # https://stackoverflow.com/questions/57681955/set-e-does-not-respect-logical-not |
Mark de Wever | 53efa10 | 2021-04-04 20:11:48 +0200 | [diff] [blame] | 169 | clean |
Louis Dionne | 8096e24 | 2021-07-15 10:19:39 -0400 | [diff] [blame] | 170 | generate-cmake |
| 171 | |
| 172 | # Reject patches that forgot to re-run the generator scripts. |
| 173 | echo "+++ Making sure the generator scripts were run" |
| 174 | ${NINJA} -vC "${BUILD_DIR}" libcxx-generate-files |
Mark de Wever | 53efa10 | 2021-04-04 20:11:48 +0200 | [diff] [blame] | 175 | git diff | tee ${BUILD_DIR}/generated_output.patch |
Mark de Wever | dfd86e3 | 2021-07-22 11:17:53 +0200 | [diff] [blame] | 176 | git ls-files -o --exclude-standard | tee ${BUILD_DIR}/generated_output.status |
Mark de Wever | b10c97d | 2021-04-28 19:13:52 +0200 | [diff] [blame] | 177 | ! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false |
Mark de Wever | dfd86e3 | 2021-07-22 11:17:53 +0200 | [diff] [blame] | 178 | if [ -s ${BUILD_DIR}/generated_output.status ]; then |
| 179 | echo "It looks like not all the generator scripts were run," |
| 180 | echo "did you forget to build the libcxx-generate-files target?" |
| 181 | echo "Did you add all new files it generated?" |
| 182 | false |
| 183 | fi |
Louis Dionne | 8096e24 | 2021-07-15 10:19:39 -0400 | [diff] [blame] | 184 | |
Mark de Wever | b10c97d | 2021-04-28 19:13:52 +0200 | [diff] [blame] | 185 | # Reject patches that introduce non-ASCII characters or hard tabs. |
Arthur O'Dwyer | 757d5bd | 2021-04-30 14:43:33 -0400 | [diff] [blame] | 186 | # Depends on LC_COLLATE set at the top of this script. |
Mark de Wever | b10c97d | 2021-04-28 19:13:52 +0200 | [diff] [blame] | 187 | ! grep -rn '[^ -~]' libcxx/include/ || false |
Louis Dionne | 8096e24 | 2021-07-15 10:19:39 -0400 | [diff] [blame] | 188 | |
| 189 | # Reject patches that introduce dependency cycles in the headers. |
Arthur O'Dwyer | bba78c3 | 2021-04-17 09:56:34 -0400 | [diff] [blame] | 190 | python3 libcxx/utils/graph_header_deps.py >/dev/null |
Mark de Wever | 53efa10 | 2021-04-04 20:11:48 +0200 | [diff] [blame] | 191 | ;; |
Louis Dionne | 6f8038c | 2020-10-01 13:55:39 -0400 | [diff] [blame] | 192 | generic-cxx03) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 193 | clean |
Louis Dionne | 77fc7de | 2021-02-26 13:18:21 -0500 | [diff] [blame] | 194 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 195 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 196 | check-runtimes |
Louis Dionne | dfbd00e | 2020-11-26 15:00:42 -0500 | [diff] [blame] | 197 | check-abi-list |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 198 | ;; |
Louis Dionne | 6f8038c | 2020-10-01 13:55:39 -0400 | [diff] [blame] | 199 | generic-cxx11) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 200 | clean |
Louis Dionne | 77fc7de | 2021-02-26 13:18:21 -0500 | [diff] [blame] | 201 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 202 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 203 | check-runtimes |
Louis Dionne | dfbd00e | 2020-11-26 15:00:42 -0500 | [diff] [blame] | 204 | check-abi-list |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 205 | ;; |
Louis Dionne | 6f8038c | 2020-10-01 13:55:39 -0400 | [diff] [blame] | 206 | generic-cxx14) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 207 | clean |
Louis Dionne | 77fc7de | 2021-02-26 13:18:21 -0500 | [diff] [blame] | 208 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 209 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 210 | check-runtimes |
Louis Dionne | dfbd00e | 2020-11-26 15:00:42 -0500 | [diff] [blame] | 211 | check-abi-list |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 212 | ;; |
Louis Dionne | 6f8038c | 2020-10-01 13:55:39 -0400 | [diff] [blame] | 213 | generic-cxx17) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 214 | clean |
Louis Dionne | 77fc7de | 2021-02-26 13:18:21 -0500 | [diff] [blame] | 215 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 216 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 217 | check-runtimes |
Louis Dionne | dfbd00e | 2020-11-26 15:00:42 -0500 | [diff] [blame] | 218 | check-abi-list |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 219 | ;; |
Marek Kurdej | 24b4c51 | 2021-01-07 12:29:04 +0100 | [diff] [blame] | 220 | generic-cxx20) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 221 | clean |
Louis Dionne | 77fc7de | 2021-02-26 13:18:21 -0500 | [diff] [blame] | 222 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 223 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 224 | check-runtimes |
Louis Dionne | dfbd00e | 2020-11-26 15:00:42 -0500 | [diff] [blame] | 225 | check-abi-list |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 226 | ;; |
Marek Kurdej | 758067c | 2021-01-08 18:40:42 +0100 | [diff] [blame] | 227 | generic-cxx2b) |
Marek Kurdej | 758067c | 2021-01-08 18:40:42 +0100 | [diff] [blame] | 228 | clean |
Louis Dionne | 77fc7de | 2021-02-26 13:18:21 -0500 | [diff] [blame] | 229 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 230 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 231 | check-runtimes |
Marek Kurdej | 758067c | 2021-01-08 18:40:42 +0100 | [diff] [blame] | 232 | check-abi-list |
| 233 | ;; |
Louis Dionne | 732192e | 2021-06-09 09:41:27 -0400 | [diff] [blame] | 234 | generic-assertions) |
Louis Dionne | 732192e | 2021-06-09 09:41:27 -0400 | [diff] [blame] | 235 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 236 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 237 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 238 | check-runtimes |
Louis Dionne | 732192e | 2021-06-09 09:41:27 -0400 | [diff] [blame] | 239 | check-abi-list |
| 240 | ;; |
Arthur O'Dwyer | 64e0247 | 2021-04-20 11:27:03 -0400 | [diff] [blame] | 241 | generic-debug-iterators) |
Arthur O'Dwyer | 64e0247 | 2021-04-20 11:27:03 -0400 | [diff] [blame] | 242 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 243 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 244 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 245 | check-runtimes |
Arthur O'Dwyer | 64e0247 | 2021-04-20 11:27:03 -0400 | [diff] [blame] | 246 | check-abi-list |
| 247 | ;; |
Louis Dionne | 6f8038c | 2020-10-01 13:55:39 -0400 | [diff] [blame] | 248 | generic-noexceptions) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 249 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 250 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 251 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 252 | check-runtimes |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 253 | ;; |
Louis Dionne | 00005a9 | 2021-06-02 17:07:57 -0400 | [diff] [blame] | 254 | generic-modules) |
Louis Dionne | 00005a9 | 2021-06-02 17:07:57 -0400 | [diff] [blame] | 255 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 256 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 257 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 258 | check-runtimes |
Louis Dionne | 00005a9 | 2021-06-02 17:07:57 -0400 | [diff] [blame] | 259 | ;; |
Louis Dionne | eacce54 | 2021-03-24 09:50:59 -0400 | [diff] [blame] | 260 | generic-static) |
Louis Dionne | eacce54 | 2021-03-24 09:50:59 -0400 | [diff] [blame] | 261 | clean |
Louis Dionne | 77fc7de | 2021-02-26 13:18:21 -0500 | [diff] [blame] | 262 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 263 | -DLIBCXX_TEST_CONFIG="llvm-libc++-static.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 264 | check-runtimes |
Louis Dionne | eacce54 | 2021-03-24 09:50:59 -0400 | [diff] [blame] | 265 | ;; |
Louis Dionne | 6f8038c | 2020-10-01 13:55:39 -0400 | [diff] [blame] | 266 | generic-32bit) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 267 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 268 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-32bits.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 269 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 270 | check-runtimes |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 271 | ;; |
Louis Dionne | 6f4796b | 2021-07-08 12:26:33 -0400 | [diff] [blame] | 272 | generic-clang-11) |
| 273 | export CC=clang-11 |
| 274 | export CXX=clang++-11 |
| 275 | clean |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 276 | generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 277 | check-runtimes |
Louis Dionne | 6f4796b | 2021-07-08 12:26:33 -0400 | [diff] [blame] | 278 | ;; |
| 279 | generic-clang-12) |
| 280 | export CC=clang-12 |
| 281 | export CXX=clang++-12 |
| 282 | clean |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 283 | generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 284 | check-runtimes |
Louis Dionne | 6f4796b | 2021-07-08 12:26:33 -0400 | [diff] [blame] | 285 | ;; |
Louis Dionne | 6f8038c | 2020-10-01 13:55:39 -0400 | [diff] [blame] | 286 | generic-gcc) |
Louis Dionne | 566a51d | 2021-06-15 15:07:03 -0400 | [diff] [blame] | 287 | export CC=gcc-11 |
| 288 | export CXX=g++-11 |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 289 | clean |
Louis Dionne | 1cb657a | 2021-10-07 14:54:14 -0400 | [diff] [blame^] | 290 | generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 291 | check-runtimes |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 292 | ;; |
Louis Dionne | 657b479 | 2021-07-15 09:46:36 -0400 | [diff] [blame] | 293 | generic-gcc-cxx11) |
| 294 | export CC=gcc-11 |
| 295 | export CXX=g++-11 |
| 296 | clean |
Louis Dionne | 1cb657a | 2021-10-07 14:54:14 -0400 | [diff] [blame^] | 297 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \ |
| 298 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared-gcc.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 299 | check-runtimes |
Louis Dionne | 657b479 | 2021-07-15 09:46:36 -0400 | [diff] [blame] | 300 | ;; |
Louis Dionne | 6f8038c | 2020-10-01 13:55:39 -0400 | [diff] [blame] | 301 | generic-asan) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 302 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 303 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 304 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 305 | check-runtimes |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 306 | ;; |
Louis Dionne | 6f8038c | 2020-10-01 13:55:39 -0400 | [diff] [blame] | 307 | generic-msan) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 308 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 309 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 310 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 311 | check-runtimes |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 312 | ;; |
Louis Dionne | 6f8038c | 2020-10-01 13:55:39 -0400 | [diff] [blame] | 313 | generic-tsan) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 314 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 315 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 316 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 317 | check-runtimes |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 318 | ;; |
Louis Dionne | 6f8038c | 2020-10-01 13:55:39 -0400 | [diff] [blame] | 319 | generic-ubsan) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 320 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 321 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 322 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 323 | check-runtimes |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 324 | ;; |
Louis Dionne | 6f8038c | 2020-10-01 13:55:39 -0400 | [diff] [blame] | 325 | generic-with_llvm_unwinder) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 326 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 327 | generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 328 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 329 | check-runtimes |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 330 | ;; |
Louis Dionne | 6f8038c | 2020-10-01 13:55:39 -0400 | [diff] [blame] | 331 | generic-singlethreaded) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 332 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 333 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-singlethreaded.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 334 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 335 | check-runtimes |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 336 | ;; |
Louis Dionne | abcfdbc | 2021-03-23 14:09:52 -0400 | [diff] [blame] | 337 | generic-no-debug) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 338 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 339 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 340 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 341 | check-runtimes |
Louis Dionne | 4396f9b | 2020-10-06 16:46:58 -0400 | [diff] [blame] | 342 | ;; |
Louis Dionne | db84e12 | 2021-01-18 12:18:18 -0500 | [diff] [blame] | 343 | generic-no-filesystem) |
Louis Dionne | db84e12 | 2021-01-18 12:18:18 -0500 | [diff] [blame] | 344 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 345 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 346 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 347 | check-runtimes |
Louis Dionne | db84e12 | 2021-01-18 12:18:18 -0500 | [diff] [blame] | 348 | ;; |
Louis Dionne | 3777e68 | 2020-10-15 10:32:09 -0400 | [diff] [blame] | 349 | generic-no-random_device) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 350 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 351 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 352 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 353 | check-runtimes |
Louis Dionne | 3777e68 | 2020-10-15 10:32:09 -0400 | [diff] [blame] | 354 | ;; |
Louis Dionne | 8d053eb | 2020-10-09 15:31:05 -0400 | [diff] [blame] | 355 | generic-no-localization) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 356 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 357 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 358 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 359 | check-runtimes |
Louis Dionne | 8d053eb | 2020-10-09 15:31:05 -0400 | [diff] [blame] | 360 | ;; |
Mark de Wever | ebbd3b6 | 2021-05-25 20:11:08 +0200 | [diff] [blame] | 361 | generic-no-unicode) |
Mark de Wever | ebbd3b6 | 2021-05-25 20:11:08 +0200 | [diff] [blame] | 362 | clean |
Louis Dionne | 24a32ac | 2021-10-05 13:37:43 -0400 | [diff] [blame] | 363 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 364 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 365 | check-runtimes |
Mark de Wever | ebbd3b6 | 2021-05-25 20:11:08 +0200 | [diff] [blame] | 366 | ;; |
Louis Dionne | 89d0eb2 | 2020-10-01 08:55:40 -0400 | [diff] [blame] | 367 | x86_64-apple-system) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 368 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 369 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 370 | -DLIBCXX_TEST_CONFIG="apple-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 371 | check-runtimes |
Louis Dionne | 89d0eb2 | 2020-10-01 08:55:40 -0400 | [diff] [blame] | 372 | ;; |
| 373 | x86_64-apple-system-noexceptions) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 374 | clean |
Louis Dionne | f9c11b0 | 2020-10-23 10:02:14 -0400 | [diff] [blame] | 375 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ |
| 376 | -DLIBCXX_ENABLE_EXCEPTIONS=OFF \ |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 377 | -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 378 | -DLIBCXX_TEST_CONFIG="apple-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 379 | check-runtimes |
Louis Dionne | f9c11b0 | 2020-10-23 10:02:14 -0400 | [diff] [blame] | 380 | ;; |
Louis Dionne | 662aaa2 | 2020-11-05 10:47:06 -0500 | [diff] [blame] | 381 | x86_64-apple-system-backdeployment-*) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 382 | clean |
Louis Dionne | 662aaa2 | 2020-11-05 10:47:06 -0500 | [diff] [blame] | 383 | |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 384 | if [[ "${OSX_ROOTS}" == "" ]]; then |
| 385 | echo "--- Downloading previous macOS dylibs" |
Louis Dionne | c767535 | 2021-03-25 14:14:20 -0400 | [diff] [blame] | 386 | PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/liu4fmc53qzlfly/libcxx-roots.tar.gz" |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 387 | OSX_ROOTS="${BUILD_DIR}/macos-roots" |
| 388 | mkdir -p "${OSX_ROOTS}" |
| 389 | curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}" |
| 390 | fi |
Louis Dionne | 662aaa2 | 2020-11-05 10:47:06 -0500 | [diff] [blame] | 391 | |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 392 | DEPLOYMENT_TARGET="${BUILDER#x86_64-apple-system-backdeployment-}" |
Louis Dionne | 84ad13b | 2020-07-08 16:38:54 -0400 | [diff] [blame] | 393 | |
| 394 | # TODO: On Apple platforms, we never produce libc++abi.1.dylib, always libc++abi.dylib. |
| 395 | # Fix that in the build so that the tests stop searching for @rpath/libc++abi.1.dylib. |
| 396 | cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \ |
| 397 | "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib" |
| 398 | |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 399 | PARAMS="target_triple=x86_64-apple-macosx${DEPLOYMENT_TARGET}" |
| 400 | PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}" |
Louis Dionne | 84ad13b | 2020-07-08 16:38:54 -0400 | [diff] [blame] | 401 | PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}" |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 402 | PARAMS+=";use_system_cxx_lib=True" |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 403 | |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 404 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ |
| 405 | -DLIBCXX_TEST_PARAMS="${PARAMS}" \ |
| 406 | -DLIBCXXABI_TEST_PARAMS="${PARAMS}" |
| 407 | |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 408 | check-runtimes |
Louis Dionne | 662aaa2 | 2020-11-05 10:47:06 -0500 | [diff] [blame] | 409 | ;; |
Louis Dionne | f9c11b0 | 2020-10-23 10:02:14 -0400 | [diff] [blame] | 410 | benchmarks) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 411 | clean |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 412 | generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | f9c11b0 | 2020-10-23 10:02:14 -0400 | [diff] [blame] | 413 | check-cxx-benchmarks |
Louis Dionne | 89d0eb2 | 2020-10-01 08:55:40 -0400 | [diff] [blame] | 414 | ;; |
Louis Dionne | aa4e44f | 2020-11-05 14:34:29 -0500 | [diff] [blame] | 415 | documentation) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 416 | clean |
| 417 | generate-cmake -DLLVM_ENABLE_SPHINX=ON |
| 418 | |
| 419 | echo "+++ Generating documentation" |
Louis Dionne | 1fcb041 | 2021-03-19 16:26:15 -0700 | [diff] [blame] | 420 | ${NINJA} -vC "${BUILD_DIR}" docs-libcxx-html |
Louis Dionne | aa4e44f | 2020-11-05 14:34:29 -0500 | [diff] [blame] | 421 | ;; |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 422 | unified-standalone) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 423 | clean |
| 424 | |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 425 | echo "--- Generating CMake" |
Louis Dionne | 6f96e99 | 2021-05-07 13:14:57 -0400 | [diff] [blame] | 426 | ${CMAKE} \ |
| 427 | -S "${MONOREPO_ROOT}/libcxx/utils/ci/runtimes" \ |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 428 | -B "${BUILD_DIR}" \ |
Louis Dionne | 7a8d536 | 2021-03-04 16:01:36 -0500 | [diff] [blame] | 429 | -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 430 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
| 431 | -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 432 | -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi;libunwind" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 433 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 434 | |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 435 | check-runtimes |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 436 | ;; |
Martin Storsjö | bb96de9 | 2021-09-10 14:36:13 +0300 | [diff] [blame] | 437 | new-standalone) |
Martin Storsjö | bb96de9 | 2021-09-10 14:36:13 +0300 | [diff] [blame] | 438 | clean |
| 439 | |
| 440 | echo "--- Generating CMake" |
| 441 | ${CMAKE} \ |
| 442 | -S "${MONOREPO_ROOT}/runtimes" \ |
| 443 | -B "${BUILD_DIR}" \ |
| 444 | -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ |
| 445 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
| 446 | -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ |
| 447 | -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 448 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Martin Storsjö | bb96de9 | 2021-09-10 14:36:13 +0300 | [diff] [blame] | 449 | |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 450 | check-runtimes |
Martin Storsjö | bb96de9 | 2021-09-10 14:36:13 +0300 | [diff] [blame] | 451 | ;; |
Louis Dionne | 61b63fd | 2021-03-16 11:57:42 -0700 | [diff] [blame] | 452 | runtimes-build) |
Louis Dionne | 61b63fd | 2021-03-16 11:57:42 -0700 | [diff] [blame] | 453 | clean |
| 454 | |
| 455 | echo "--- Generating CMake" |
Louis Dionne | 65faaa7 | 2021-06-14 14:36:13 -0400 | [diff] [blame] | 456 | # TODO: We currently enable modules and assertions in the runtimes build |
| 457 | # because that provides coverage for some specific Clang failures |
| 458 | # we've been seeing recently, however it would be better to instead |
| 459 | # run all CI configurations against a Clang that has assertions enabled. |
Louis Dionne | 6f96e99 | 2021-05-07 13:14:57 -0400 | [diff] [blame] | 460 | ${CMAKE} \ |
| 461 | -S "${MONOREPO_ROOT}/llvm" \ |
Louis Dionne | 61b63fd | 2021-03-16 11:57:42 -0700 | [diff] [blame] | 462 | -B "${BUILD_DIR}" \ |
Louis Dionne | 6f96e99 | 2021-05-07 13:14:57 -0400 | [diff] [blame] | 463 | -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ |
Louis Dionne | 61b63fd | 2021-03-16 11:57:42 -0700 | [diff] [blame] | 464 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
| 465 | -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ |
| 466 | -DLLVM_ENABLE_PROJECTS="clang" \ |
| 467 | -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \ |
Christopher Di Bella | a49edef | 2021-06-08 00:09:36 +0000 | [diff] [blame] | 468 | -DLLVM_RUNTIME_TARGETS="x86_64-unknown-linux-gnu" \ |
Louis Dionne | 65faaa7 | 2021-06-14 14:36:13 -0400 | [diff] [blame] | 469 | -DLLVM_ENABLE_ASSERTIONS=ON \ |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 470 | -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 471 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 61b63fd | 2021-03-16 11:57:42 -0700 | [diff] [blame] | 472 | |
| 473 | echo "+++ Running the libc++ and libc++abi tests" |
| 474 | ${NINJA} -C "${BUILD_DIR}" check-runtimes |
| 475 | |
| 476 | echo "--- Installing libc++ and libc++abi to a fake location" |
Louis Dionne | 4b1b70d | 2021-07-06 10:39:01 -0400 | [diff] [blame] | 477 | ${NINJA} -C "${BUILD_DIR}" install-runtimes |
Louis Dionne | 61b63fd | 2021-03-16 11:57:42 -0700 | [diff] [blame] | 478 | ;; |
Louis Dionne | 77fc7de | 2021-02-26 13:18:21 -0500 | [diff] [blame] | 479 | legacy-test-config) |
Louis Dionne | 77fc7de | 2021-02-26 13:18:21 -0500 | [diff] [blame] | 480 | clean |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 481 | generate-cmake -DLIBCXX_TEST_CONFIG="legacy.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 482 | check-runtimes |
Louis Dionne | 77fc7de | 2021-02-26 13:18:21 -0500 | [diff] [blame] | 483 | ;; |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 484 | legacy-standalone) |
Louis Dionne | bb7be75 | 2020-11-05 19:02:32 -0500 | [diff] [blame] | 485 | clean |
| 486 | |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 487 | echo "--- Generating CMake" |
Louis Dionne | 6f96e99 | 2021-05-07 13:14:57 -0400 | [diff] [blame] | 488 | ${CMAKE} \ |
| 489 | -S "${MONOREPO_ROOT}/libcxx" \ |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 490 | -B "${BUILD_DIR}/libcxx" \ |
Louis Dionne | 7a8d536 | 2021-03-04 16:01:36 -0500 | [diff] [blame] | 491 | -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 492 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
| 493 | -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ |
| 494 | -DLLVM_PATH="${MONOREPO_ROOT}/llvm" \ |
| 495 | -DLIBCXX_CXX_ABI=libcxxabi \ |
| 496 | -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${MONOREPO_ROOT}/libcxxabi/include" \ |
| 497 | -DLIBCXX_CXX_ABI_LIBRARY_PATH="${BUILD_DIR}/libcxxabi/lib" |
| 498 | |
Louis Dionne | 6f96e99 | 2021-05-07 13:14:57 -0400 | [diff] [blame] | 499 | ${CMAKE} \ |
| 500 | -S "${MONOREPO_ROOT}/libcxxabi" \ |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 501 | -B "${BUILD_DIR}/libcxxabi" \ |
Louis Dionne | 7a8d536 | 2021-03-04 16:01:36 -0500 | [diff] [blame] | 502 | -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \ |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 503 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
| 504 | -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ |
| 505 | -DLLVM_PATH="${MONOREPO_ROOT}/llvm" \ |
| 506 | -DLIBCXXABI_LIBCXX_PATH="${MONOREPO_ROOT}/libcxx" \ |
Louis Dionne | 94870d8 | 2020-06-26 12:08:59 -0400 | [diff] [blame] | 507 | -DLIBCXXABI_LIBCXX_INCLUDES="${BUILD_DIR}/libcxx/include/c++/v1" \ |
Louis Dionne | 5be8b09 | 2020-10-26 14:25:49 -0400 | [diff] [blame] | 508 | -DLIBCXXABI_LIBCXX_LIBRARY_PATH="${BUILD_DIR}/libcxx/lib" |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 509 | |
Louis Dionne | 94870d8 | 2020-06-26 12:08:59 -0400 | [diff] [blame] | 510 | echo "+++ Generating libc++ headers" |
| 511 | ${NINJA} -vC "${BUILD_DIR}/libcxx" generate-cxx-headers |
| 512 | |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 513 | echo "+++ Building libc++abi" |
Louis Dionne | 1fcb041 | 2021-03-19 16:26:15 -0700 | [diff] [blame] | 514 | ${NINJA} -vC "${BUILD_DIR}/libcxxabi" cxxabi |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 515 | |
| 516 | echo "+++ Building libc++" |
Louis Dionne | 1fcb041 | 2021-03-19 16:26:15 -0700 | [diff] [blame] | 517 | ${NINJA} -vC "${BUILD_DIR}/libcxx" cxx |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 518 | |
| 519 | echo "+++ Running the libc++ tests" |
Louis Dionne | 1fcb041 | 2021-03-19 16:26:15 -0700 | [diff] [blame] | 520 | ${NINJA} -vC "${BUILD_DIR}/libcxx" check-cxx |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 521 | |
| 522 | echo "+++ Running the libc++abi tests" |
Louis Dionne | 1fcb041 | 2021-03-19 16:26:15 -0700 | [diff] [blame] | 523 | ${NINJA} -vC "${BUILD_DIR}/libcxxabi" check-cxxabi |
Louis Dionne | 435c36b | 2020-10-23 16:27:41 -0400 | [diff] [blame] | 524 | ;; |
David Spickett | 77471a1 | 2021-02-08 10:43:21 +0000 | [diff] [blame] | 525 | aarch64) |
| 526 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 527 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 528 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 529 | check-runtimes |
David Spickett | 77471a1 | 2021-02-08 10:43:21 +0000 | [diff] [blame] | 530 | ;; |
| 531 | aarch64-noexceptions) |
| 532 | clean |
| 533 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \ |
Louis Dionne | 4b85fc3 | 2021-07-15 13:29:47 -0400 | [diff] [blame] | 534 | -DLIBCXX_ENABLE_EXCEPTIONS=OFF \ |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 535 | -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 536 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 537 | check-runtimes |
David Spickett | 77471a1 | 2021-02-08 10:43:21 +0000 | [diff] [blame] | 538 | ;; |
David Spickett | a16b886 | 2021-03-02 15:07:19 +0000 | [diff] [blame] | 539 | # Aka Armv8 32 bit |
| 540 | armv8) |
| 541 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 542 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 543 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 544 | check-runtimes |
David Spickett | a16b886 | 2021-03-02 15:07:19 +0000 | [diff] [blame] | 545 | ;; |
| 546 | armv8-noexceptions) |
| 547 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 548 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 549 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 550 | check-runtimes |
David Spickett | a16b886 | 2021-03-02 15:07:19 +0000 | [diff] [blame] | 551 | ;; |
| 552 | # Armv7 32 bit. One building Arm only one Thumb only code. |
| 553 | armv7) |
| 554 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 555 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 556 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 557 | check-runtimes |
David Spickett | a16b886 | 2021-03-02 15:07:19 +0000 | [diff] [blame] | 558 | ;; |
| 559 | armv7-noexceptions) |
| 560 | clean |
Louis Dionne | 81b7dc2 | 2021-05-31 12:44:48 -0400 | [diff] [blame] | 561 | generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake" \ |
Louis Dionne | 6be4405 | 2021-09-29 15:26:05 -0400 | [diff] [blame] | 562 | -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" |
Louis Dionne | 1f54452 | 2021-09-30 15:11:48 -0400 | [diff] [blame] | 563 | check-runtimes |
David Spickett | a16b886 | 2021-03-02 15:07:19 +0000 | [diff] [blame] | 564 | ;; |
Martin Storsjö | 47cd346 | 2021-04-06 00:17:30 +0300 | [diff] [blame] | 565 | windows-dll) |
Martin Storsjö | 2ffae01 | 2021-03-17 12:10:42 +0200 | [diff] [blame] | 566 | clean |
Martin Storsjö | 2ffae01 | 2021-03-17 12:10:42 +0200 | [diff] [blame] | 567 | # TODO: Currently, building with the experimental library breaks running |
| 568 | # tests (the test linking look for the c++experimental library with the |
| 569 | # wrong name, and the statically linked c++experimental can't be linked |
| 570 | # correctly when libc++ visibility attributes indicate dllimport linkage |
| 571 | # anyway), thus just disable the experimental library. Remove this |
| 572 | # setting when cmake and the test driver does the right thing automatically. |
Martin Storsjö | 47cd346 | 2021-04-06 00:17:30 +0300 | [diff] [blame] | 573 | generate-cmake-libcxx-win -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF |
| 574 | echo "+++ Running the libc++ tests" |
| 575 | ${NINJA} -vC "${BUILD_DIR}" check-cxx |
| 576 | ;; |
| 577 | windows-static) |
| 578 | clean |
| 579 | generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF |
Martin Storsjö | 2ffae01 | 2021-03-17 12:10:42 +0200 | [diff] [blame] | 580 | echo "+++ Running the libc++ tests" |
| 581 | ${NINJA} -vC "${BUILD_DIR}" check-cxx |
| 582 | ;; |
Louis Dionne | 04915f9 | 2021-05-27 16:51:38 -0400 | [diff] [blame] | 583 | ################################################################# |
| 584 | # Insert vendor-specific internal configurations below. |
| 585 | # |
| 586 | # This allows vendors to extend this file with their own internal |
| 587 | # configurations without running into merge conflicts with upstream. |
| 588 | ################################################################# |
| 589 | |
| 590 | ################################################################# |
Louis Dionne | ce55605 | 2020-09-23 09:20:03 -0400 | [diff] [blame] | 591 | *) |
| 592 | echo "${BUILDER} is not a known configuration" |
| 593 | exit 1 |
| 594 | ;; |
| 595 | esac |