Page MenuHomePhabricator

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

Authored by yln on Mar 13 2019, 2:55 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

yln created this revision.Mar 13 2019, 2:55 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
Herald added subscribers: llvm-commits, Restricted Project, mgorny, kubamracek. · View Herald Transcript
yln updated this revision to Diff 190527.Mar 13 2019, 4:00 PM

Refactor CMake options. All logic is in one place now.

yln updated this revision to Diff 190711.Mar 14 2019, 12:54 PM

Provide necessary linker flags when compiling tests.

This looks fine to me, but I think we need @dvyukov to sign off on this.

yln retitled this revision from [TSan][libdispatch] Enable linking of libcxx and tests on Linux to [TSan][libdispatch] Enable linking and running of tests on Linux.Mar 14 2019, 1:42 PM
yln edited the summary of this revision. (Show Details)
dvyukov accepted this revision.Mar 14 2019, 11:38 PM

I don't see any problems (because I don't understand cmake), so I am signing off :)

This revision is now accepted and ready to land.Mar 14 2019, 11:38 PM
This revision was automatically updated to reflect the committed changes.