2020-09-23 21:20:03 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#===----------------------------------------------------------------------===##
|
|
|
|
#
|
|
|
|
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
# See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#
|
|
|
|
#===----------------------------------------------------------------------===##
|
|
|
|
|
|
|
|
set -ex
|
2021-02-05 04:13:22 +08:00
|
|
|
set -o pipefail
|
2021-05-01 02:43:33 +08:00
|
|
|
unset LANG
|
|
|
|
unset LC_ALL
|
|
|
|
unset LC_COLLATE
|
2020-09-23 21:20:03 +08:00
|
|
|
|
2020-11-06 08:02:32 +08:00
|
|
|
PROGNAME="$(basename "${0}")"
|
|
|
|
|
|
|
|
function usage() {
|
|
|
|
cat <<EOF
|
|
|
|
Usage:
|
|
|
|
${PROGNAME} [options] <BUILDER>
|
|
|
|
|
|
|
|
[-h|--help] Display this help and exit.
|
|
|
|
|
|
|
|
--llvm-root <DIR> Path to the root of the LLVM monorepo. By default, we try
|
|
|
|
to figure it out based on the current working directory.
|
|
|
|
|
2020-11-06 08:09:03 +08:00
|
|
|
--build-dir <DIR> The directory to use for building the library. By default,
|
|
|
|
this is '<llvm-root>/build/<builder>'.
|
|
|
|
|
2020-11-06 08:02:32 +08:00
|
|
|
--osx-roots <DIR> Path to pre-downloaded macOS dylibs. By default, we download
|
|
|
|
them from Green Dragon. This is only relevant at all when
|
|
|
|
running back-deployment testing if one wants to override
|
|
|
|
the old dylibs we use to run the tests with different ones.
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
while [[ $# -gt 0 ]]; do
|
|
|
|
case ${1} in
|
|
|
|
-h|--help)
|
|
|
|
usage
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
--llvm-root)
|
|
|
|
MONOREPO_ROOT="${2}"
|
|
|
|
shift; shift
|
|
|
|
;;
|
2020-11-06 08:09:03 +08:00
|
|
|
--build-dir)
|
|
|
|
BUILD_DIR="${2}"
|
|
|
|
shift; shift
|
|
|
|
;;
|
2020-11-06 08:02:32 +08:00
|
|
|
--osx-roots)
|
|
|
|
OSX_ROOTS="${2}"
|
|
|
|
shift; shift
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
BUILDER="${1}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
|
2020-11-06 08:09:03 +08:00
|
|
|
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build/${BUILDER}}"
|
2021-01-08 06:37:09 +08:00
|
|
|
INSTALL_DIR="${BUILD_DIR}/install"
|
2020-09-23 21:20:03 +08:00
|
|
|
|
2021-05-08 01:14:57 +08:00
|
|
|
# If we can find Ninja/CMake provided by Xcode, use those since we know their
|
|
|
|
# version will generally work with the Clang shipped in Xcode (e.g. if Clang
|
|
|
|
# knows about -std=c++20, the CMake bundled in Xcode will probably know about
|
|
|
|
# that flag too).
|
|
|
|
if xcrun --find ninja &>/dev/null; then NINJA="$(xcrun --find ninja)"; else NINJA="ninja"; fi
|
|
|
|
if xcrun --find cmake &>/dev/null; then CMAKE="$(xcrun --find cmake)"; else CMAKE="cmake"; fi
|
2021-03-05 05:01:36 +08:00
|
|
|
|
2020-11-06 08:02:32 +08:00
|
|
|
function clean() {
|
|
|
|
rm -rf "${BUILD_DIR}"
|
|
|
|
}
|
|
|
|
|
2021-04-06 05:17:30 +08:00
|
|
|
function generate-cmake-base() {
|
2020-10-23 22:02:14 +08:00
|
|
|
echo "--- Generating CMake"
|
2021-05-08 01:14:57 +08:00
|
|
|
${CMAKE} \
|
2020-10-23 22:02:14 +08:00
|
|
|
-B "${BUILD_DIR}" \
|
2021-03-05 05:01:36 +08:00
|
|
|
-GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
|
2020-10-23 22:02:14 +08:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
|
|
|
|
-DLLVM_LIT_ARGS="-sv --show-unsupported --xunit-xml-output test-results.xml" \
|
2021-04-06 05:17:30 +08:00
|
|
|
"${@}"
|
|
|
|
}
|
|
|
|
|
|
|
|
function generate-cmake() {
|
|
|
|
generate-cmake-base \
|
|
|
|
-S "${MONOREPO_ROOT}/llvm" \
|
|
|
|
-DLLVM_ENABLE_PROJECTS="libcxx;libunwind;libcxxabi" \
|
2020-10-23 22:02:14 +08:00
|
|
|
-DLIBCXX_CXX_ABI=libcxxabi \
|
2020-11-05 23:47:06 +08:00
|
|
|
"${@}"
|
|
|
|
}
|
|
|
|
|
2021-04-06 05:17:30 +08:00
|
|
|
function generate-cmake-libcxx-win() {
|
|
|
|
# TODO: Clang-cl in MSVC configurations don't have access to compiler_rt
|
|
|
|
# builtins helpers for int128 division. See
|
|
|
|
# https://reviews.llvm.org/D91139#2429595 for a comment about longterm
|
|
|
|
# intent for handling the issue. In the meantime, define
|
|
|
|
# -D_LIBCPP_HAS_NO_INT128 (both when building the library itself and
|
|
|
|
# when building tests) to allow enabling filesystem for running tests,
|
|
|
|
# even if it uses a non-permanent ABI.
|
|
|
|
|
|
|
|
generate-cmake-base \
|
|
|
|
-S "${MONOREPO_ROOT}/libcxx" \
|
|
|
|
-DCMAKE_C_COMPILER=clang-cl \
|
|
|
|
-DCMAKE_CXX_COMPILER=clang-cl \
|
|
|
|
-DLIBCXX_ENABLE_FILESYSTEM=YES \
|
|
|
|
-DCMAKE_CXX_FLAGS="-D_LIBCPP_HAS_NO_INT128" \
|
|
|
|
-DLIBCXX_TEST_COMPILER_FLAGS="-D_LIBCPP_HAS_NO_INT128" \
|
|
|
|
"${@}"
|
|
|
|
}
|
|
|
|
|
2020-10-23 22:02:14 +08:00
|
|
|
function check-cxx-cxxabi() {
|
2021-03-24 21:50:59 +08:00
|
|
|
echo "--- Installing libc++ and libc++abi to a fake location"
|
|
|
|
${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi
|
|
|
|
|
2020-10-23 22:02:14 +08:00
|
|
|
echo "+++ Running the libc++ tests"
|
2021-03-20 07:26:15 +08:00
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxx
|
2020-10-23 22:02:14 +08:00
|
|
|
|
|
|
|
echo "+++ Running the libc++abi tests"
|
2021-03-20 07:26:15 +08:00
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxxabi
|
2020-10-23 22:02:14 +08:00
|
|
|
}
|
|
|
|
|
2020-11-27 04:00:42 +08:00
|
|
|
# TODO: The goal is to test this against all configurations. We should also move
|
|
|
|
# this to the Lit test suite instead of being a separate CMake target.
|
|
|
|
function check-abi-list() {
|
|
|
|
echo "+++ Running the libc++ ABI list test"
|
2021-03-20 07:26:15 +08:00
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxx-abilist || (
|
2020-12-02 15:57:02 +08:00
|
|
|
echo "+++ Generating the libc++ ABI list after failed check"
|
2021-03-20 07:26:15 +08:00
|
|
|
${NINJA} -vC "${BUILD_DIR}" generate-cxx-abilist
|
2020-12-02 15:57:02 +08:00
|
|
|
false
|
|
|
|
)
|
2020-11-27 04:00:42 +08:00
|
|
|
}
|
|
|
|
|
2020-10-23 22:02:14 +08:00
|
|
|
function check-cxx-benchmarks() {
|
|
|
|
echo "--- Running the benchmarks"
|
2021-03-20 07:26:15 +08:00
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxx-benchmarks
|
2020-10-23 22:02:14 +08:00
|
|
|
}
|
2020-09-23 21:20:03 +08:00
|
|
|
|
2021-04-02 01:40:04 +08:00
|
|
|
# Print the version of a few tools to aid diagnostics in some cases
|
2021-05-08 01:14:57 +08:00
|
|
|
${CMAKE} --version
|
2021-04-02 01:40:04 +08:00
|
|
|
${NINJA} --version
|
|
|
|
|
2020-09-23 21:20:03 +08:00
|
|
|
case "${BUILDER}" in
|
2021-02-05 04:13:22 +08:00
|
|
|
check-format)
|
|
|
|
clean
|
|
|
|
echo "+++ Checking formatting"
|
|
|
|
# We need to set --extensions so that clang-format checks extensionless files.
|
|
|
|
mkdir -p ${BUILD_DIR}
|
|
|
|
git-clang-format \
|
|
|
|
--binary /usr/bin/clang-format --diff \
|
|
|
|
--extensions ',h,hh,hpp,hxx,c,cc,cxx,cpp' HEAD~1 \
|
|
|
|
-- \
|
|
|
|
libcxx/{benchmarks,include,src,test} \
|
|
|
|
libcxxabi/{fuzz,include,src,test} \
|
|
|
|
| tee ${BUILD_DIR}/clang-format.patch
|
|
|
|
# Check if the diff is empty, fail otherwise.
|
|
|
|
! grep -q '^--- a' ${BUILD_DIR}/clang-format.patch
|
|
|
|
;;
|
2021-04-05 02:11:48 +08:00
|
|
|
check-generated-output)
|
2021-04-29 01:13:52 +08:00
|
|
|
# `! foo` doesn't work properly with `set -e`, use `! foo || false` instead.
|
|
|
|
# https://stackoverflow.com/questions/57681955/set-e-does-not-respect-logical-not
|
2021-04-05 02:11:48 +08:00
|
|
|
clean
|
2021-07-15 22:19:39 +08:00
|
|
|
generate-cmake
|
|
|
|
|
|
|
|
# Reject patches that forgot to re-run the generator scripts.
|
|
|
|
echo "+++ Making sure the generator scripts were run"
|
|
|
|
${NINJA} -vC "${BUILD_DIR}" libcxx-generate-files
|
2021-04-05 02:11:48 +08:00
|
|
|
git diff | tee ${BUILD_DIR}/generated_output.patch
|
2021-07-22 17:17:53 +08:00
|
|
|
git ls-files -o --exclude-standard | tee ${BUILD_DIR}/generated_output.status
|
2021-04-29 01:13:52 +08:00
|
|
|
! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false
|
2021-07-22 17:17:53 +08:00
|
|
|
if [ -s ${BUILD_DIR}/generated_output.status ]; then
|
|
|
|
echo "It looks like not all the generator scripts were run,"
|
|
|
|
echo "did you forget to build the libcxx-generate-files target?"
|
|
|
|
echo "Did you add all new files it generated?"
|
|
|
|
false
|
|
|
|
fi
|
2021-07-15 22:19:39 +08:00
|
|
|
|
2021-04-29 01:13:52 +08:00
|
|
|
# Reject patches that introduce non-ASCII characters or hard tabs.
|
2021-05-01 02:43:33 +08:00
|
|
|
# Depends on LC_COLLATE set at the top of this script.
|
2021-04-29 01:13:52 +08:00
|
|
|
! grep -rn '[^ -~]' libcxx/include/ || false
|
2021-07-15 22:19:39 +08:00
|
|
|
|
|
|
|
# Reject patches that introduce dependency cycles in the headers.
|
2021-04-17 21:56:34 +08:00
|
|
|
python3 libcxx/utils/graph_header_deps.py >/dev/null
|
2021-04-05 02:11:48 +08:00
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-cxx03)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-02-27 02:18:21 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-11-27 04:00:42 +08:00
|
|
|
check-abi-list
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-cxx11)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-02-27 02:18:21 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-11-27 04:00:42 +08:00
|
|
|
check-abi-list
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-cxx14)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-02-27 02:18:21 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-11-27 04:00:42 +08:00
|
|
|
check-abi-list
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-cxx17)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-02-27 02:18:21 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-11-27 04:00:42 +08:00
|
|
|
check-abi-list
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2021-01-07 19:29:04 +08:00
|
|
|
generic-cxx20)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-02-27 02:18:21 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2021-01-09 01:40:42 +08:00
|
|
|
check-abi-list
|
|
|
|
;;
|
|
|
|
generic-cxx2b)
|
|
|
|
clean
|
2021-02-27 02:18:21 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2021-01-09 01:40:42 +08:00
|
|
|
check-cxx-cxxabi
|
2020-11-27 04:00:42 +08:00
|
|
|
check-abi-list
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2021-06-09 21:41:27 +08:00
|
|
|
generic-assertions)
|
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2021-06-09 21:41:27 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
check-abi-list
|
|
|
|
;;
|
2021-04-20 23:27:03 +08:00
|
|
|
generic-debug-iterators)
|
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2021-04-20 23:27:03 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
check-abi-list
|
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-noexceptions)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2021-06-03 05:07:57 +08:00
|
|
|
generic-modules)
|
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2021-06-03 05:07:57 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2021-03-24 21:50:59 +08:00
|
|
|
generic-static)
|
|
|
|
clean
|
2021-02-27 02:18:21 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-static.cfg.in"
|
2021-03-24 21:50:59 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-32bit)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-32bits.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2021-07-09 00:26:33 +08:00
|
|
|
generic-clang-11)
|
|
|
|
export CC=clang-11
|
|
|
|
export CXX=clang++-11
|
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2021-07-09 00:26:33 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
|
|
|
generic-clang-12)
|
|
|
|
export CC=clang-12
|
|
|
|
export CXX=clang++-12
|
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2021-07-09 00:26:33 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-gcc)
|
2021-06-16 03:07:03 +08:00
|
|
|
export CC=gcc-11
|
|
|
|
export CXX=g++-11
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-03-24 21:50:59 +08:00
|
|
|
generate-cmake
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2021-07-15 21:46:36 +08:00
|
|
|
generic-gcc-cxx11)
|
|
|
|
export CC=gcc-11
|
|
|
|
export CXX=g++-11
|
|
|
|
clean
|
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake"
|
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-asan)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-msan)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-tsan)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-ubsan)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-with_llvm_unwinder)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-singlethreaded)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-singlethreaded.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2021-03-24 02:09:52 +08:00
|
|
|
generic-no-debug)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-10-07 04:46:58 +08:00
|
|
|
;;
|
2021-01-19 01:18:18 +08:00
|
|
|
generic-no-filesystem)
|
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2021-01-19 01:18:18 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2020-10-15 22:32:09 +08:00
|
|
|
generic-no-random_device)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-10-15 22:32:09 +08:00
|
|
|
;;
|
2020-10-10 03:31:05 +08:00
|
|
|
generic-no-localization)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-10 03:31:05 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2021-05-26 02:11:08 +08:00
|
|
|
generic-no-unicode)
|
|
|
|
clean
|
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake"
|
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2020-10-01 20:55:40 +08:00
|
|
|
x86_64-apple-system)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2020-10-01 20:55:40 +08:00
|
|
|
;;
|
|
|
|
x86_64-apple-system-noexceptions)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2020-10-23 22:02:14 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
|
|
|
|
-DLIBCXX_ENABLE_EXCEPTIONS=OFF \
|
2021-06-01 00:44:48 +08:00
|
|
|
-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2020-11-05 23:47:06 +08:00
|
|
|
x86_64-apple-system-backdeployment-*)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
|
|
|
|
|
|
|
if [[ "${OSX_ROOTS}" == "" ]]; then
|
|
|
|
echo "--- Downloading previous macOS dylibs"
|
2021-03-26 02:14:20 +08:00
|
|
|
PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/liu4fmc53qzlfly/libcxx-roots.tar.gz"
|
2020-11-06 08:02:32 +08:00
|
|
|
OSX_ROOTS="${BUILD_DIR}/macos-roots"
|
|
|
|
mkdir -p "${OSX_ROOTS}"
|
|
|
|
curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
DEPLOYMENT_TARGET="${BUILDER#x86_64-apple-system-backdeployment-}"
|
2020-07-09 04:38:54 +08:00
|
|
|
|
|
|
|
# TODO: On Apple platforms, we never produce libc++abi.1.dylib, always libc++abi.dylib.
|
|
|
|
# Fix that in the build so that the tests stop searching for @rpath/libc++abi.1.dylib.
|
|
|
|
cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \
|
|
|
|
"${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib"
|
|
|
|
|
2020-11-06 08:02:32 +08:00
|
|
|
PARAMS="target_triple=x86_64-apple-macosx${DEPLOYMENT_TARGET}"
|
|
|
|
PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
|
2020-07-09 04:38:54 +08:00
|
|
|
PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
|
2020-11-06 08:02:32 +08:00
|
|
|
PARAMS+=";use_system_cxx_lib=True"
|
|
|
|
|
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
|
|
|
|
-DLIBCXX_TEST_PARAMS="${PARAMS}" \
|
|
|
|
-DLIBCXXABI_TEST_PARAMS="${PARAMS}"
|
|
|
|
|
2020-07-09 04:38:54 +08:00
|
|
|
check-cxx-cxxabi
|
2020-11-05 23:47:06 +08:00
|
|
|
;;
|
2020-10-23 22:02:14 +08:00
|
|
|
benchmarks)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-benchmarks
|
2020-10-01 20:55:40 +08:00
|
|
|
;;
|
2020-11-06 03:34:29 +08:00
|
|
|
documentation)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
|
|
|
generate-cmake -DLLVM_ENABLE_SPHINX=ON
|
|
|
|
|
|
|
|
echo "+++ Generating documentation"
|
2021-03-20 07:26:15 +08:00
|
|
|
${NINJA} -vC "${BUILD_DIR}" docs-libcxx-html
|
2020-11-06 03:34:29 +08:00
|
|
|
;;
|
2020-10-24 04:27:41 +08:00
|
|
|
unified-standalone)
|
|
|
|
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
|
|
|
|
2020-10-24 04:27:41 +08:00
|
|
|
echo "--- Generating CMake"
|
2021-05-08 01:14:57 +08:00
|
|
|
${CMAKE} \
|
|
|
|
-S "${MONOREPO_ROOT}/libcxx/utils/ci/runtimes" \
|
2020-10-24 04:27:41 +08:00
|
|
|
-B "${BUILD_DIR}" \
|
2021-03-05 05:01:36 +08:00
|
|
|
-GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
|
2020-10-24 04:27:41 +08:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
|
2021-06-01 00:44:48 +08:00
|
|
|
-DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi;libunwind" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2020-10-24 04:27:41 +08:00
|
|
|
|
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2021-03-17 02:57:42 +08:00
|
|
|
runtimes-build)
|
|
|
|
clean
|
|
|
|
|
|
|
|
echo "--- Generating CMake"
|
2021-06-15 02:36:13 +08:00
|
|
|
# TODO: We currently enable modules and assertions in the runtimes build
|
|
|
|
# because that provides coverage for some specific Clang failures
|
|
|
|
# we've been seeing recently, however it would be better to instead
|
|
|
|
# run all CI configurations against a Clang that has assertions enabled.
|
2021-05-08 01:14:57 +08:00
|
|
|
${CMAKE} \
|
|
|
|
-S "${MONOREPO_ROOT}/llvm" \
|
2021-03-17 02:57:42 +08:00
|
|
|
-B "${BUILD_DIR}" \
|
2021-05-08 01:14:57 +08:00
|
|
|
-GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
|
2021-03-17 02:57:42 +08:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
|
|
|
|
-DLLVM_ENABLE_PROJECTS="clang" \
|
|
|
|
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
|
2021-06-08 08:09:36 +08:00
|
|
|
-DLLVM_RUNTIME_TARGETS="x86_64-unknown-linux-gnu" \
|
2021-06-15 02:36:13 +08:00
|
|
|
-DLLVM_ENABLE_ASSERTIONS=ON \
|
2021-06-01 00:44:48 +08:00
|
|
|
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2021-03-17 02:57:42 +08:00
|
|
|
|
|
|
|
echo "+++ Running the libc++ and libc++abi tests"
|
|
|
|
${NINJA} -C "${BUILD_DIR}" check-runtimes
|
|
|
|
|
|
|
|
echo "--- Installing libc++ and libc++abi to a fake location"
|
2021-07-06 22:39:01 +08:00
|
|
|
${NINJA} -C "${BUILD_DIR}" install-runtimes
|
2021-03-17 02:57:42 +08:00
|
|
|
;;
|
2021-02-27 02:18:21 +08:00
|
|
|
legacy-test-config)
|
|
|
|
clean
|
|
|
|
generate-cmake -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/legacy.cfg.in"
|
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2020-10-24 04:27:41 +08:00
|
|
|
legacy-standalone)
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
|
|
|
|
2020-10-24 04:27:41 +08:00
|
|
|
echo "--- Generating CMake"
|
2021-05-08 01:14:57 +08:00
|
|
|
${CMAKE} \
|
|
|
|
-S "${MONOREPO_ROOT}/libcxx" \
|
2020-10-24 04:27:41 +08:00
|
|
|
-B "${BUILD_DIR}/libcxx" \
|
2021-03-05 05:01:36 +08:00
|
|
|
-GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
|
2020-10-24 04:27:41 +08:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
|
|
|
|
-DLLVM_PATH="${MONOREPO_ROOT}/llvm" \
|
|
|
|
-DLIBCXX_CXX_ABI=libcxxabi \
|
|
|
|
-DLIBCXX_CXX_ABI_INCLUDE_PATHS="${MONOREPO_ROOT}/libcxxabi/include" \
|
|
|
|
-DLIBCXX_CXX_ABI_LIBRARY_PATH="${BUILD_DIR}/libcxxabi/lib"
|
|
|
|
|
2021-05-08 01:14:57 +08:00
|
|
|
${CMAKE} \
|
|
|
|
-S "${MONOREPO_ROOT}/libcxxabi" \
|
2020-10-24 04:27:41 +08:00
|
|
|
-B "${BUILD_DIR}/libcxxabi" \
|
2021-03-05 05:01:36 +08:00
|
|
|
-GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
|
2020-10-24 04:27:41 +08:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
|
|
|
|
-DLLVM_PATH="${MONOREPO_ROOT}/llvm" \
|
|
|
|
-DLIBCXXABI_LIBCXX_PATH="${MONOREPO_ROOT}/libcxx" \
|
2020-06-27 00:08:59 +08:00
|
|
|
-DLIBCXXABI_LIBCXX_INCLUDES="${BUILD_DIR}/libcxx/include/c++/v1" \
|
2020-10-27 02:25:49 +08:00
|
|
|
-DLIBCXXABI_LIBCXX_LIBRARY_PATH="${BUILD_DIR}/libcxx/lib"
|
2020-10-24 04:27:41 +08:00
|
|
|
|
2020-06-27 00:08:59 +08:00
|
|
|
echo "+++ Generating libc++ headers"
|
|
|
|
${NINJA} -vC "${BUILD_DIR}/libcxx" generate-cxx-headers
|
|
|
|
|
2020-10-24 04:27:41 +08:00
|
|
|
echo "+++ Building libc++abi"
|
2021-03-20 07:26:15 +08:00
|
|
|
${NINJA} -vC "${BUILD_DIR}/libcxxabi" cxxabi
|
2020-10-24 04:27:41 +08:00
|
|
|
|
|
|
|
echo "+++ Building libc++"
|
2021-03-20 07:26:15 +08:00
|
|
|
${NINJA} -vC "${BUILD_DIR}/libcxx" cxx
|
2020-10-24 04:27:41 +08:00
|
|
|
|
|
|
|
echo "+++ Running the libc++ tests"
|
2021-03-20 07:26:15 +08:00
|
|
|
${NINJA} -vC "${BUILD_DIR}/libcxx" check-cxx
|
2020-10-24 04:27:41 +08:00
|
|
|
|
|
|
|
echo "+++ Running the libc++abi tests"
|
2021-03-20 07:26:15 +08:00
|
|
|
${NINJA} -vC "${BUILD_DIR}/libcxxabi" check-cxxabi
|
2020-10-24 04:27:41 +08:00
|
|
|
;;
|
2021-02-08 18:43:21 +08:00
|
|
|
aarch64)
|
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2021-02-08 18:43:21 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
|
|
|
aarch64-noexceptions)
|
|
|
|
clean
|
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
|
2021-07-16 01:29:47 +08:00
|
|
|
-DLIBCXX_ENABLE_EXCEPTIONS=OFF \
|
2021-06-01 00:44:48 +08:00
|
|
|
-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2021-02-08 18:43:21 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2021-03-02 23:07:19 +08:00
|
|
|
# Aka Armv8 32 bit
|
|
|
|
armv8)
|
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2021-03-02 23:07:19 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
|
|
|
armv8-noexceptions)
|
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2021-03-02 23:07:19 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
|
|
|
# Armv7 32 bit. One building Arm only one Thumb only code.
|
|
|
|
armv7)
|
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2021-03-02 23:07:19 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
|
|
|
armv7-noexceptions)
|
|
|
|
clean
|
2021-06-01 00:44:48 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
|
2021-03-02 23:07:19 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2021-04-06 05:17:30 +08:00
|
|
|
windows-dll)
|
2021-03-17 18:10:42 +08:00
|
|
|
clean
|
|
|
|
# TODO: Currently, building with the experimental library breaks running
|
|
|
|
# tests (the test linking look for the c++experimental library with the
|
|
|
|
# wrong name, and the statically linked c++experimental can't be linked
|
|
|
|
# correctly when libc++ visibility attributes indicate dllimport linkage
|
|
|
|
# anyway), thus just disable the experimental library. Remove this
|
|
|
|
# setting when cmake and the test driver does the right thing automatically.
|
2021-04-06 05:17:30 +08:00
|
|
|
generate-cmake-libcxx-win -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
|
|
|
|
echo "+++ Running the libc++ tests"
|
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxx
|
|
|
|
;;
|
|
|
|
windows-static)
|
|
|
|
clean
|
|
|
|
generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF
|
2021-03-17 18:10:42 +08:00
|
|
|
echo "+++ Running the libc++ tests"
|
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxx
|
|
|
|
;;
|
2021-05-28 04:51:38 +08:00
|
|
|
#################################################################
|
|
|
|
# Insert vendor-specific internal configurations below.
|
|
|
|
#
|
|
|
|
# This allows vendors to extend this file with their own internal
|
|
|
|
# configurations without running into merge conflicts with upstream.
|
|
|
|
#################################################################
|
|
|
|
|
|
|
|
#################################################################
|
2020-09-23 21:20:03 +08:00
|
|
|
*)
|
|
|
|
echo "${BUILDER} is not a known configuration"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|