diff options
author | Julian Lettner <jlettner@apple.com> | 2019-03-06 19:25:09 +0000 |
---|---|---|
committer | Julian Lettner <jlettner@apple.com> | 2019-03-06 19:25:09 +0000 |
commit | d588a719b62a61e916cbb40d1bcce7a44a84e834 (patch) | |
tree | e50f576e122ff5c36ce616d0a1da49ea0c112758 /CMakeLists.txt | |
parent | 4947089b9ba0a2f6dd10b86ad3f45401e26b5c16 (diff) | |
download | compiler-rt-d588a719b62a61e916cbb40d1bcce7a44a84e834.tar.gz |
[tsan] Support interception of libdispatch on Linux
This is a new attempt for bringing TSan libdispatch support to Linux.
The main issue with the last patch (https://reviews.llvm.org/D53171) was
that we want to avoid building a separate library.
The updated plan is as follows:
1) Hide libdispatch support behind a flag: true on Darwin, false
elsewhere. If flag is specified, assume that libdispatch header and
-flbocks is available for building. This way we can directly include
the libdispatch header and rely on blocks runtime for our
implementation.
2) Optionally/weakly intercept libdispatch API functions.
This patch accomplishes 1). It compiles (without the flag enabled) on
Linux. Follow-up patches will provide 2) and enabling of tests on Linux.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D58935
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@355538 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 612f4e1fe..0b64babef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,6 +181,12 @@ option(COMPILER_RT_EXTERNALIZE_DEBUGINFO # COMPILER_RT_DEBUG_PYBOOL is used by lit.common.configured.in. pythonize_bool(COMPILER_RT_DEBUG) +option(COMPILER_RT_INTERCEPT_LIBDISPATCH + "Support interception of libdispatch (GCD). Requires '-fblocks'." OFF) +if (APPLE) # Always enable on Apple platforms. + set(COMPILER_RT_INTERCEPT_LIBDISPATCH ON) +endif() + if(APPLE AND SANITIZER_MIN_OSX_VERSION AND SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.9") # Mac OS X prior to 10.9 had problems with exporting symbols from # libc++/libc++abi. |