run-buildbot.sh
3.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/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
BUILDER="${1}"
MONOREPO_ROOT="$(git rev-parse --show-toplevel)"
BUILD_DIR="${MONOREPO_ROOT}/build/${BUILDER}"
args=()
args+=("-DLLVM_ENABLE_PROJECTS=libcxx;libunwind;libcxxabi")
args+=("-DLIBCXX_CXX_ABI=libcxxabi")
case "${BUILDER}" in
generic-cxx03)
export CC=clang
export CXX=clang++
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported --param=std=c++03")
;;
generic-cxx11)
export CC=clang
export CXX=clang++
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported --param=std=c++11")
;;
generic-cxx14)
export CC=clang
export CXX=clang++
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported --param=std=c++14")
;;
generic-cxx17)
export CC=clang
export CXX=clang++
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported --param=std=c++17")
;;
generic-cxx2a)
export CC=clang
export CXX=clang++
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported --param=std=c++2a")
;;
generic-noexceptions)
export CC=clang
export CXX=clang++
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported")
args+=("-DLIBCXX_ENABLE_EXCEPTIONS=OFF")
args+=("-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF")
;;
generic-32bit)
export CC=clang
export CXX=clang++
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported")
args+=("-DLLVM_BUILD_32_BITS=ON")
;;
generic-gcc)
export CC=gcc
export CXX=g++
# FIXME: Re-enable experimental testing on GCC. GCC cares about the order
# in which we link -lc++experimental, which causes issues.
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported --param enable_experimental=False")
;;
generic-asan)
export CC=clang
export CXX=clang++
args+=("-DLLVM_USE_SANITIZER=Address")
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported")
;;
generic-msan)
export CC=clang
export CXX=clang++
args+=("-DLLVM_USE_SANITIZER=MemoryWithOrigins")
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported")
;;
generic-tsan)
export CC=clang
export CXX=clang++
args+=("-DLLVM_USE_SANITIZER=Thread")
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported")
;;
generic-ubsan)
export CC=clang
export CXX=clang++
args+=("-DLLVM_USE_SANITIZER=Undefined")
args+=("-DLIBCXX_ABI_UNSTABLE=ON")
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported")
;;
generic-with_llvm_unwinder)
export CC=clang
export CXX=clang++
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported")
args+=("-DLIBCXXABI_USE_LLVM_UNWINDER=ON")
;;
generic-singlethreaded)
export CC=clang
export CXX=clang++
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported")
args+=("-DLIBCXX_ENABLE_THREADS=OFF")
args+=("-DLIBCXXABI_ENABLE_THREADS=OFF")
args+=("-DLIBCXX_ENABLE_MONOTONIC_CLOCK=OFF")
;;
x86_64-apple-system)
export CC=clang
export CXX=clang++
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported")
args+=("-C${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake")
;;
x86_64-apple-system-noexceptions)
export CC=clang
export CXX=clang++
args+=("-DLLVM_LIT_ARGS=-sv --show-unsupported")
args+=("-C${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake")
args+=("-DLIBCXX_ENABLE_EXCEPTIONS=OFF")
args+=("-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF")
;;
*)
echo "${BUILDER} is not a known configuration"
exit 1
;;
esac
echo "--- Generating CMake"
rm -rf "${BUILD_DIR}"
cmake -S "${MONOREPO_ROOT}/llvm" -B "${BUILD_DIR}" -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo "${args[@]}"
echo "--- Building libc++ and libc++abi"
ninja -C "${BUILD_DIR}" check-cxx-deps cxxabi
echo "+++ Running the libc++ tests"
ninja -C "${BUILD_DIR}" check-cxx
echo "+++ Running the libc++abi tests"
ninja -C "${BUILD_DIR}" check-cxxabi
# echo "+++ Running the libc++ benchmarks"
# ninja -C "${BUILD_DIR}" check-cxx-benchmarks