summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-08-30 23:16:02 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-08-30 23:16:02 +0000
commitd8c20b9443c0e4ef7b1dd5891d897e0638c55c8b (patch)
treecae4d085d82f12ea727a2b1ef37b035b863d43b9 /lldb
parent3d03769ba07c7fd30f8e6031140278e88a0d3f9c (diff)
downloadbcm5719-llvm-d8c20b9443c0e4ef7b1dd5891d897e0638c55c8b.tar.gz
bcm5719-llvm-d8c20b9443c0e4ef7b1dd5891d897e0638c55c8b.zip
[lit] Only set DYLD_LIBRARY_PATH for shared builds
In r370135 I committed a temporary workaround for the sanitized bot to not set (DY)LD_LIBRARY_PATH when (DY)LD_INSERT_LIBRARIES was set. Setting (DY)LD_LIBRARY_PATH is only necessary for (standalone) shared-library builds, so a better solution is to only set the environment variable when necessary. Differential revision: https://reviews.llvm.org/D67012 llvm-svn: 370549
Diffstat (limited to 'lldb')
-rw-r--r--lldb/lit/CMakeLists.txt1
-rw-r--r--lldb/lit/Suite/lit.cfg15
-rw-r--r--lldb/lit/Suite/lit.site.cfg.in1
3 files changed, 8 insertions, 9 deletions
diff --git a/lldb/lit/CMakeLists.txt b/lldb/lit/CMakeLists.txt
index 608b211bc0c..bb4314427e8 100644
--- a/lldb/lit/CMakeLists.txt
+++ b/lldb/lit/CMakeLists.txt
@@ -69,6 +69,7 @@ endif()
llvm_canonicalize_cmake_booleans(
LLDB_DISABLE_PYTHON
LLVM_ENABLE_ZLIB
+ LLVM_ENABLE_SHARED_LIBS
LLDB_IS_64_BITS)
configure_lit_site_cfg(
diff --git a/lldb/lit/Suite/lit.cfg b/lldb/lit/Suite/lit.cfg
index aec9690662f..9504f4ca1d8 100644
--- a/lldb/lit/Suite/lit.cfg
+++ b/lldb/lit/Suite/lit.cfg
@@ -39,21 +39,18 @@ def find_shlibpath_var():
elif platform.system() == 'Windows':
yield 'PATH'
-if not 'DYLD_INSERT_LIBRARIES' in config.environment:
- # Shared library build of LLVM may require LD_LIBRARY_PATH or equivalent.
- # This clashes with DYLD_INSERT_LIBRARIES which is needed on Darwin.
+# Shared library build of LLVM may require LD_LIBRARY_PATH or equivalent.
+if config.shared_libs:
for shlibpath_var in find_shlibpath_var():
# In stand-alone build llvm_shlib_dir specifies LLDB's lib directory while
# llvm_libs_dir specifies LLVM's lib directory.
shlibpath = os.path.pathsep.join(
- (config.llvm_shlib_dir,
- config.llvm_libs_dir,
- config.environment.get(shlibpath_var, '')))
+ (config.llvm_shlib_dir, config.llvm_libs_dir,
+ config.environment.get(shlibpath_var, '')))
config.environment[shlibpath_var] = shlibpath
- break
else:
- lit_config.warning("unable to inject shared library path on '{}'"
- .format(platform.system()))
+ lit_config.warning("unable to inject shared library path on '{}'".format(
+ platform.system()))
# Build dotest command.
dotest_cmd = [config.dotest_path]
diff --git a/lldb/lit/Suite/lit.site.cfg.in b/lldb/lit/Suite/lit.site.cfg.in
index 9b950cf32a0..306967d61fd 100644
--- a/lldb/lit/Suite/lit.site.cfg.in
+++ b/lldb/lit/Suite/lit.site.cfg.in
@@ -13,6 +13,7 @@ config.lldb_src_root = "@LLDB_SOURCE_DIR@"
config.cmake_cxx_compiler = "@CMAKE_CXX_COMPILER@"
config.host_os = "@HOST_OS@"
config.host_triple = "@LLVM_HOST_TRIPLE@"
+config.shared_libs = @LLVM_ENABLE_SHARED_LIBS@
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
config.target_triple = "@TARGET_TRIPLE@"
config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
OpenPOWER on IntegriCloud