[compiler-rt] r357707 - [TSan][libdispatch] Specify libdispatch header dir for lit tests
Julian Lettner via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 4 10:25:43 PDT 2019
Author: yln
Date: Thu Apr 4 10:25:43 2019
New Revision: 357707
URL: http://llvm.org/viewvc/llvm-project?rev=357707&view=rev
Log:
[TSan][libdispatch] Specify libdispatch header dir for lit tests
Specify libdispatch header dir (include path) for lit tests. This is the
last missing piece in order to run the libdispatch tests on Linux even
when libdispatch is installed in a custom path instead of a default
(system) location.
Modified:
compiler-rt/trunk/CMakeLists.txt
compiler-rt/trunk/test/lit.common.cfg
compiler-rt/trunk/test/tsan/libdispatch/lit.local.cfg
Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=357707&r1=357706&r2=357707&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Thu Apr 4 10:25:43 2019
@@ -183,15 +183,17 @@ pythonize_bool(COMPILER_RT_DEBUG)
option(COMPILER_RT_INTERCEPT_LIBDISPATCH
"Support interception of libdispatch (GCD). Requires '-fblocks'" OFF)
-option(COMPILER_RT_LIBDISPATCH_INSTALL_PREFIX
- "Specify if libdispatch is installed in a non-default path" "")
+option(COMPILER_RT_LIBDISPATCH_INSTALL_PATH
+ "Specify if libdispatch is installed in a custom location" "")
if (COMPILER_RT_INTERCEPT_LIBDISPATCH AND NOT APPLE)
set(COMPILER_RT_LIBDISPATCH_CFLAGS -fblocks)
set(COMPILER_RT_TEST_LIBDISPATCH_CFLAGS)
- if (COMPILER_RT_LIBDISPATCH_INSTALL_PREFIX)
+ if (COMPILER_RT_LIBDISPATCH_INSTALL_PATH)
list(APPEND COMPILER_RT_TEST_LIBDISPATCH_CFLAGS
- -L${COMPILER_RT_LIBDISPATCH_INSTALL_PREFIX}/lib
- -Wl,-rpath=${COMPILER_RT_LIBDISPATCH_INSTALL_PREFIX}/lib)
+ -I${COMPILER_RT_LIBDISPATCH_INSTALL_PATH}/include)
+ list(APPEND COMPILER_RT_TEST_LIBDISPATCH_CFLAGS
+ -L${COMPILER_RT_LIBDISPATCH_INSTALL_PATH}/lib
+ -Wl,-rpath=${COMPILER_RT_LIBDISPATCH_INSTALL_PATH}/lib)
endif()
list(APPEND COMPILER_RT_TEST_LIBDISPATCH_CFLAGS -lBlocksRuntime -ldispatch)
endif()
Modified: compiler-rt/trunk/test/lit.common.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.cfg?rev=357707&r1=357706&r2=357707&view=diff
==============================================================================
--- compiler-rt/trunk/test/lit.common.cfg (original)
+++ compiler-rt/trunk/test/lit.common.cfg Thu Apr 4 10:25:43 2019
@@ -222,7 +222,7 @@ compiler_rt_debug = getattr(config, 'com
if not compiler_rt_debug:
config.available_features.add('compiler-rt-optimized')
-libdispatch = getattr(config, 'compiler_rt_intercept_libdispatch')
+libdispatch = getattr(config, 'compiler_rt_intercept_libdispatch', False)
if libdispatch:
config.available_features.add('libdispatch')
Modified: compiler-rt/trunk/test/tsan/libdispatch/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/libdispatch/lit.local.cfg?rev=357707&r1=357706&r2=357707&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/libdispatch/lit.local.cfg (original)
+++ compiler-rt/trunk/test/tsan/libdispatch/lit.local.cfg Thu Apr 4 10:25:43 2019
@@ -5,9 +5,10 @@ def getRoot(config):
root = getRoot(config)
-if 'libdispatch' not in root.available_features:
+if 'libdispatch' in root.available_features:
+ additional_cflags = ' -fblocks '
+ for index, (template, replacement) in enumerate(config.substitutions):
+ if template in ['%clang_tsan ', '%clangxx_tsan ']:
+ config.substitutions[index] = (template, replacement + additional_cflags)
+else:
config.unsupported = True
-
-for index, (template, replacement) in enumerate(config.substitutions):
- if template in ['%clang_tsan ', '%clangxx_tsan ']:
- config.substitutions[index] = (template, replacement + ' -fblocks ')
More information about the llvm-commits
mailing list