[llvm-branch-commits] [clang] 9d0a2a4 - [BOLT][CMake] Use correct output paths and passthrough necessary options
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue May 30 15:48:15 PDT 2023
Author: Petr Hosek
Date: 2023-05-30T15:47:43-07:00
New Revision: 9d0a2a41081ba3f02cc97d6d763be9916550bb7a
URL: https://github.com/llvm/llvm-project/commit/9d0a2a41081ba3f02cc97d6d763be9916550bb7a
DIFF: https://github.com/llvm/llvm-project/commit/9d0a2a41081ba3f02cc97d6d763be9916550bb7a.diff
LOG: [BOLT][CMake] Use correct output paths and passthrough necessary options
This addresses https://github.com/llvm/llvm-project/issues/62748.
Differential Revision: https://reviews.llvm.org/D150752
Added:
Modified:
bolt/CMakeLists.txt
bolt/runtime/CMakeLists.txt
clang/cmake/caches/Fuchsia-stage2.cmake
Removed:
################################################################################
diff --git a/bolt/CMakeLists.txt b/bolt/CMakeLists.txt
index 5c85fef162e18..91b62cf4e2503 100644
--- a/bolt/CMakeLists.txt
+++ b/bolt/CMakeLists.txt
@@ -46,6 +46,10 @@ endif()
if (BOLT_ENABLE_RUNTIME)
message(STATUS "Building BOLT runtime libraries for X86")
+ set(extra_args "")
+ if(CMAKE_SYSROOT)
+ list(APPEND extra_args -DCMAKE_SYSROOT=${CMAKE_SYSROOT})
+ endif()
ExternalProject_Add(bolt_rt
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/runtime"
STAMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/bolt_rt-stamps
@@ -54,8 +58,10 @@ if (BOLT_ENABLE_RUNTIME)
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
- -DCMAKE_INSTALL_PREFIX=${LLVM_BINARY_DIR}
-DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX}
+ -DLLVM_LIBRARY_DIR=${LLVM_LIBRARY_DIR}
+ ${extra_args}
+ INSTALL_COMMAND ""
BUILD_ALWAYS True
)
install(CODE "execute_process\(COMMAND \${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=\${CMAKE_INSTALL_PREFIX} -P ${CMAKE_CURRENT_BINARY_DIR}/bolt_rt-bins/cmake_install.cmake \)"
diff --git a/bolt/runtime/CMakeLists.txt b/bolt/runtime/CMakeLists.txt
index 7d177f7c598b1..6aa8edb8424a3 100644
--- a/bolt/runtime/CMakeLists.txt
+++ b/bolt/runtime/CMakeLists.txt
@@ -15,12 +15,12 @@ add_library(bolt_rt_instr STATIC
instr.cpp
${CMAKE_CURRENT_BINARY_DIR}/config.h
)
-set_target_properties(bolt_rt_instr PROPERTIES LIBRARY_OUTPUT_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}")
+set_target_properties(bolt_rt_instr PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${LLVM_LIBRARY_DIR}")
add_library(bolt_rt_hugify STATIC
hugify.cpp
${CMAKE_CURRENT_BINARY_DIR}/config.h
)
-set_target_properties(bolt_rt_hugify PROPERTIES LIBRARY_OUTPUT_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}")
+set_target_properties(bolt_rt_hugify PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${LLVM_LIBRARY_DIR}")
set(BOLT_RT_FLAGS
-ffreestanding
@@ -44,7 +44,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*")
instr.cpp
${CMAKE_CURRENT_BINARY_DIR}/config.h
)
- set_target_properties(bolt_rt_instr_osx PROPERTIES LIBRARY_OUTPUT_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}")
+ set_target_properties(bolt_rt_instr_osx PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${LLVM_LIBRARY_DIR}")
target_include_directories(bolt_rt_instr_osx PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_compile_options(bolt_rt_instr_osx PRIVATE
-target x86_64-apple-darwin19.6.0
diff --git a/clang/cmake/caches/Fuchsia-stage2.cmake b/clang/cmake/caches/Fuchsia-stage2.cmake
index 9694a0f598565..a4984f095a2ae 100644
--- a/clang/cmake/caches/Fuchsia-stage2.cmake
+++ b/clang/cmake/caches/Fuchsia-stage2.cmake
@@ -253,7 +253,6 @@ set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")
set(LLVM_TOOLCHAIN_TOOLS
dsymutil
llvm-ar
- llvm-bolt
llvm-cov
llvm-cxxfilt
llvm-debuginfod-find
@@ -287,6 +286,7 @@ set(LLVM_TOOLCHAIN_TOOLS
CACHE STRING "")
set(LLVM_DISTRIBUTION_COMPONENTS
+ bolt
clang
lld
LTO
More information about the llvm-branch-commits
mailing list