r286952 - [test] Correctly include build llvm_shlib_dir in stand-alone builds

Michal Gorny via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 15 04:54:10 PST 2016


Author: mgorny
Date: Tue Nov 15 06:54:10 2016
New Revision: 286952

URL: http://llvm.org/viewvc/llvm-project?rev=286952&view=rev
Log:
[test] Correctly include build llvm_shlib_dir in stand-alone builds

Add the build llvm_shlib_dir into LD_LIBRARY_PATH before the directory
specified as llvm_libs_dir, in order to fix stand-alone builds
attempting to use installed clang libraries.

In case of stand-alone builds llvm_libs_dir specifies the location of
installed LLVM libraries which can also contain an older version
(previous build) of clang libraries. Therefore, ensure to specify
llvm_shlib_dir (which is always the build tree path) before
the potentially-system llvm_libs_dir.

Differential Revision: https://reviews.llvm.org/D26115

Modified:
    cfe/trunk/test/lit.cfg

Modified: cfe/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.cfg?rev=286952&r1=286951&r2=286952&view=diff
==============================================================================
--- cfe/trunk/test/lit.cfg (original)
+++ cfe/trunk/test/lit.cfg Tue Nov 15 06:54:10 2016
@@ -102,10 +102,15 @@ if clang_obj_root is not None:
     path = os.path.pathsep.join((
             clang_tools_dir, llvm_tools_dir, config.environment['PATH']))
     config.environment['PATH'] = path
+    # in stand-alone builds, llvm_shlib_dir is clang's build tree
+    # while llvm_libs_dir is installed LLVM (and possibly older clang)
+    llvm_shlib_dir = getattr(config, 'llvm_shlib_dir', None)
+    if not llvm_shlib_dir:
+        lit_config.fatal('No LLVM shlib dir set!')
     llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
     if not llvm_libs_dir:
         lit_config.fatal('No LLVM libs dir set!')
-    path = os.path.pathsep.join((llvm_libs_dir,
+    path = os.path.pathsep.join((llvm_shlib_dir, llvm_libs_dir,
                                  config.environment.get('LD_LIBRARY_PATH','')))
     config.environment['LD_LIBRARY_PATH'] = path
 




More information about the cfe-commits mailing list