summaryrefslogtreecommitdiff
path: root/cmake/base-config-ix.cmake
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-02-08 19:03:50 +0000
committerReid Kleckner <rnk@google.com>2019-02-08 19:03:50 +0000
commit673ceedd4b339eac2d5a04d45d5a649884411d5e (patch)
tree5d0a5f6cf36b46a7bbc16ac8f8f1177073a4a938 /cmake/base-config-ix.cmake
parentd0becbc12f2934d5aaaddf30fb97228a6ee2bc8f (diff)
downloadcompiler-rt-673ceedd4b339eac2d5a04d45d5a649884411d5e.tar.gz
[InstrProf] Implement static profdata registration
Summary: The motivating use case is eliminating duplicate profile data registered for the same inline function in two object files. Before this change, users would observe multiple symbol definition errors with VC link, but links with LLD would succeed. Users (Mozilla) have reported that PGO works well with clang-cl and LLD, but when using LLD without this static registration, we would get into a "relocation against a discarded section" situation. I'm not sure what happens in that situation, but I suspect that duplicate, unused profile information was retained. If so, this change will reduce the size of such binaries with LLD. Now, Windows uses static registration and is in line with all the other platforms. Reviewers: davidxl, wmi, inglorion, void, calixte Subscribers: mgorny, krytarowski, eraman, fedor.sergeev, hiraditya, #sanitizers, dmajor, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D57929 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353547 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/base-config-ix.cmake')
-rw-r--r--cmake/base-config-ix.cmake14
1 files changed, 5 insertions, 9 deletions
diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake
index 6684d7371..ee9426b71 100644
--- a/cmake/base-config-ix.cmake
+++ b/cmake/base-config-ix.cmake
@@ -47,15 +47,11 @@ if (LLVM_TREE_AVAILABLE)
${LLVM_INCLUDE_TESTS})
option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered"
${LLVM_ENABLE_WERROR})
- # Use just-built Clang to compile/link tests on all platforms, except for
- # Windows where we need to use clang-cl instead.
- if(NOT MSVC)
- set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
- set(COMPILER_RT_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++)
- else()
- set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang.exe)
- set(COMPILER_RT_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++.exe)
- endif()
+ # Use just-built Clang to compile/link tests on all platforms.
+ set(COMPILER_RT_TEST_COMPILER
+ ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang${CMAKE_EXECUTABLE_SUFFIX})
+ set(COMPILER_RT_TEST_CXX_COMPILER
+ ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++${CMAKE_EXECUTABLE_SUFFIX})
else()
# Take output dir and install path from the user.
set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH