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
|
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-03-05 05:01:36 +08:00
|
|
|
# On macOS, fall back to using the Ninja provided with Xcode if no other Ninja can be found.
|
|
|
|
if which ninja &>/dev/null; then
|
|
|
|
NINJA="$(which ninja)"
|
|
|
|
else
|
|
|
|
NINJA="$(xcrun --find ninja)"
|
|
|
|
fi
|
|
|
|
|
2020-11-06 08:02:32 +08:00
|
|
|
function clean() {
|
|
|
|
rm -rf "${BUILD_DIR}"
|
|
|
|
}
|
|
|
|
|
2020-10-23 22:02:14 +08:00
|
|
|
function generate-cmake() {
|
|
|
|
echo "--- Generating CMake"
|
|
|
|
cmake -S "${MONOREPO_ROOT}/llvm" \
|
|
|
|
-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_ENABLE_PROJECTS="libcxx;libunwind;libcxxabi" \
|
|
|
|
-DLLVM_LIT_ARGS="-sv --show-unsupported --xunit-xml-output test-results.xml" \
|
|
|
|
-DLIBCXX_CXX_ABI=libcxxabi \
|
2020-11-05 23:47:06 +08:00
|
|
|
"${@}"
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
cmake --version
|
|
|
|
${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
|
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-cxx03)
|
2020-09-23 21:20:03 +08:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
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/Generic-cxx03.cmake"
|
|
|
|
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-09-23 21:20:03 +08:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
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/Generic-cxx11.cmake"
|
|
|
|
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-09-23 21:20:03 +08:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
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/Generic-cxx14.cmake"
|
|
|
|
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-09-23 21:20:03 +08:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
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/Generic-cxx17.cmake"
|
|
|
|
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-09-23 21:20:03 +08:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-01-07 19:29:04 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake"
|
2020-10-23 22:02:14 +08:00
|
|
|
check-cxx-cxxabi
|
2021-01-09 01:40:42 +08:00
|
|
|
check-abi-list
|
|
|
|
;;
|
|
|
|
generic-cxx2b)
|
|
|
|
export CC=clang-tot
|
|
|
|
export CXX=clang++-tot
|
|
|
|
clean
|
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake"
|
|
|
|
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-noexceptions)
|
2020-09-23 21:20:03 +08:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
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/Generic-noexceptions.cmake"
|
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2021-03-24 21:50:59 +08:00
|
|
|
generic-static)
|
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
|
|
|
clean
|
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake"
|
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-32bit)
|
2020-09-23 21:20:03 +08:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
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/Generic-32bits.cmake"
|
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-gcc)
|
2020-09-23 21:20:03 +08:00
|
|
|
export CC=gcc
|
|
|
|
export CXX=g++
|
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
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-asan)
|
2020-09-23 21:20:03 +08:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
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/Generic-asan.cmake"
|
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-msan)
|
2020-09-23 21:20:03 +08:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
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/Generic-msan.cmake"
|
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-tsan)
|
2020-09-23 21:20:03 +08:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
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/Generic-tsan.cmake"
|
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-ubsan)
|
2020-09-23 21:20:03 +08:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
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/Generic-ubsan.cmake"
|
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-with_llvm_unwinder)
|
2020-09-23 21:20:03 +08:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2020-10-23 22:02:14 +08:00
|
|
|
generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON
|
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2020-10-02 01:55:39 +08:00
|
|
|
generic-singlethreaded)
|
2020-09-23 21:20:03 +08:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
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/Generic-singlethreaded.cmake"
|
|
|
|
check-cxx-cxxabi
|
2020-09-23 21:20:03 +08:00
|
|
|
;;
|
2021-03-24 02:09:52 +08:00
|
|
|
generic-no-debug)
|
2020-10-07 04:46:58 +08:00
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2021-03-24 02:09:52 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake"
|
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)
|
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
|
|
|
clean
|
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake"
|
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2020-10-15 22:32:09 +08:00
|
|
|
generic-no-random_device)
|
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
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/Generic-no-random_device.cmake"
|
|
|
|
check-cxx-cxxabi
|
2020-10-15 22:32:09 +08:00
|
|
|
;;
|
2020-10-10 03:31:05 +08:00
|
|
|
generic-no-localization)
|
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2020-10-10 03:31:05 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake"
|
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2020-10-01 20:55:40 +08:00
|
|
|
x86_64-apple-system)
|
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
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"
|
|
|
|
check-cxx-cxxabi
|
2020-10-01 20:55:40 +08:00
|
|
|
;;
|
|
|
|
x86_64-apple-system-noexceptions)
|
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
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 \
|
|
|
|
-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF
|
|
|
|
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"
|
|
|
|
|
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
|
|
|
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)
|
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
2020-10-23 22:02:14 +08:00
|
|
|
generate-cmake
|
|
|
|
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
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
|
|
|
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)
|
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
|
|
|
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
|
|
|
|
2020-10-24 04:27:41 +08:00
|
|
|
echo "--- Generating CMake"
|
|
|
|
cmake -S "${MONOREPO_ROOT}/libcxx/utils/ci/runtimes" \
|
|
|
|
-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}" \
|
|
|
|
-DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi;libunwind"
|
|
|
|
|
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2021-03-17 02:57:42 +08:00
|
|
|
runtimes-build)
|
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
|
|
|
|
|
|
|
clean
|
|
|
|
|
|
|
|
echo "--- Generating CMake"
|
|
|
|
cmake -S "${MONOREPO_ROOT}/llvm" \
|
|
|
|
-B "${BUILD_DIR}" \
|
|
|
|
-GNinja \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
|
|
|
|
-DLLVM_ENABLE_PROJECTS="clang" \
|
|
|
|
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
|
|
|
|
-DLLVM_RUNTIME_TARGETS="x86_64-unknown-linux-gnu"
|
|
|
|
|
|
|
|
echo "+++ Running the libc++ and libc++abi tests"
|
|
|
|
${NINJA} -C "${BUILD_DIR}" check-runtimes
|
|
|
|
|
|
|
|
echo "--- Installing libc++ and libc++abi to a fake location"
|
|
|
|
${NINJA} -C "${BUILD_DIR}" install-cxx install-cxxabi
|
|
|
|
;;
|
2020-10-24 04:27:41 +08:00
|
|
|
legacy-standalone)
|
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
|
|
|
|
2020-11-06 08:02:32 +08:00
|
|
|
clean
|
|
|
|
|
2020-10-24 04:27:41 +08:00
|
|
|
echo "--- Generating CMake"
|
|
|
|
cmake -S "${MONOREPO_ROOT}/libcxx" \
|
|
|
|
-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"
|
|
|
|
|
|
|
|
cmake -S "${MONOREPO_ROOT}/libcxxabi" \
|
|
|
|
-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
|
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake"
|
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
|
|
|
aarch64-noexceptions)
|
|
|
|
clean
|
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
|
|
|
|
-DLIBCXX_ENABLE_EXCEPTIONS=OFF \
|
|
|
|
-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF
|
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2021-03-02 23:07:19 +08:00
|
|
|
# Aka Armv8 32 bit
|
|
|
|
armv8)
|
|
|
|
clean
|
2021-03-17 19:09:41 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake"
|
2021-03-02 23:07:19 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
|
|
|
armv8-noexceptions)
|
|
|
|
clean
|
2021-03-17 19:09:41 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake"
|
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-03-17 19:09:41 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake"
|
2021-03-02 23:07:19 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
|
|
|
armv7-noexceptions)
|
|
|
|
clean
|
2021-03-17 19:09:41 +08:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake"
|
2021-03-02 23:07:19 +08:00
|
|
|
check-cxx-cxxabi
|
|
|
|
;;
|
2021-03-17 18:10:42 +08:00
|
|
|
generic-win)
|
|
|
|
clean
|
|
|
|
# TODO: The CI runner doesn't have bash in the path currently, and it's
|
|
|
|
# needed for running tests. Once it's available out of the box, remove this.
|
|
|
|
export PATH="$PATH:/c/Program Files/Git/usr/bin"
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
# TODO: The CI runner currently uses Clang 11, which doesn't implicitly
|
|
|
|
# link in oldnames.lib (which is needed for some tests) when compiling
|
|
|
|
# with the plain "clang" driver, as the tests do (as opposed to using
|
|
|
|
# the "clang-cl" driver for compiling). When the CI runner runs
|
|
|
|
# Clang 12, the "-loldnames" option can be dropped.
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
echo "--- Generating CMake"
|
|
|
|
cmake -S "${MONOREPO_ROOT}/libcxx" \
|
|
|
|
-B "${BUILD_DIR}" \
|
|
|
|
-GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_C_COMPILER=clang-cl \
|
|
|
|
-DCMAKE_CXX_COMPILER=clang-cl \
|
|
|
|
-DLLVM_LIT_ARGS="-sv --show-unsupported --xunit-xml-output test-results.xml" \
|
|
|
|
-DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=NO \
|
|
|
|
-DLIBCXX_ENABLE_FILESYSTEM=YES \
|
|
|
|
-DCMAKE_CXX_FLAGS="-D_LIBCPP_HAS_NO_INT128" \
|
|
|
|
-DLIBCXX_TEST_COMPILER_FLAGS="-D_LIBCPP_HAS_NO_INT128" \
|
|
|
|
-DLIBCXX_TEST_LINKER_FLAGS="-loldnames"
|
|
|
|
echo "+++ Running the libc++ tests"
|
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxx
|
|
|
|
;;
|
2020-09-23 21:20:03 +08:00
|
|
|
*)
|
|
|
|
echo "${BUILDER} is not a known configuration"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|