2020-09-23 09:20:03 -04: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-04 21:13:22 +01:00
|
|
|
set -o pipefail
|
2021-04-30 14:43:33 -04:00
|
|
|
unset LANG
|
|
|
|
unset LC_ALL
|
|
|
|
unset LC_COLLATE
|
2020-09-23 09:20:03 -04:00
|
|
|
|
2020-11-05 19:02:32 -05: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-05 19:09:03 -05:00
|
|
|
--build-dir <DIR> The directory to use for building the library. By default,
|
|
|
|
this is '<llvm-root>/build/<builder>'.
|
|
|
|
|
2020-11-05 19:02:32 -05: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-05 19:09:03 -05:00
|
|
|
--build-dir)
|
|
|
|
BUILD_DIR="${2}"
|
|
|
|
shift; shift
|
|
|
|
;;
|
2020-11-05 19:02:32 -05:00
|
|
|
--osx-roots)
|
|
|
|
OSX_ROOTS="${2}"
|
|
|
|
shift; shift
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
BUILDER="${1}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
|
2020-11-05 19:09:03 -05:00
|
|
|
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build/${BUILDER}}"
|
2021-01-07 17:37:09 -05:00
|
|
|
INSTALL_DIR="${BUILD_DIR}/install"
|
2020-09-23 09:20:03 -04:00
|
|
|
|
2021-05-07 13:14:57 -04: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-04 16:01:36 -05:00
|
|
|
|
2020-11-05 19:02:32 -05:00
|
|
|
function clean() {
|
|
|
|
rm -rf "${BUILD_DIR}"
|
|
|
|
}
|
|
|
|
|
2021-04-06 00:17:30 +03:00
|
|
|
function generate-cmake-base() {
|
2020-10-23 10:02:14 -04:00
|
|
|
echo "--- Generating CMake"
|
2021-05-07 13:14:57 -04:00
|
|
|
${CMAKE} \
|
2021-10-07 16:19:11 -04:00
|
|
|
-S "${MONOREPO_ROOT}/runtimes" \
|
2020-10-23 10:02:14 -04:00
|
|
|
-B "${BUILD_DIR}" \
|
2021-03-04 16:01:36 -05:00
|
|
|
-GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
|
2020-10-23 10:02:14 -04:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
|
2022-02-10 13:08:24 +02:00
|
|
|
-DLIBCXX_ENABLE_WERROR=YES \
|
2022-03-31 11:51:30 +03:00
|
|
|
-DLIBCXXABI_ENABLE_WERROR=YES \
|
|
|
|
-DLIBUNWIND_ENABLE_WERROR=YES \
|
2022-06-07 10:01:01 -04:00
|
|
|
-DLLVM_LIT_ARGS="-sv --show-unsupported --xunit-xml-output test-results.xml --timeout=1500 --time-tests" \
|
2021-04-06 00:17:30 +03:00
|
|
|
"${@}"
|
|
|
|
}
|
|
|
|
|
|
|
|
function generate-cmake() {
|
|
|
|
generate-cmake-base \
|
2021-10-07 16:19:11 -04:00
|
|
|
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
|
2020-10-23 10:02:14 -04:00
|
|
|
-DLIBCXX_CXX_ABI=libcxxabi \
|
2020-11-05 10:47:06 -05:00
|
|
|
"${@}"
|
|
|
|
}
|
|
|
|
|
2021-04-06 00:17:30 +03: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 \
|
2021-10-07 16:19:11 -04:00
|
|
|
-DLLVM_ENABLE_RUNTIMES="libcxx" \
|
2021-04-06 00:17:30 +03:00
|
|
|
-DCMAKE_C_COMPILER=clang-cl \
|
|
|
|
-DCMAKE_CXX_COMPILER=clang-cl \
|
|
|
|
-DLIBCXX_ENABLE_FILESYSTEM=YES \
|
2021-12-21 01:19:34 +02:00
|
|
|
-DLIBCXX_EXTRA_SITE_DEFINES="_LIBCPP_HAS_NO_INT128" \
|
2021-04-06 00:17:30 +03:00
|
|
|
"${@}"
|
|
|
|
}
|
|
|
|
|
2021-09-30 15:11:48 -04:00
|
|
|
function check-runtimes() {
|
|
|
|
echo "--- Installing libc++, libc++abi and libunwind to a fake location"
|
|
|
|
${NINJA} -vC "${BUILD_DIR}" install-cxx install-cxxabi install-unwind
|
2021-03-24 09:50:59 -04:00
|
|
|
|
2020-10-23 10:02:14 -04:00
|
|
|
echo "+++ Running the libc++ tests"
|
2021-03-19 16:26:15 -07:00
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxx
|
2020-10-23 10:02:14 -04:00
|
|
|
|
|
|
|
echo "+++ Running the libc++abi tests"
|
2021-03-19 16:26:15 -07:00
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxxabi
|
2021-09-30 15:11:48 -04:00
|
|
|
|
|
|
|
echo "+++ Running the libunwind tests"
|
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-unwind
|
2020-10-23 10:02:14 -04:00
|
|
|
}
|
|
|
|
|
2020-11-26 15:00:42 -05: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-19 16:26:15 -07:00
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxx-abilist || (
|
2020-12-02 08:57:02 +01:00
|
|
|
echo "+++ Generating the libc++ ABI list after failed check"
|
2021-03-19 16:26:15 -07:00
|
|
|
${NINJA} -vC "${BUILD_DIR}" generate-cxx-abilist
|
2020-12-02 08:57:02 +01:00
|
|
|
false
|
|
|
|
)
|
2020-11-26 15:00:42 -05:00
|
|
|
}
|
|
|
|
|
2020-10-23 10:02:14 -04:00
|
|
|
function check-cxx-benchmarks() {
|
|
|
|
echo "--- Running the benchmarks"
|
2021-03-19 16:26:15 -07:00
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxx-benchmarks
|
2020-10-23 10:02:14 -04:00
|
|
|
}
|
2020-09-23 09:20:03 -04:00
|
|
|
|
2021-04-01 13:40:04 -04:00
|
|
|
# Print the version of a few tools to aid diagnostics in some cases
|
2021-05-07 13:14:57 -04:00
|
|
|
${CMAKE} --version
|
2021-04-01 13:40:04 -04:00
|
|
|
${NINJA} --version
|
|
|
|
|
2022-09-01 18:38:03 +02:00
|
|
|
if [ ! -z "${CXX}" ]; then ${CXX} --version; fi
|
|
|
|
|
2020-09-23 09:20:03 -04:00
|
|
|
case "${BUILDER}" in
|
2021-02-04 21:13:22 +01: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-04 20:11:48 +02:00
|
|
|
check-generated-output)
|
2021-04-28 19:13:52 +02: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-04 20:11:48 +02:00
|
|
|
clean
|
2021-07-15 10:19:39 -04: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-04 20:11:48 +02:00
|
|
|
git diff | tee ${BUILD_DIR}/generated_output.patch
|
2021-07-22 11:17:53 +02:00
|
|
|
git ls-files -o --exclude-standard | tee ${BUILD_DIR}/generated_output.status
|
2021-04-28 19:13:52 +02:00
|
|
|
! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false
|
2021-07-22 11:17:53 +02: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 10:19:39 -04:00
|
|
|
|
2021-04-28 19:13:52 +02:00
|
|
|
# Reject patches that introduce non-ASCII characters or hard tabs.
|
2021-04-30 14:43:33 -04:00
|
|
|
# Depends on LC_COLLATE set at the top of this script.
|
2022-08-18 17:41:13 -04:00
|
|
|
! grep -rn '[^ -~]' libcxx/include libcxx/src libcxx/test libcxx/benchmarks \
|
|
|
|
--exclude '*.dat' \
|
2022-03-20 13:40:02 +01:00
|
|
|
--exclude 'format_tests.h' \
|
|
|
|
--exclude 'formatter.day.pass.cpp' \
|
2022-08-18 17:41:13 -04:00
|
|
|
--exclude 'grep.pass.cpp' \
|
|
|
|
--exclude 'locale-specific_form.pass.cpp' \
|
2022-03-20 13:40:02 +01:00
|
|
|
--exclude 'std_format_spec_string_unicode.bench.cpp' \
|
|
|
|
|| false
|
2021-07-15 10:19:39 -04:00
|
|
|
|
2022-08-18 16:49:06 -04:00
|
|
|
# Reject code with trailing whitespace
|
|
|
|
! grep -rn '[[:blank:]]$' libcxx/include libcxx/src libcxx/test libcxx/benchmarks || false
|
2021-04-04 20:11:48 +02:00
|
|
|
;;
|
2020-10-01 13:55:39 -04:00
|
|
|
generic-cxx03)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2020-11-26 15:00:42 -05:00
|
|
|
check-abi-list
|
2020-09-23 09:20:03 -04:00
|
|
|
;;
|
2020-10-01 13:55:39 -04:00
|
|
|
generic-cxx11)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2020-11-26 15:00:42 -05:00
|
|
|
check-abi-list
|
2020-09-23 09:20:03 -04:00
|
|
|
;;
|
2020-10-01 13:55:39 -04:00
|
|
|
generic-cxx14)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2020-11-26 15:00:42 -05:00
|
|
|
check-abi-list
|
2020-09-23 09:20:03 -04:00
|
|
|
;;
|
2020-10-01 13:55:39 -04:00
|
|
|
generic-cxx17)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2020-11-26 15:00:42 -05:00
|
|
|
check-abi-list
|
2020-09-23 09:20:03 -04:00
|
|
|
;;
|
2021-01-07 12:29:04 +01:00
|
|
|
generic-cxx20)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2021-01-08 18:40:42 +01:00
|
|
|
check-abi-list
|
|
|
|
;;
|
|
|
|
generic-cxx2b)
|
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2020-11-26 15:00:42 -05:00
|
|
|
check-abi-list
|
2020-09-23 09:20:03 -04:00
|
|
|
;;
|
2021-06-09 09:41:27 -04:00
|
|
|
generic-assertions)
|
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2021-06-09 09:41:27 -04:00
|
|
|
check-abi-list
|
|
|
|
;;
|
[libc++] Make the Debug mode a configuration-time only option
The debug mode has been broken pretty much ever since it was shipped
because it was possible to enable the debug mode in user code without
actually enabling it in the dylib, leading to ODR violations that
caused various kinds of failures.
This commit makes the debug mode a knob that is configured when
building the library and which can't be changed afterwards. This is
less flexible for users, however it will actually work as intended
and it will allow us, in the future, to add various kinds of checks
that do not assume the same ABI as the normal library. Furthermore,
this will make the debug mode more robust, which means that vendors
might be more tempted to support it properly, which hasn't been the
case with the current debug mode.
This patch shouldn't break any user code, except folks who are building
against a library that doesn't have the debug mode enabled and who try
to enable the debug mode in their code. Such users will get a compile-time
error explaining that this configuration isn't supported anymore.
In the future, we should further increase the granularity of the debug
mode checks so that we can cherry-pick which checks to enable, like we
do for unspecified behavior randomization.
Differential Revision: https://reviews.llvm.org/D122941
2022-04-01 16:38:30 -04:00
|
|
|
generic-debug-mode)
|
2021-04-20 11:27:03 -04:00
|
|
|
clean
|
[libc++] Make the Debug mode a configuration-time only option
The debug mode has been broken pretty much ever since it was shipped
because it was possible to enable the debug mode in user code without
actually enabling it in the dylib, leading to ODR violations that
caused various kinds of failures.
This commit makes the debug mode a knob that is configured when
building the library and which can't be changed afterwards. This is
less flexible for users, however it will actually work as intended
and it will allow us, in the future, to add various kinds of checks
that do not assume the same ABI as the normal library. Furthermore,
this will make the debug mode more robust, which means that vendors
might be more tempted to support it properly, which hasn't been the
case with the current debug mode.
This patch shouldn't break any user code, except folks who are building
against a library that doesn't have the debug mode enabled and who try
to enable the debug mode in their code. Such users will get a compile-time
error explaining that this configuration isn't supported anymore.
In the future, we should further increase the granularity of the debug
mode checks so that we can cherry-pick which checks to enable, like we
do for unspecified behavior randomization.
Differential Revision: https://reviews.llvm.org/D122941
2022-04-01 16:38:30 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-mode.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2022-07-19 11:04:31 -04:00
|
|
|
# We don't check the ABI lists because the debug mode ABI is not stable
|
2021-04-20 11:27:03 -04:00
|
|
|
;;
|
2020-10-01 13:55:39 -04:00
|
|
|
generic-noexceptions)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2022-02-14 14:39:17 -05:00
|
|
|
check-abi-list
|
2020-09-23 09:20:03 -04:00
|
|
|
;;
|
2021-06-02 17:07:57 -04:00
|
|
|
generic-modules)
|
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2022-02-14 14:39:17 -05:00
|
|
|
check-abi-list
|
2021-06-02 17:07:57 -04:00
|
|
|
;;
|
2021-03-24 09:50:59 -04:00
|
|
|
generic-static)
|
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2021-03-24 09:50:59 -04:00
|
|
|
;;
|
2022-05-18 12:05:45 -04:00
|
|
|
generic-merged)
|
|
|
|
clean
|
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-merged.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" \
|
|
|
|
-DLIBCXXABI_TEST_CONFIG="llvm-libc++abi-merged.cfg.in" \
|
|
|
|
-DLIBUNWIND_TEST_CONFIG="llvm-libunwind-merged.cfg.in"
|
|
|
|
check-runtimes
|
|
|
|
;;
|
2020-10-01 13:55:39 -04:00
|
|
|
generic-gcc)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -DLIBCXX_ENABLE_WERROR=NO \
|
2022-03-31 11:51:30 +03:00
|
|
|
-DLIBCXXABI_ENABLE_WERROR=NO \
|
|
|
|
-DLIBUNWIND_ENABLE_WERROR=NO
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2020-09-23 09:20:03 -04:00
|
|
|
;;
|
2021-07-15 09:46:36 -04:00
|
|
|
generic-gcc-cxx11)
|
|
|
|
clean
|
2021-10-07 14:54:14 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \
|
2022-03-31 11:51:30 +03:00
|
|
|
-DLIBCXX_ENABLE_WERROR=NO \
|
|
|
|
-DLIBCXXABI_ENABLE_WERROR=NO \
|
|
|
|
-DLIBUNWIND_ENABLE_WERROR=NO
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2021-07-15 09:46:36 -04:00
|
|
|
;;
|
2020-10-01 13:55:39 -04:00
|
|
|
generic-asan)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2020-09-23 09:20:03 -04:00
|
|
|
;;
|
2020-10-01 13:55:39 -04:00
|
|
|
generic-msan)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2020-09-23 09:20:03 -04:00
|
|
|
;;
|
2020-10-01 13:55:39 -04:00
|
|
|
generic-tsan)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2020-09-23 09:20:03 -04:00
|
|
|
;;
|
2020-10-01 13:55:39 -04:00
|
|
|
generic-ubsan)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2020-09-23 09:20:03 -04:00
|
|
|
;;
|
2020-10-01 13:55:39 -04:00
|
|
|
generic-with_llvm_unwinder)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2020-09-23 09:20:03 -04:00
|
|
|
;;
|
[libc++] Re-add transitive includes that had been removed since LLVM 14
This commit re-adds transitive includes that had been removed by
4cd04d1687f1, c36870c8e79c, a83f4b9cda57, 1458458b558d, 2e2f3158c604,
and 489637e66dd3. This should cover almost all the includes that had
been removed since LLVM 14 and that would contribute to breaking user
code when releasing LLVM 15.
It is possible to disable the inclusion of these headers by defining
_LIBCPP_REMOVE_TRANSITIVE_INCLUDES. The intent is that vendors will
enable that macro and start fixing downstream issues immediately. We
can then remove the macro (and the transitive includes) by default in
a future release. That way, we will break users only once by removing
transitive includes in bulk instead of doing it bit by bit a every
release, which is more disruptive for users.
Note 1: The set of headers to re-add was found by re-generating the
transitive include test on a checkout of release/14.x, which
provided the list of all transitive includes we used to provide.
Note 2: Several includes of <vector>, <optional>, <array> and <unordered_map>
have been added in this commit. These transitive inclusions were
added when we implemented boyer_moore_searcher in <functional>.
Note 3: This is a best effort patch to try and resolve downstream breakage
caused since branching LLVM 14. I wasn't able to perfectly mirror
transitive includes in LLVM 14 for a few headers, so I added a
release note explaining it. To summarize, adding boyer_moore_searcher
created a bunch of circular dependencies, so we have to break
backwards compatibility in a few cases.
Differential Revision: https://reviews.llvm.org/D128661
2022-06-27 15:53:41 -04:00
|
|
|
generic-no-transitive-includes)
|
|
|
|
clean
|
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-transitive-includes.cmake"
|
|
|
|
check-runtimes
|
|
|
|
;;
|
2022-05-24 09:58:04 -04:00
|
|
|
generic-no-threads)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-threads.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2020-09-23 09:20:03 -04:00
|
|
|
;;
|
2021-01-18 12:18:18 -05:00
|
|
|
generic-no-filesystem)
|
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2021-01-18 12:18:18 -05:00
|
|
|
;;
|
2020-10-15 10:32:09 -04:00
|
|
|
generic-no-random_device)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2020-10-15 10:32:09 -04:00
|
|
|
;;
|
2020-10-09 15:31:05 -04:00
|
|
|
generic-no-localization)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2020-10-09 15:31:05 -04:00
|
|
|
;;
|
2021-05-25 20:11:08 +02:00
|
|
|
generic-no-unicode)
|
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2021-05-25 20:11:08 +02:00
|
|
|
;;
|
2021-08-23 15:32:36 -04:00
|
|
|
generic-no-wide-characters)
|
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-wide-characters.cmake"
|
2021-08-23 15:32:36 -04:00
|
|
|
check-runtimes
|
|
|
|
;;
|
2022-02-01 16:32:39 -05:00
|
|
|
generic-no-experimental)
|
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-experimental.cmake"
|
2022-02-01 16:32:39 -05:00
|
|
|
check-runtimes
|
2022-02-14 14:39:17 -05:00
|
|
|
check-abi-list
|
2022-02-01 16:32:39 -05:00
|
|
|
;;
|
2022-02-05 14:09:45 +01:00
|
|
|
generic-abi-unstable)
|
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-abi-unstable.cmake"
|
2022-02-05 14:09:45 +01:00
|
|
|
check-runtimes
|
|
|
|
;;
|
2021-10-15 00:21:26 -04:00
|
|
|
apple-system)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2021-10-15 00:21:26 -04:00
|
|
|
|
|
|
|
arch="$(uname -m)"
|
2022-02-03 10:57:49 -05:00
|
|
|
xcrun --sdk macosx \
|
|
|
|
${MONOREPO_ROOT}/libcxx/utils/ci/apple-install-libcxx.sh \
|
|
|
|
--llvm-root ${MONOREPO_ROOT} \
|
|
|
|
--build-dir ${BUILD_DIR} \
|
|
|
|
--install-dir ${INSTALL_DIR} \
|
|
|
|
--symbols-dir "${BUILD_DIR}/symbols" \
|
|
|
|
--architectures "${arch}" \
|
|
|
|
--version "999.99"
|
2021-10-15 00:21:26 -04:00
|
|
|
|
|
|
|
# TODO: It would be better to run the tests against the fake-installed version of libc++ instead
|
2022-02-14 14:39:17 -05:00
|
|
|
xcrun --sdk macosx ninja -vC "${BUILD_DIR}/${arch}" check-cxx check-cxxabi check-cxx-abilist
|
2020-10-01 08:55:40 -04:00
|
|
|
;;
|
2022-08-04 15:25:48 -04:00
|
|
|
apple-system-backdeployment-assertions-*)
|
|
|
|
clean
|
|
|
|
|
|
|
|
if [[ "${OSX_ROOTS}" == "" ]]; then
|
|
|
|
echo "--- Downloading previous macOS dylibs"
|
|
|
|
PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz"
|
|
|
|
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#apple-system-backdeployment-assertions-}"
|
|
|
|
|
|
|
|
# TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib,
|
|
|
|
# only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the
|
|
|
|
# tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib.
|
|
|
|
cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \
|
|
|
|
"${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib"
|
|
|
|
cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \
|
|
|
|
"${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib"
|
|
|
|
|
|
|
|
arch="$(uname -m)"
|
|
|
|
PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}"
|
|
|
|
PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
|
|
|
|
PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
|
|
|
|
PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}"
|
|
|
|
PARAMS+=";use_system_cxx_lib=True"
|
|
|
|
PARAMS+=";enable_assertions=True"
|
|
|
|
# TODO: Enable experimental features during back-deployment -- right now some of the availability
|
|
|
|
# annotations are incorrect, leading to test failures that could be avoided.
|
|
|
|
PARAMS+=";enable_experimental=False"
|
|
|
|
|
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
|
|
|
|
-DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \
|
|
|
|
-DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \
|
|
|
|
-DLIBCXX_TEST_PARAMS="${PARAMS}" \
|
|
|
|
-DLIBCXXABI_TEST_PARAMS="${PARAMS}" \
|
|
|
|
-DLIBUNWIND_TEST_PARAMS="${PARAMS}"
|
|
|
|
|
|
|
|
check-runtimes
|
|
|
|
;;
|
2021-10-15 00:21:26 -04:00
|
|
|
apple-system-backdeployment-*)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
|
|
|
|
|
|
|
if [[ "${OSX_ROOTS}" == "" ]]; then
|
|
|
|
echo "--- Downloading previous macOS dylibs"
|
2022-03-15 16:18:45 -04:00
|
|
|
PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz"
|
2020-11-05 19:02:32 -05:00
|
|
|
OSX_ROOTS="${BUILD_DIR}/macos-roots"
|
|
|
|
mkdir -p "${OSX_ROOTS}"
|
|
|
|
curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}"
|
|
|
|
fi
|
|
|
|
|
2021-10-15 00:21:26 -04:00
|
|
|
DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-}"
|
2020-07-08 16:38:54 -04:00
|
|
|
|
2022-05-26 10:19:25 -04:00
|
|
|
# TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib,
|
|
|
|
# only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the
|
|
|
|
# tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib.
|
2020-07-08 16:38:54 -04:00
|
|
|
cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \
|
|
|
|
"${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib"
|
2022-05-26 10:19:25 -04:00
|
|
|
cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \
|
|
|
|
"${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib"
|
2020-07-08 16:38:54 -04:00
|
|
|
|
2021-10-15 00:21:26 -04:00
|
|
|
arch="$(uname -m)"
|
|
|
|
PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}"
|
2020-11-05 19:02:32 -05:00
|
|
|
PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
|
2020-07-08 16:38:54 -04:00
|
|
|
PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
|
2022-02-10 14:03:05 -05:00
|
|
|
PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}"
|
2020-11-05 19:02:32 -05:00
|
|
|
PARAMS+=";use_system_cxx_lib=True"
|
2022-06-30 11:57:52 -04:00
|
|
|
# TODO: Enable experimental features during back-deployment -- right now some of the availability
|
|
|
|
# annotations are incorrect, leading to test failures that could be avoided.
|
|
|
|
PARAMS+=";enable_experimental=False"
|
2020-11-05 19:02:32 -05:00
|
|
|
|
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
|
2022-02-07 17:25:41 -05:00
|
|
|
-DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
|
2022-02-10 14:03:05 -05:00
|
|
|
-DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \
|
2022-05-26 10:19:25 -04:00
|
|
|
-DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \
|
2020-11-05 19:02:32 -05:00
|
|
|
-DLIBCXX_TEST_PARAMS="${PARAMS}" \
|
2022-05-26 10:19:25 -04:00
|
|
|
-DLIBCXXABI_TEST_PARAMS="${PARAMS}" \
|
|
|
|
-DLIBUNWIND_TEST_PARAMS="${PARAMS}"
|
2020-11-05 19:02:32 -05:00
|
|
|
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2020-11-05 10:47:06 -05:00
|
|
|
;;
|
2020-10-23 10:02:14 -04:00
|
|
|
benchmarks)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake
|
2020-10-23 10:02:14 -04:00
|
|
|
check-cxx-benchmarks
|
2020-10-01 08:55:40 -04:00
|
|
|
;;
|
2020-11-05 14:34:29 -05:00
|
|
|
documentation)
|
2020-11-05 19:02:32 -05:00
|
|
|
clean
|
|
|
|
generate-cmake -DLLVM_ENABLE_SPHINX=ON
|
|
|
|
|
|
|
|
echo "+++ Generating documentation"
|
2021-03-19 16:26:15 -07:00
|
|
|
${NINJA} -vC "${BUILD_DIR}" docs-libcxx-html
|
2020-11-05 14:34:29 -05:00
|
|
|
;;
|
2021-10-20 17:43:55 -04:00
|
|
|
bootstrapping-build)
|
2021-03-16 11:57:42 -07:00
|
|
|
clean
|
|
|
|
|
|
|
|
echo "--- Generating CMake"
|
2021-05-07 13:14:57 -04:00
|
|
|
${CMAKE} \
|
|
|
|
-S "${MONOREPO_ROOT}/llvm" \
|
2021-03-16 11:57:42 -07:00
|
|
|
-B "${BUILD_DIR}" \
|
2021-05-07 13:14:57 -04:00
|
|
|
-GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
|
2021-12-08 17:58:51 +01:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
2021-03-16 11:57:42 -07:00
|
|
|
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
|
|
|
|
-DLLVM_ENABLE_PROJECTS="clang" \
|
2022-03-18 10:03:01 -04:00
|
|
|
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
|
2021-11-11 11:55:20 -05:00
|
|
|
-DLLVM_RUNTIME_TARGETS="$(c++ --print-target-triple)" \
|
2021-11-16 00:32:48 +01:00
|
|
|
-DLLVM_TARGETS_TO_BUILD="host" \
|
2021-11-11 11:55:20 -05:00
|
|
|
-DRUNTIMES_BUILD_ALLOW_DARWIN=ON \
|
2022-05-26 10:19:25 -04:00
|
|
|
-DLLVM_ENABLE_ASSERTIONS=ON
|
2021-03-16 11:57:42 -07: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 10:39:01 -04:00
|
|
|
${NINJA} -C "${BUILD_DIR}" install-runtimes
|
2021-03-16 11:57:42 -07:00
|
|
|
;;
|
2021-02-08 10:43:21 +00:00
|
|
|
aarch64)
|
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2021-02-08 10:43:21 +00:00
|
|
|
;;
|
|
|
|
aarch64-noexceptions)
|
|
|
|
clean
|
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \
|
2021-07-15 13:29:47 -04:00
|
|
|
-DLIBCXX_ENABLE_EXCEPTIONS=OFF \
|
2022-05-26 10:19:25 -04:00
|
|
|
-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2021-02-08 10:43:21 +00:00
|
|
|
;;
|
2021-03-02 15:07:19 +00:00
|
|
|
# Aka Armv8 32 bit
|
|
|
|
armv8)
|
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2021-03-02 15:07:19 +00:00
|
|
|
;;
|
|
|
|
armv8-noexceptions)
|
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2021-03-02 15:07:19 +00:00
|
|
|
;;
|
|
|
|
# Armv7 32 bit. One building Arm only one Thumb only code.
|
|
|
|
armv7)
|
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2021-03-02 15:07:19 +00:00
|
|
|
;;
|
|
|
|
armv7-noexceptions)
|
|
|
|
clean
|
2022-05-26 10:19:25 -04:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake"
|
2021-09-30 15:11:48 -04:00
|
|
|
check-runtimes
|
2021-03-02 15:07:19 +00:00
|
|
|
;;
|
2021-10-01 23:08:57 +03:00
|
|
|
clang-cl-dll)
|
2021-03-17 12:10:42 +02: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.
|
2022-07-19 10:44:06 -04:00
|
|
|
generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS="enable_experimental=False"
|
2021-04-06 00:17:30 +03:00
|
|
|
echo "+++ Running the libc++ tests"
|
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxx
|
|
|
|
;;
|
2021-10-01 23:08:57 +03:00
|
|
|
clang-cl-static)
|
2021-04-06 00:17:30 +03:00
|
|
|
clean
|
2022-03-14 14:23:38 -04:00
|
|
|
generate-cmake-libcxx-win -DLIBCXX_ENABLE_SHARED=OFF
|
2021-03-17 12:10:42 +02:00
|
|
|
echo "+++ Running the libc++ tests"
|
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxx
|
2021-10-01 23:08:57 +03:00
|
|
|
;;
|
[libcxx] Fix using the vcruntime ABI with _HAS_EXCEPTIONS=0 defined
_HAS_EXCEPTIONS=0 allows disabling the exception parts of the MS STL
and vcruntime, and e.g. compiler-rt/lib/fuzzer sets this define (to
work around issues with MS STL). If using libc++ instead of MS STL,
this define previously broke the libc++ headers.
If _HAS_EXCEPTIONS is set to 0, the vcruntime_exception.h header
doesn't define the ABI base class std::exception. If no exceptions
are going to be thrown, this probably is fine (although it also
breaks using subclasses of it as regular objects that aren't thrown),
but it requires ifdeffing out all subclasses of all exception/error
derived objects (which are sprinkled throughout the headers).
Instead, libc++ will supply an ABI compatible definition when
_HAS_EXCEPTIONS is set to 0, which will make the class hierarchies
complete.
In this build configuration, one can still create instances of
exception subclasses, and those objects will be ABI incompatible
with the ones from when _HAS_EXCEPTIONS isn't defined to 0 - but
one may argue that's a pathological/self-imposed problem in that case.
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D103947
2022-08-17 20:57:59 +00:00
|
|
|
clang-cl-no-vcruntime)
|
|
|
|
clean
|
|
|
|
# Building libc++ in the same way as in clang-cl-dll above, but running
|
|
|
|
# tests with -D_HAS_EXCEPTIONS=0, which users might set in certain
|
|
|
|
# translation units while using libc++, even if libc++ is built with
|
|
|
|
# exceptions enabled.
|
|
|
|
generate-cmake-libcxx-win -DLIBCXX_TEST_PARAMS="enable_experimental=False" \
|
|
|
|
-DLIBCXX_TEST_CONFIG="llvm-libc++-shared-no-vcruntime-clangcl.cfg.in"
|
|
|
|
echo "+++ Running the libc++ tests"
|
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxx
|
|
|
|
;;
|
2021-10-01 23:08:57 +03:00
|
|
|
mingw-dll)
|
|
|
|
clean
|
|
|
|
# Explicitly specify the compiler with a triple prefix. The CI
|
|
|
|
# environment has got two installations of Clang; the default one
|
|
|
|
# defaults to MSVC mode, while there's an installation of llvm-mingw
|
|
|
|
# further back in PATH. By calling the compiler with an explicit
|
|
|
|
# triple prefix, we use the one that is bundled with a mingw sysroot.
|
|
|
|
generate-cmake \
|
|
|
|
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \
|
|
|
|
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \
|
|
|
|
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake"
|
|
|
|
echo "+++ Running the libc++ tests"
|
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxx
|
|
|
|
;;
|
|
|
|
mingw-static)
|
|
|
|
clean
|
|
|
|
generate-cmake \
|
|
|
|
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-clang \
|
|
|
|
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-clang++ \
|
|
|
|
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake" \
|
|
|
|
-DLIBCXX_ENABLE_SHARED=OFF \
|
|
|
|
-DLIBUNWIND_ENABLE_SHARED=OFF
|
|
|
|
echo "+++ Running the libc++ tests"
|
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxx
|
2022-05-04 11:05:44 +03:00
|
|
|
;;
|
|
|
|
mingw-dll-i686)
|
|
|
|
clean
|
|
|
|
generate-cmake \
|
|
|
|
-DCMAKE_C_COMPILER=i686-w64-mingw32-clang \
|
|
|
|
-DCMAKE_CXX_COMPILER=i686-w64-mingw32-clang++ \
|
|
|
|
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/MinGW.cmake"
|
|
|
|
echo "+++ Running the libc++ tests"
|
|
|
|
${NINJA} -vC "${BUILD_DIR}" check-cxx
|
2021-03-17 12:10:42 +02:00
|
|
|
;;
|
2021-10-13 11:41:47 -04:00
|
|
|
aix)
|
|
|
|
clean
|
2021-11-09 12:44:44 -05:00
|
|
|
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AIX.cmake" \
|
2021-10-13 11:41:47 -04:00
|
|
|
-DLIBCXX_TEST_CONFIG="ibm-libc++-shared.cfg.in" \
|
2021-11-09 12:44:44 -05:00
|
|
|
-DLIBCXXABI_TEST_CONFIG="ibm-libc++abi-shared.cfg.in" \
|
2022-06-02 09:03:10 -04:00
|
|
|
-DLIBUNWIND_TEST_CONFIG="ibm-libunwind-shared.cfg.in"
|
2022-06-14 13:15:46 -04:00
|
|
|
check-abi-list
|
2022-06-02 09:03:10 -04:00
|
|
|
check-runtimes
|
2021-10-13 11:41:47 -04:00
|
|
|
;;
|
2021-05-27 16:51:38 -04: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 09:20:03 -04:00
|
|
|
*)
|
|
|
|
echo "${BUILDER} is not a known configuration"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|