[PATCH] D117061: [BOLT][CMAKE] Accept BOLT_CLANG_EXE and BOLT_LLD_EXE
Amir Ayupov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 15 04:37:54 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGde3e3fcfa3bb: [BOLT][CMAKE] Accept BOLT_CLANG_EXE and BOLT_LLD_EXE (authored by Amir).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117061/new/
https://reviews.llvm.org/D117061
Files:
bolt/CMakeLists.txt
bolt/test/CMakeLists.txt
bolt/test/lit.cfg.py
bolt/test/lit.site.cfg.py.in
Index: bolt/test/lit.site.cfg.py.in
===================================================================
--- bolt/test/lit.site.cfg.py.in
+++ bolt/test/lit.site.cfg.py.in
@@ -19,6 +19,8 @@
config.host_arch = "@HOST_ARCH@"
config.enable_abi_breaking_checks = "@LLVM_ENABLE_ABI_BREAKING_CHECKS@"
config.python_executable = "@PYTHON_EXECUTABLE@"
+config.bolt_clang = "@BOLT_CLANG_EXE@"
+config.bolt_lld = "@BOLT_LLD_EXE@"
# Support substitution of the tools and libs dirs with user parameters. This is
# used when we can't determine the tool dir at configuration time.
Index: bolt/test/lit.cfg.py
===================================================================
--- bolt/test/lit.cfg.py
+++ bolt/test/lit.cfg.py
@@ -55,8 +55,8 @@
llvm_config.use_default_substitutions()
-llvm_config.use_clang()
-llvm_config.use_lld()
+llvm_config.use_clang(additional_tool_dirs=[os.path.dirname(config.bolt_clang)])
+llvm_config.use_lld(additional_tool_dirs=[os.path.dirname(config.bolt_lld)])
config.substitutions.append(('%cflags', '-no-pie'))
config.substitutions.append(('%cxxflags', '-no-pie'))
Index: bolt/test/CMakeLists.txt
===================================================================
--- bolt/test/CMakeLists.txt
+++ bolt/test/CMakeLists.txt
@@ -13,6 +13,16 @@
bolt_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
)
+if (BOLT_CLANG_EXE AND NOT "clang" IN_LIST LLVM_ENABLE_PROJECTS)
+ add_executable(clang IMPORTED GLOBAL)
+ set_property(TARGET clang PROPERTY IMPORTED_LOCATION "${BOLT_CLANG_EXE}")
+endif()
+
+if (BOLT_LLD_EXE AND NOT "lld" IN_LIST LLVM_ENABLE_PROJECTS)
+ add_executable(lld IMPORTED GLOBAL)
+ set_property(TARGET lld PROPERTY IMPORTED_LOCATION "${BOLT_LLD_EXE}")
+endif()
+
list(APPEND BOLT_TEST_DEPS
clang
count
Index: bolt/CMakeLists.txt
===================================================================
--- bolt/CMakeLists.txt
+++ bolt/CMakeLists.txt
@@ -9,16 +9,33 @@
set(BOLT_ENABLE_RUNTIME ON)
endif()
+set(BOLT_CLANG_EXE "" CACHE FILEPATH "Path to clang executable for the target \
+architecture for use in BOLT tests")
+set(BOLT_LLD_EXE "" CACHE FILEPATH "Path to lld executable for the target \
+architecture for use in BOLT tests")
+
set(BOLT_INCLUDE_TESTS OFF)
if (LLVM_INCLUDE_TESTS)
- if ("clang" IN_LIST LLVM_ENABLE_PROJECTS)
- if ("lld" IN_LIST LLVM_ENABLE_PROJECTS)
+ if ("clang" IN_LIST LLVM_ENABLE_PROJECTS OR BOLT_CLANG_EXE)
+ if ("clang" IN_LIST LLVM_ENABLE_PROJECTS AND BOLT_CLANG_EXE)
+ message(WARNING "BOLT_CLANG_EXE is set and clang project is enabled. \
+ BOLT_CLANG_EXE will be used for BOLT tests.")
+ endif()
+ if ("lld" IN_LIST LLVM_ENABLE_PROJECTS OR BOLT_LLD_EXE)
+ if ("lld" IN_LIST LLVM_ENABLE_PROJECTS AND BOLT_LLD_EXE)
+ message(WARNING "BOLT_LLD_EXE is set and lld project is enabled. \
+ BOLT_LLD_EXE will be used for BOLT tests.")
+ endif()
set(BOLT_INCLUDE_TESTS ON)
else()
- message(WARNING "Not including BOLT tests since lld is disabled")
+ message(WARNING "Not including BOLT tests since lld is disabled. \
+ Enable lld in LLVM_ENABLE_PROJECTS or provide a path to lld binary \
+ in BOLT_LLD_EXE.")
endif()
else()
- message(WARNING "Not including BOLT tests since clang is disabled")
+ message(WARNING "Not including BOLT tests since clang is disabled. \
+ Enable clang in LLVM_ENABLE_PROJECTS or provide a path to clang \
+ binary in BOLT_CLANG_EXE.")
endif()
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117061.400274.patch
Type: text/x-patch
Size: 3522 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220115/33799862/attachment.bin>
More information about the llvm-commits
mailing list