2323 mkdir build
2424 if [[ "${cling_on}" == "ON" ]]; then
2525 cd build
26- cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects || ' clang' }} " \
26+ cmake -DLLVM_ENABLE_PROJECTS="clang" \
2727 -DLLVM_EXTERNAL_PROJECTS=cling \
2828 -DLLVM_EXTERNAL_CLING_SOURCE_DIR=../../cling \
2929 -DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build || 'host;NVPTX' }}" \
3939 ninja LLVMOrcDebugging -j ${{ env.ncpus }}
4040 ninja clingInterpreter -j ${{ env.ncpus }}
4141 else
42+ # Non-cling, LLVM >= 22: bundle the OOP-JIT runtime into the
43+ # cache. compiler-rt is enabled with everything except the
44+ # ORC runtime turned off so the build stays cheap.
45+ NEED_OOP=0
46+ if [[ "${{ matrix.clang-runtime }}" -ge 22 ]]; then
47+ NEED_OOP=1
48+ fi
49+ if [[ "${NEED_OOP}" == "1" ]]; then
50+ PROJECTS="clang;compiler-rt"
51+ COMPILER_RT_FLAGS=(
52+ -DCOMPILER_RT_BUILD_BUILTINS=OFF
53+ -DCOMPILER_RT_BUILD_LIBFUZZER=OFF
54+ -DCOMPILER_RT_BUILD_PROFILE=OFF
55+ -DCOMPILER_RT_BUILD_MEMPROF=OFF
56+ -DCOMPILER_RT_BUILD_SANITIZERS=OFF
57+ -DCOMPILER_RT_BUILD_XRAY=OFF
58+ -DCOMPILER_RT_BUILD_GWP_ASAN=OFF
59+ -DCOMPILER_RT_BUILD_CTX_PROFILE=OFF
60+ )
61+ else
62+ PROJECTS="clang"
63+ COMPILER_RT_FLAGS=()
64+ fi
65+
4266 cd build
43- cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects || 'clang' } }" \
67+ cmake -DLLVM_ENABLE_PROJECTS="${PROJECTS }" \
4468 -DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build || 'host;NVPTX' }}" \
4569 -DCMAKE_BUILD_TYPE=Release \
4670 -DLLVM_ENABLE_ASSERTIONS=ON \
@@ -53,15 +77,17 @@ runs:
5377 -DLLVM_USE_SANITIZER="${{ matrix.sanitizer }}" \
5478 -DLLVM_INCLUDE_EXAMPLES=OFF \
5579 -DLLVM_INCLUDE_TESTS=OFF \
80+ "${COMPILER_RT_FLAGS[@]}" \
5681 ../llvm
5782 ninja clang clangInterpreter clangStaticAnalyzerCore
58- if [[ "${{ matrix.oop-jit }}" == "On" ]]; then
59- if [[ "${{ matrix.os }}" == macos* ]]; then
60- SUFFIX="_osx"
61- elif [[ "${{ matrix.os }}" == ubuntu* ]]; then
62- SUFFIX="-x86_64"
63- fi
64- ninja llvm-jitlink-executor orc_rt${SUFFIX} -j ${{ env.ncpus }}
83+ if [[ "${NEED_OOP}" == "1" ]]; then
84+ # orc_rt's per-target ninja target name varies; find it by
85+ # asking ninja for everything matching `orc_rt*`. Building
86+ # the executor unconditionally is safe -- it's always a
87+ # valid target when compiler-rt is in the build.
88+ OOP_TARGETS=$(ninja -t targets all 2>/dev/null | \
89+ awk -F: '/^orc_rt[^:]*:/{print $1}' | sort -u | tr '\n' ' ')
90+ ninja llvm-jitlink-executor ${OOP_TARGETS} -j ${{ env.ncpus }}
6591 fi
6692 cd ./tools/
6793 rm -rf $(find . -maxdepth 1 ! -name "clang" ! -name ".")
@@ -110,7 +136,7 @@ runs:
110136 if ( "${{ matrix.cling }}" -imatch "On" )
111137 {
112138 cd build
113- cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects || ' clang' }} " `
139+ cmake -DLLVM_ENABLE_PROJECTS="clang" `
114140 -DLLVM_EXTERNAL_PROJECTS=cling `
115141 -DLLVM_EXTERNAL_CLING_SOURCE_DIR="$env:CLING_DIR" `
116142 -DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build || 'host;NVPTX' }}" `
@@ -129,7 +155,7 @@ runs:
129155 {
130156 cd build
131157 echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
132- cmake -DLLVM_ENABLE_PROJECTS="${{ matrix.llvm_enable_projects || ' clang' }} " `
158+ cmake -DLLVM_ENABLE_PROJECTS="clang" `
133159 -DLLVM_TARGETS_TO_BUILD="${{ matrix.llvm_targets_to_build || 'host;NVPTX' }}" `
134160 -DCMAKE_BUILD_TYPE=Release `
135161 -DLLVM_ENABLE_ASSERTIONS=ON `
0 commit comments