[PATCH] D27812: [test] Extend llvm_shlib_dir fix to unittests

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 15 08:11:57 PST 2016


mgorny created this revision.
mgorny added reviewers: chapuni, gribozavr, ddunbar, beanz.
mgorny added a subscriber: cfe-commits.

Extend the fix from https://reviews.llvm.org/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.


https://reviews.llvm.org/D27812

Files:
  test/Unit/lit.cfg


Index: test/Unit/lit.cfg
===================================================================
--- test/Unit/lit.cfg
+++ test/Unit/lit.cfg
@@ -94,15 +94,16 @@
 elif platform.system() == 'Windows':
     shlibpath_var = 'PATH'
 
+# in stand-alone builds, shlibdir is clang's build tree
+# while llvm_libs_dir is installed LLVM (and possibly older clang)
+llvm_shlib_dir = getattr(config, 'shlibdir', None)
+if not llvm_shlib_dir:
+    lit_config.fatal('No shlibdir set!')
 # Point the dynamic loader at dynamic libraries in 'lib'.
 llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
 if not llvm_libs_dir:
     lit_config.fatal('No LLVM libs dir set!')
-shlibpath = os.path.pathsep.join((llvm_libs_dir,
+shlibpath = os.path.pathsep.join((llvm_shlib_dir, llvm_libs_dir,
                                  config.environment.get(shlibpath_var,'')))
 
-# Win32 seeks DLLs along %PATH%.
-if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
-    shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath))
-
 config.environment[shlibpath_var] = shlibpath


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27812.81587.patch
Type: text/x-patch
Size: 1075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161215/e5406990/attachment.bin>


More information about the cfe-commits mailing list