|
1 | 1 | # Stage 2: |
2 | | -# * Build an LTO optimized libcxx, so we can staticially link it into stage 3 |
3 | | -# clang. |
4 | | -# * Stage 3 will be PGO optimized, so we need to build clang, lld, and |
5 | | -# compiler-rt in stage 2. |
| 2 | +# * This is the final stage. |
| 3 | +# * The goal is to have a clang that is LTO, PGO, and bolt optimized and also |
| 4 | +# statically linked to libcxx and compiler-rt. |
6 | 5 |
|
7 | | - |
8 | | -set(CMAKE_BUILD_TYPE Release CACHE STRING "") |
9 | 6 | set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "") |
10 | 7 | set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "" FORCE) |
11 | | -set(LLVM_ENABLE_PROJECTS "clang;lld" CACHE STRING "" FORCE) |
12 | | - |
13 | | -set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "") |
14 | | -set(CLANG_BOOTSTRAP_CMAKE_ARGS -C ${CMAKE_CURRENT_LIST_DIR}/stage3-instrumented.cmake CACHE BOOL "") |
15 | | -set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED IR CACHE BOOL "") |
16 | | -set(CLANG_BOOTSTRAP_TARGETS stage3-check-all stage3-distribution stage3-install-distribution stage3-clang stage3-clang-bolt CACHE BOOL "") |
17 | | -set(LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY ON CACHE STRING "") |
18 | | -set(RUNTIMES_CMAKE_ARGS "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON" CACHE STRING "") |
| 8 | +set(LLVM_ENABLE_PROJECTS "clang;lld;bolt;" CACHE STRING "" FORCE) |
19 | 9 | set(LLVM_ENABLE_LLD ON CACHE STRING "") |
20 | | -#set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING "") |
| 10 | +set(LLVM_ENABLE_LTO THIN CACHE STRING "") |
| 11 | +set(LLVM_ENABLE_LIBCXX ON CACHE STRING "") |
| 12 | +set(LLVM_STATIC_LINK_CXX_STDLIB ON CACHE STRING "") |
| 13 | +set(CLANG_BOLT "INSTRUMENT" CACHE STRING "") |
| 14 | +set(CMAKE_EXE_LINKER_FLAGS "-Wl,--emit-relocs,-znow -rtlib=compiler-rt --unwindlib=libunwind -static-libgcc" CACHE STRING "") |
| 15 | +set(CMAKE_SHARED_LINKER_FLAGS "-rtlib=compiler-rt --unwindlib=libunwind -static-libgcc" CACHE STRING "") |
| 16 | +set(LLVM_DISTRIBUTION_COMPONENTS "clang;lld;runtimes;clang-resource-headers" CACHE STRING "") |
0 commit comments