]> git.proxmox.com Git - rustc.git/blob - src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh
New upstream version 1.64.0+dfsg1
[rustc.git] / src / ci / docker / host-x86_64 / dist-x86_64-linux / build-clang.sh
1 #!/usr/bin/env bash
2
3 set -ex
4
5 source shared.sh
6
7 LLVM=llvmorg-14.0.5
8
9 mkdir llvm-project
10 cd llvm-project
11
12 curl -L https://github.com/llvm/llvm-project/archive/$LLVM.tar.gz | \
13 tar xzf - --strip-components=1
14
15 mkdir clang-build
16 cd clang-build
17
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"
22
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
25 # disable them.
26 hide_output \
27 cmake ../llvm \
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"
41
42 hide_output make -j$(nproc)
43 hide_output make install
44
45 cd ../..
46 rm -rf llvm-project