-
Notifications
You must be signed in to change notification settings - Fork 6
/
build_stage2-prof-use-lto.bash
40 lines (34 loc) · 1.16 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
39
40
#!/bin/bash
BASE_DIR=$(pwd)
CPATH="$(pwd)/stage1/install/bin"
mkdir -p stage2-prof-use-lto || (echo "Could not create stage2-prof-use-lto directory"; exit 1)
cd stage2-prof-use-lto
echo "== Configure Build"
echo "== Build with stage1-tools -- $CPATH"
CC=${CPATH}/clang CXX=${CPATH}/clang++ LD=${CPATH}/lld \
cmake -G Ninja \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$(pwd)/install" \
-DCLANG_ENABLE_ARCMT=OFF \
-DCLANG_ENABLE_STATIC_ANALYZER=OFF \
-DCLANG_VENDOR="LogMeIn" \
-DLLVM_ENABLE_LLD=ON \
-DLLVM_ENABLE_LTO=Full \
-DLLVM_ENABLE_PROJECTS="clang;lld" \
-DLLVM_PARALLEL_COMPILE_JOBS="$(nproc)"\
-DLLVM_PARALLEL_LINK_JOBS="$(nproc)" \
-DLLVM_POLLY_BUILD=ON \
-DLLVM_PROFDATA_FILE=${BASE_DIR}/stage2-prof-generate/profiles/clang.prof \
-DLLVM_TARGETS_TO_BUILD="X86;AArch64" \
-DLLVM_TOOL_CLANG_BUILD=ON \
-DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF \
-DLLVM_TOOL_COMPILER_RT_BUILD=OFF \
-DLLVM_TOOL_LLD_BUILD=ON \
../../llvm-project/llvm || (echo "Could not configure project!"; exit 1)
echo
echo "== Start Build"
ninja || (echo "Could not build project!"; exit 1)
echo
echo "== Install to $(pwd)/install"
ninja install