12 curl -L https://github.com/llvm/llvm-project/archive/$LLVM.tar.gz | \
13 tar xzf - --strip-components=1
18 # For whatever reason the default set of include paths for clang is different
19 # than that of gcc. As a result we need to manually include our sysroot's
20 # include path, /rustroot/include, to clang's default include path.
21 INC="/rustroot/include:/usr/include"
23 # We need compiler-rt for the profile runtime (used later to PGO the LLVM build)
24 # but sanitizers aren't currently building. Since we don't need those, just
28 -DCMAKE_C_COMPILER=/rustroot/bin/gcc \
29 -DCMAKE_CXX_COMPILER=/rustroot/bin/g++ \
30 -DCMAKE_BUILD_TYPE=Release \
31 -DCMAKE_INSTALL_PREFIX=/rustroot \
32 -DCOMPILER_RT_BUILD_SANITIZERS=OFF \
33 -DCOMPILER_RT_BUILD_XRAY=OFF \
34 -DCOMPILER_RT_BUILD_MEMPROF=OFF \
35 -DLLVM_TARGETS_TO_BUILD=X86 \
36 -DLLVM_INCLUDE_BENCHMARKS=OFF \
37 -DLLVM_INCLUDE_TESTS=OFF \
38 -DLLVM_INCLUDE_EXAMPLES=OFF \
39 -DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt" \
40 -DC_INCLUDE_DIRS="$INC"
42 hide_output make -j$(nproc)
43 hide_output make install