-
Notifications
You must be signed in to change notification settings - Fork 6
/
build_stage2-prof-use-lto.bash
executable file
·38 lines (33 loc) · 1.26 KB
/
build_stage2-prof-use-lto.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
37
38
#!/bin/bash
TOPLEV=~/toolchain/llvm
cd ${TOPLEV}
echo "Building Clang with PGO and LTO"
mkdir ${TOPLEV}/stage2-prof-use-lto
cd ${TOPLEV}/stage2-prof-use-lto
CPATH=${TOPLEV}/llvm-bolt/bin
echo "== Configure Build"
echo "== Build with stage1-tools -- $CPATH"
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 \
-DCMAKE_INSTALL_PREFIX=${TOPLEV}/stage2-prof-use-lto/install \
-DLLVM_PROFDATA_FILE=${TOPLEV}/stage2-prof-gen/profiles/clang.profdata \
-DLLVM_ENABLE_LTO=Thin \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--emit-relocs" \
-DLLVM_ENABLE_PLUGINS=ON \
-DLLVM_ENABLE_TERMINFO=OFF || (echo "Could not configure project!"; exit 1)
echo "== Start Build"
ninja install || (echo "Could not build project!"; exit 1)