summaryrefslogtreecommitdiffstats
path: root/compiler-rt
diff options
context:
space:
mode:
authorJulian Lettner <jlettner@apple.com>2019-04-04 17:25:43 +0000
committerJulian Lettner <jlettner@apple.com>2019-04-04 17:25:43 +0000
commitf7461b8c5f65ac5a5ffc7c710afc21367ad74e92 (patch)
treefe09af59d1f0b8e787a37156fe4a9fc490f88375 /compiler-rt
parentce2d45e7ba4d86a1f7b694deefddda4b60ff6fd7 (diff)
downloadbcm5719-llvm-f7461b8c5f65ac5a5ffc7c710afc21367ad74e92.tar.gz
bcm5719-llvm-f7461b8c5f65ac5a5ffc7c710afc21367ad74e92.zip
[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. llvm-svn: 357707
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/CMakeLists.txt12
-rw-r--r--compiler-rt/test/lit.common.cfg2
-rw-r--r--compiler-rt/test/tsan/libdispatch/lit.local.cfg11
3 files changed, 14 insertions, 11 deletions
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index c6769e4b797..28d6a592e1a 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -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()
diff --git a/compiler-rt/test/lit.common.cfg b/compiler-rt/test/lit.common.cfg
index 37132c3d07c..0432325c6b6 100644
--- a/compiler-rt/test/lit.common.cfg
+++ b/compiler-rt/test/lit.common.cfg
@@ -222,7 +222,7 @@ compiler_rt_debug = getattr(config, 'compiler_rt_debug', False)
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')
diff --git a/compiler-rt/test/tsan/libdispatch/lit.local.cfg b/compiler-rt/test/tsan/libdispatch/lit.local.cfg
index cafc2c47b72..a3f05d98062 100644
--- a/compiler-rt/test/tsan/libdispatch/lit.local.cfg
+++ b/compiler-rt/test/tsan/libdispatch/lit.local.cfg
@@ -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 ')
OpenPOWER on IntegriCloud