[clang] 42129de - [Clang][CMake] Set up distribution target for Clang-BOLT
Amir Ayupov via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 7 15:06:22 PST 2023
Author: Amir Ayupov
Date: 2023-02-07T15:06:15-08:00
New Revision: 42129deaa67b6c4b8fc82feb74b7e9fe25c99073
URL: https://github.com/llvm/llvm-project/commit/42129deaa67b6c4b8fc82feb74b7e9fe25c99073
DIFF: https://github.com/llvm/llvm-project/commit/42129deaa67b6c4b8fc82feb74b7e9fe25c99073.diff
LOG: [Clang][CMake] Set up distribution target for Clang-BOLT
Provide a way to install usable BOLT-optimized Clang
(clang + resource headers) using
`ninja clang-bolt install-distribution` with BOLT.cmake cache file
or `ninja stage2-clang-bolt stage2-install-distribution`
with BOLT-PGO.cmake cache file.
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D140565
Added:
Modified:
clang/cmake/caches/BOLT-PGO.cmake
clang/cmake/caches/BOLT.cmake
Removed:
################################################################################
diff --git a/clang/cmake/caches/BOLT-PGO.cmake b/clang/cmake/caches/BOLT-PGO.cmake
index 616e632d1531b..1a04ca9a74e5e 100644
--- a/clang/cmake/caches/BOLT-PGO.cmake
+++ b/clang/cmake/caches/BOLT-PGO.cmake
@@ -2,10 +2,16 @@ set(LLVM_ENABLE_PROJECTS "bolt;clang;lld" CACHE STRING "")
set(CLANG_BOOTSTRAP_TARGETS
stage2-clang-bolt
+ stage2-distribution
+ stage2-install-distribution
CACHE STRING "")
set(BOOTSTRAP_CLANG_BOOTSTRAP_TARGETS
clang-bolt
+ distribution
+ install-distribution
CACHE STRING "")
-set(PGO_BUILD_CONFIGURATION ${CMAKE_CURRENT_LIST_DIR}/BOLT.cmake CACHE STRING "")
+set(PGO_BUILD_CONFIGURATION
+ ${CMAKE_CURRENT_LIST_DIR}/BOLT.cmake
+ CACHE STRING "")
include(${CMAKE_CURRENT_LIST_DIR}/PGO.cmake)
diff --git a/clang/cmake/caches/BOLT.cmake b/clang/cmake/caches/BOLT.cmake
index 65444c8044c3b..78ab3b64386a4 100644
--- a/clang/cmake/caches/BOLT.cmake
+++ b/clang/cmake/caches/BOLT.cmake
@@ -8,6 +8,13 @@ set(CLANG_BOLT_INSTRUMENT_EXTRA_CMAKE_FLAGS "" CACHE STRING "")
set(LLVM_ENABLE_PROJECTS "bolt;clang" CACHE STRING "")
set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "")
+# setup toolchain
+set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")
+set(LLVM_DISTRIBUTION_COMPONENTS
+ clang
+ clang-resource-headers
+ CACHE STRING "")
+
# Disable function splitting enabled by default in GCC8+
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-reorder-blocks-and-partition")
More information about the cfe-commits
mailing list