Skip to content

Commit 5c5a4de

Browse files
committed
[test] Extend llvm_shlib_dir fix to unittests
Extend the fix from rL286952 to unittests. The fix added clang built library directories (via llvm_shlib_dir) to LD_LIBRARY_PATH. The previous logic has used llvm_libs_dir only which points to installed LLVM when doing stand-alone builds. The patch also removes the redundant win32 code that is no longer necessary now that shlibdir is used unconditionally. Differential Revision: https://reviews.llvm.org/D27812 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289865 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 248229e commit 5c5a4de

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/Unit/lit.cfg

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,16 @@ elif platform.system() == 'Darwin':
9494
elif platform.system() == 'Windows':
9595
shlibpath_var = 'PATH'
9696

97+
# in stand-alone builds, shlibdir is clang's build tree
98+
# while llvm_libs_dir is installed LLVM (and possibly older clang)
99+
llvm_shlib_dir = getattr(config, 'shlibdir', None)
100+
if not llvm_shlib_dir:
101+
lit_config.fatal('No shlibdir set!')
97102
# Point the dynamic loader at dynamic libraries in 'lib'.
98103
llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
99104
if not llvm_libs_dir:
100105
lit_config.fatal('No LLVM libs dir set!')
101-
shlibpath = os.path.pathsep.join((llvm_libs_dir,
106+
shlibpath = os.path.pathsep.join((llvm_shlib_dir, llvm_libs_dir,
102107
config.environment.get(shlibpath_var,'')))
103108

104-
# Win32 seeks DLLs along %PATH%.
105-
if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
106-
shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath))
107-
108109
config.environment[shlibpath_var] = shlibpath

0 commit comments

Comments
 (0)