-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild_stage3-train.bash
executable file
·36 lines (30 loc) · 1.11 KB
/
build_stage3-train.bash
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
#!/bin/bash
export TOPLEV=~/toolchain/llvm
cd ${TOPLEV}
mkdir ${TOPLEV}/stage3-train
cd ${TOPLEV}/stage3-train
CPATH=${TOPLEV}/stage2-prof-gen/bin
echo "Generating Profile for PGO"
cmake -G Ninja ${TOPLEV}/llvm-project/llvm \
-DLLVM_BINUTILS_INCDIR=/usr/include \
-DCLANG_ENABLE_ARCMT=OFF \
-DCLANG_ENABLE_STATIC_ANALYZER=OFF \
-DCLANG_PLUGIN_SUPPORT=OFF \
-DLLVM_ENABLE_BINDINGS=OFF \
-DLLVM_ENABLE_OCAMLDOC=OFF \
-DLLVM_INCLUDE_DOCS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DCMAKE_C_COMPILER=${CPATH}/clang \
-DCMAKE_CXX_COMPILER=${CPATH}/clang++ \
-DLLVM_USE_LINKER=${CPATH}/ld.lld \
-DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt;polly" \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_WARNINGS=OFF \
-DLLVM_ENABLE_PLUGINS=ON \
-DCMAKE_INSTALL_PREFIX=${TOPLEV}/stage3-train/install || (echo "Could not configure project!"; exit 1)
echo "== Start Build"
ninja || (echo "Could not build project!"; exit 1)
echo "Merging PGO-Profiles"
cd ${TOPLEV}/stage2-prof-gen/profiles
${TOPLEV}/llvm-bolt/bin/llvm-profdata merge -output=clang.profdata *