diff options
author | Julian Lettner <jlettner@apple.com> | 2019-03-15 17:52:27 +0000 |
---|---|---|
committer | Julian Lettner <jlettner@apple.com> | 2019-03-15 17:52:27 +0000 |
commit | 1df89e2348efbee3dbbbd7fa21e3a18a33019dc4 (patch) | |
tree | acfadfe113c8617435d5d6a022248356ce237987 /cmake | |
parent | c5552e31c22447cefbb35492845221f9d4d54665 (diff) | |
download | compiler-rt-1df89e2348efbee3dbbbd7fa21e3a18a33019dc4.tar.gz |
[TSan][libdispatch] Enable linking and running of tests on Linux
When COMPILER_RT_INTERCEPT_LIBDISPATCH is ON the TSan runtime library
now has a dependency on the blocks runtime and libdispatch. Make sure we
set all the required linking options.
Also add cmake options for specifying additional library paths to
instruct the linker where to search for libdispatch and the blocks
runtime. This allows us to build TSan runtime with libdispatch support
without installing those libraries into default linker library paths.
`CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY` is necessary to avoid
aborting the build due to failing the link step in CMake's
check_c_compiler test.
Reviewed By: dvyukov, kubamracek
Differential Revision: https://reviews.llvm.org/D59334
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@356281 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/AddCompilerRT.cmake | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake index c464a2c1b..d91c24f2e 100644 --- a/cmake/Modules/AddCompilerRT.cmake +++ b/cmake/Modules/AddCompilerRT.cmake @@ -595,6 +595,7 @@ macro(add_custom_libcxx name prefix) -DCMAKE_C_FLAGS=${LIBCXX_C_FLAGS} -DCMAKE_CXX_FLAGS=${LIBCXX_CXX_FLAGS} -DCMAKE_BUILD_TYPE=Release + -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY -DLLVM_PATH=${LLVM_MAIN_SRC_DIR} -DLLVM_BINARY_DIR=${prefix} -DLLVM_LIBRARY_OUTPUT_INTDIR=${prefix}/lib |