2 #===----------------------------------------------------------------------===##
4 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 # See https://llvm.org/LICENSE.txt for license information.
6 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 #===----------------------------------------------------------------------===##
16 PROGNAME
="$(basename "${0}")"
21 ${PROGNAME} [options] <BUILDER>
23 [-h|--help] Display this help and exit.
25 --llvm-root <DIR> Path to the root of the LLVM monorepo. By default, we try
26 to figure it out based on the current working directory.
28 --build-dir <DIR> The directory to use for building the library. By default,
29 this is '<llvm-root>/build/<builder>'.
33 if [[ $# == 0 ]]; then
38 while [[ $# -gt 0 ]]; do
59 MONOREPO_ROOT
="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
60 BUILD_DIR
="${BUILD_DIR:=${MONOREPO_ROOT}/build/${BUILDER}}"
61 INSTALL_DIR
="${BUILD_DIR}/install"
67 # Print the version of a few tools to aid diagnostics in some cases
73 echo "*** Checking for trailing whitespace left in Clang source files ***"
74 if grep -rnI '[[:blank:]]$' clang
/lib clang
/include clang
/docs
; then
75 echo "*** Trailing whitespace has been found in Clang source files as described above ***"
81 # We use Release here to avoid including debug information. Otherwise, the
82 # clang binary is very large, which is problematic because we need to upload
83 # the artifacts for other jobs to use. This may seem like nothing, but with
84 # the number of jobs we run daily, this can result in thousands of GB of
90 -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
91 -DCMAKE_BUILD_TYPE=Release \
92 -DCMAKE_INSTALL_PREFIX=install \
93 -DLLVM_ENABLE_PROJECTS="clang;compiler-rt" \
95 ninja
-C ${BUILD_DIR} install-clang install-clang-resource-headers
97 tar -cJvf install.
tar.xz install
/
98 buildkite-agent artifact upload
--debug install.
tar.xz
100 ninja
-C ${BUILD_DIR} check-clang
103 cmake
-S llvm
-B ${BUILD_DIR} -G Ninja \
104 -D CMAKE_C_COMPILER_LAUNCHER
=sccache \
105 -D CMAKE_CXX_COMPILER_LAUNCHER
=sccache \
106 -D CMAKE_BUILD_TYPE
=Release \
107 -D CMAKE_INSTALL_PREFIX
=install-windows \
108 -D LLVM_ENABLE_PROJECTS
="clang;compiler-rt" \
109 -D LLVM_ENABLE_ASSERTIONS
=ON \
110 -D LLVM_BUILD_EXAMPLES
=ON \
111 -D COMPILER_RT_BUILD_LIBFUZZER
=OFF \
112 -D COMPILER_RT_BUILD_ORC
=OFF
114 ninja
-C ${BUILD_DIR} install-clang install-clang-resource-headers
115 ninja
-C ${BUILD_DIR} check-clang
118 buildkite-agent artifact download
install.
tar.xz .
119 tar -xvf install.
tar.xz
120 export CC
=$
(pwd)/install
/bin
/clang
121 export CXX
=$
(pwd)/install
/bin
/clang
++
122 chmod +x install
/bin
/clang install
/bin
/clang
++
125 cmake
-S "${MONOREPO_ROOT}/runtimes" -B "${BUILD_DIR}" -GNinja \
126 -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
127 -DLIBCXX_CXX_ABI=libcxxabi \
128 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
129 -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
130 -DLIBCXX_TEST_PARAMS="std=c++03" \
131 -DLIBCXXABI_TEST_PARAMS="std=c++03"
133 ninja
-vC "${BUILD_DIR}" check-runtimes
136 buildkite-agent artifact download
install.
tar.xz .
137 tar -xvf install.
tar.xz
138 export CC
=$
(pwd)/install
/bin
/clang
139 export CXX
=$
(pwd)/install
/bin
/clang
++
140 chmod +x install
/bin
/clang install
/bin
/clang
++
143 cmake
-S "${MONOREPO_ROOT}/runtimes" -B "${BUILD_DIR}" -GNinja \
144 -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
145 -DLIBCXX_CXX_ABI=libcxxabi \
146 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
147 -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
148 -DLIBCXX_TEST_PARAMS="std=c++26" \
149 -DLIBCXXABI_TEST_PARAMS="std=c++26"
151 ninja
-vC "${BUILD_DIR}" check-runtimes
154 buildkite-agent artifact download
install.
tar.xz .
155 tar -xvf install.
tar.xz
156 export CC
=$
(pwd)/install
/bin
/clang
157 export CXX
=$
(pwd)/install
/bin
/clang
++
158 chmod +x install
/bin
/clang install
/bin
/clang
++
161 cmake
-S "${MONOREPO_ROOT}/runtimes" -B "${BUILD_DIR}" -GNinja \
162 -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
163 -DLIBCXX_CXX_ABI=libcxxabi \
164 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
165 -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
166 -DLIBCXX_TEST_PARAMS="enable_modules=clang" \
167 -DLIBCXXABI_TEST_PARAMS="enable_modules=clang"
169 ninja
-vC "${BUILD_DIR}" check-runtimes
171 #################################################################
172 # Insert vendor-specific internal configurations below.
174 # This allows vendors to extend this file with their own internal
175 # configurations without running into merge conflicts with upstream.
176 #################################################################
178 #################################################################
180 echo "${BUILDER} is not a known configuration"