HomePhabricator

[TSan][libdispatch] Enable linking and running of tests on Linux

Authored by yln on Mar 15 2019, 10:52 AM.

Description

[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

llvm-svn: 356281

Details