diff options
Diffstat (limited to 'sys-devel/clang/files')
5 files changed, 418 insertions, 0 deletions
diff --git a/sys-devel/clang/files/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch b/sys-devel/clang/files/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch new file mode 100644 index 000000000000..f52d445eb05b --- /dev/null +++ b/sys-devel/clang/files/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch @@ -0,0 +1,87 @@ +From f1ea62e93cba334828c427146cc2ca7718a9ffb3 Mon Sep 17 00:00:00 2001 +From: Michal Gorny <mgorny@gentoo.org> +Date: Mon, 9 Jan 2017 20:54:20 +0000 +Subject: [PATCH] [Frontend] Correct values of ATOMIC_*_LOCK_FREE to match + builtin + +Correct the logic used to set ATOMIC_*_LOCK_FREE preprocessor macros not +to rely on the ABI alignment of types. Instead, just assume all those +types are aligned correctly by default since clang uses safe alignment +for _Atomic types even if the underlying types are aligned to a lower +boundary by default. + +For example, the 'long long' and 'double' types on x86 are aligned to +32-bit boundary by default. However, '_Atomic long long' and '_Atomic +double' are aligned to 64-bit boundary, therefore satisfying +the requirements of lock-free atomic operations. + +This fixes PR #19355 by correcting the value of +__GCC_ATOMIC_LLONG_LOCK_FREE on x86, and therefore also fixing +the assumption made in libc++ tests. This also fixes PR #30581 by +applying a consistent logic between the functions used to implement +both interfaces. + +Differential Revision: https://reviews.llvm.org/D28213 + +git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291477 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + lib/Frontend/InitPreprocessor.cpp | 10 ++++------ + test/Sema/atomic-ops.c | 4 ---- + 2 files changed, 4 insertions(+), 10 deletions(-) + +diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp +index 17603ada11..4502c92499 100644 +--- a/lib/Frontend/InitPreprocessor.cpp ++++ b/lib/Frontend/InitPreprocessor.cpp +@@ -286,12 +286,12 @@ static void DefineFastIntType(unsigned TypeWidth, bool IsSigned, + + /// Get the value the ATOMIC_*_LOCK_FREE macro should have for a type with + /// the specified properties. +-static const char *getLockFreeValue(unsigned TypeWidth, unsigned TypeAlign, +- unsigned InlineWidth) { ++static const char *getLockFreeValue(unsigned TypeWidth, unsigned InlineWidth) { + // Fully-aligned, power-of-2 sizes no larger than the inline + // width will be inlined as lock-free operations. +- if (TypeWidth == TypeAlign && (TypeWidth & (TypeWidth - 1)) == 0 && +- TypeWidth <= InlineWidth) ++ // Note: we do not need to check alignment since _Atomic(T) is always ++ // appropriately-aligned in clang. ++ if ((TypeWidth & (TypeWidth - 1)) == 0 && TypeWidth <= InlineWidth) + return "2"; // "always lock free" + // We cannot be certain what operations the lib calls might be + // able to implement as lock-free on future processors. +@@ -881,7 +881,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI, + #define DEFINE_LOCK_FREE_MACRO(TYPE, Type) \ + Builder.defineMacro("__GCC_ATOMIC_" #TYPE "_LOCK_FREE", \ + getLockFreeValue(TI.get##Type##Width(), \ +- TI.get##Type##Align(), \ + InlineWidthBits)); + DEFINE_LOCK_FREE_MACRO(BOOL, Bool); + DEFINE_LOCK_FREE_MACRO(CHAR, Char); +@@ -894,7 +893,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI, + DEFINE_LOCK_FREE_MACRO(LLONG, LongLong); + Builder.defineMacro("__GCC_ATOMIC_POINTER_LOCK_FREE", + getLockFreeValue(TI.getPointerWidth(0), +- TI.getPointerAlign(0), + InlineWidthBits)); + #undef DEFINE_LOCK_FREE_MACRO + } +diff --git a/test/Sema/atomic-ops.c b/test/Sema/atomic-ops.c +index 8ebf3eaed4..d3ebdf67db 100644 +--- a/test/Sema/atomic-ops.c ++++ b/test/Sema/atomic-ops.c +@@ -14,11 +14,7 @@ _Static_assert(__GCC_ATOMIC_WCHAR_T_LOCK_FREE == 2, ""); + _Static_assert(__GCC_ATOMIC_SHORT_LOCK_FREE == 2, ""); + _Static_assert(__GCC_ATOMIC_INT_LOCK_FREE == 2, ""); + _Static_assert(__GCC_ATOMIC_LONG_LOCK_FREE == 2, ""); +-#ifdef __i386__ +-_Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 1, ""); +-#else + _Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 2, ""); +-#endif + _Static_assert(__GCC_ATOMIC_POINTER_LOCK_FREE == 2, ""); + + _Static_assert(__c11_atomic_is_lock_free(1), ""); +-- +2.12.0 + diff --git a/sys-devel/clang/files/4.0.1/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch b/sys-devel/clang/files/4.0.1/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch new file mode 100644 index 000000000000..0ecd5bc0e8c1 --- /dev/null +++ b/sys-devel/clang/files/4.0.1/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch @@ -0,0 +1,64 @@ +From 8dd12df445c9a35f7b1c0202eb7c74b954b0980d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Sun, 21 Aug 2016 23:31:55 +0200 +Subject: [PATCH 7/7] cmake: Support stand-alone Sphinx & doxygen doc build + +Copy the necessary options and configuration checks from LLVM to clang, +to support stand-alone documentation builds. + +Patch: https://reviews.llvm.org/D23758 +--- + CMakeLists.txt | 37 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8ed8c10..3f34d8c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -162,6 +162,43 @@ Please install Python or specify the PYTHON_EXECUTABLE CMake variable.") + endif() + endif() + ++ option (LLVM_BUILD_DOCS "Build the llvm documentation." OFF) ++ option (LLVM_INCLUDE_DOCS "Generate build targets for llvm documentation." ON) ++ option (LLVM_ENABLE_DOXYGEN "Use doxygen to generate llvm API documentation." OFF) ++ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF) ++ ++ if (LLVM_ENABLE_DOXYGEN) ++ message(STATUS "Doxygen enabled.") ++ find_package(Doxygen REQUIRED) ++ ++ if (DOXYGEN_FOUND) ++ # If we find doxygen and we want to enable doxygen by default create a ++ # global aggregate doxygen target for generating llvm and any/all ++ # subprojects doxygen documentation. ++ if (LLVM_BUILD_DOCS) ++ add_custom_target(doxygen ALL) ++ endif() ++ ++ option(LLVM_DOXYGEN_EXTERNAL_SEARCH "Enable doxygen external search." OFF) ++ if (LLVM_DOXYGEN_EXTERNAL_SEARCH) ++ set(LLVM_DOXYGEN_SEARCHENGINE_URL "" CACHE STRING "URL to use for external search.") ++ set(LLVM_DOXYGEN_SEARCH_MAPPINGS "" CACHE STRING "Doxygen Search Mappings") ++ endif() ++ endif() ++ else() ++ message(STATUS "Doxygen disabled.") ++ endif() ++ ++ if (LLVM_ENABLE_SPHINX) ++ message(STATUS "Sphinx enabled.") ++ find_package(Sphinx REQUIRED) ++ if (LLVM_BUILD_DOCS) ++ add_custom_target(sphinx ALL) ++ endif() ++ else() ++ message(STATUS "Sphinx disabled.") ++ endif() ++ + set( CLANG_BUILT_STANDALONE 1 ) + set(BACKEND_PACKAGE_STRING "LLVM ${LLVM_PACKAGE_VERSION}") + else() +-- +2.9.3 + diff --git a/sys-devel/clang/files/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch b/sys-devel/clang/files/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch new file mode 100644 index 000000000000..3779bc620314 --- /dev/null +++ b/sys-devel/clang/files/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch @@ -0,0 +1,48 @@ +From f1355920fbe819c5b1f5a870fc76cffcdd6328f0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Fri, 10 Feb 2017 22:44:53 +0100 +Subject: [PATCH 1/2] [test] Fix test dependencies when using installed tools + +Use the LLVM_UTILS_PROVIDED variable to determine whether test tool +dependencies should be exposed for clang-tools-extra tests. If clang is +being built stand-alone and LLVM test tools (FileCheck, count and not) +are installed, the top-level CMakeLists.txt of clang sets this variable +to indicate that they will not be built as a part of this build, +and therefore no dependencies should be emitted for them. This fixes +the dependency errors when building clang stand-alone with tests +enabled. +--- + test/CMakeLists.txt | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index a852ef60..c26bd5c4 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -31,9 +31,6 @@ if(CLANG_TOOLS_TEST_USE_VG) + endif() + + set(CLANG_TOOLS_TEST_DEPS +- # Base line deps. +- FileCheck count not +- + # clang-tidy tests require it. + clang-headers + +@@ -58,6 +55,13 @@ set(CLANG_TOOLS_TEST_DEPS + ExtraToolsUnitTests + ) + ++if(NOT LLVM_UTILS_PROVIDED) ++ list(APPEND CLANG_TOOLS_TEST_DEPS ++ # Base line deps. ++ FileCheck count not ++ ) ++endif() ++ + add_lit_testsuite(check-clang-tools "Running the Clang extra tools' regression tests" + ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${CLANG_TOOLS_TEST_DEPS} +-- +2.12.0 + diff --git a/sys-devel/clang/files/5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch b/sys-devel/clang/files/5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch new file mode 100644 index 000000000000..7d53cbdef3f3 --- /dev/null +++ b/sys-devel/clang/files/5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch @@ -0,0 +1,136 @@ +From 19e3dc0ce4949cc7f869b4552c6a7f28cd59c3b7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Thu, 17 Nov 2016 14:19:18 +0100 +Subject: [PATCH] [Driver] Use arch type to find compiler-rt libraries (on + Linux) + +Use llvm::Triple::getArchTypeName() when looking for compiler-rt +libraries, rather than the exact arch string from the triple. This is +more correct as it matches the values used when building compiler-rt +(builtin-config-ix.cmake) which are the subset of the values allowed +in triples. + +For example, this fixes an issue when the compiler set for +i686-pc-linux-gnu triple would not find an i386 compiler-rt library, +while this is the exact arch that is detected by compiler-rt. The same +applies to any other i?86 variant allowed by LLVM. + +This also makes the special case for MSVC unnecessary, since now i386 +will be used reliably for all 32-bit x86 variants. +--- + lib/Driver/ToolChain.cpp | 5 +---- + .../usr/i686-unknown-linux/lib/.keep | 0 + .../usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o | 0 + test/Driver/linux-ld.c | 21 +++++++++++++++++++++ + test/Driver/nostdlib.c | 2 +- + test/Driver/print-libgcc-file-name-clangrt.c | 10 ++++++++-- + test/Driver/windows-cross.c | 2 +- + 7 files changed, 32 insertions(+), 8 deletions(-) + create mode 100644 test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep + create mode 100644 test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o + +diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp +index 6adc0386ee..7e4222f087 100644 +--- a/lib/Driver/ToolChain.cpp ++++ b/lib/Driver/ToolChain.cpp +@@ -283,15 +283,12 @@ static StringRef getArchNameForCompilerRTLib(const ToolChain &TC, + const llvm::Triple &Triple = TC.getTriple(); + bool IsWindows = Triple.isOSWindows(); + +- if (Triple.isWindowsMSVCEnvironment() && TC.getArch() == llvm::Triple::x86) +- return "i386"; +- + if (TC.getArch() == llvm::Triple::arm || TC.getArch() == llvm::Triple::armeb) + return (arm::getARMFloatABI(TC, Args) == arm::FloatABI::Hard && !IsWindows) + ? "armhf" + : "arm"; + +- return TC.getArchName(); ++ return llvm::Triple::getArchTypeName(TC.getArch()); + } + + std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component, +diff --git a/test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep b/test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep +new file mode 100644 +index 0000000000..e69de29bb2 +diff --git a/test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o b/test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o +new file mode 100644 +index 0000000000..e69de29bb2 +diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c +index e5aa870866..92b199b9d4 100644 +--- a/test/Driver/linux-ld.c ++++ b/test/Driver/linux-ld.c +@@ -71,6 +71,27 @@ + // CHECK-LD-RT: libclang_rt.builtins-x86_64.a" + // + // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ ++// RUN: --target=i686-unknown-linux \ ++// RUN: --gcc-toolchain="" \ ++// RUN: --sysroot=%S/Inputs/basic_linux_tree \ ++// RUN: --rtlib=compiler-rt \ ++// RUN: | FileCheck --check-prefix=CHECK-LD-RT-I686 %s ++// CHECK-LD-RT-I686-NOT: warning: ++// CHECK-LD-RT-I686: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]" ++// CHECK-LD-RT-I686: "--eh-frame-hdr" ++// CHECK-LD-RT-I686: "-m" "elf_i386" ++// CHECK-LD-RT-I686: "-dynamic-linker" ++// CHECK-LD-RT-I686: "{{.*}}/usr/lib/gcc/i686-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o" ++// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0" ++// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0/../../../../i686-unknown-linux/lib" ++// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0/../../.." ++// CHECK-LD-RT-I686: "-L[[SYSROOT]]/lib" ++// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib" ++// CHECK-LD-RT-I686: libclang_rt.builtins-i386.a" ++// CHECK-LD-RT-I686: "-lc" ++// CHECK-LD-RT-I686: libclang_rt.builtins-i386.a" ++// ++// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \ + // RUN: --target=arm-linux-androideabi \ + // RUN: --gcc-toolchain="" \ + // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ +diff --git a/test/Driver/nostdlib.c b/test/Driver/nostdlib.c +index a9ef665c57..c9793d968c 100644 +--- a/test/Driver/nostdlib.c ++++ b/test/Driver/nostdlib.c +@@ -27,5 +27,5 @@ + // + // CHECK-LINUX-NOSTDLIB: warning: argument unused during compilation: '--rtlib=compiler-rt' + // CHECK-LINUX-NOSTDLIB: "{{(.*[^.0-9A-Z_a-z])?}}ld{{(.exe)?}}" +-// CHECK-LINUX-NOSTDLIB-NOT: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-i686.a" ++// CHECK-LINUX-NOSTDLIB-NOT: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-i386.a" + // CHECK-MSVC-NOSTDLIB: warning: argument unused during compilation: '--rtlib=compiler-rt' +diff --git a/test/Driver/print-libgcc-file-name-clangrt.c b/test/Driver/print-libgcc-file-name-clangrt.c +index 9f8120c31d..28c758881d 100644 +--- a/test/Driver/print-libgcc-file-name-clangrt.c ++++ b/test/Driver/print-libgcc-file-name-clangrt.c +@@ -6,6 +6,12 @@ + // CHECK-CLANGRT-X8664: libclang_rt.builtins-x86_64.a + + // RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \ ++// RUN: --target=i386-pc-linux \ ++// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s ++// CHECK-CLANGRT-I386: libclang_rt.builtins-i386.a ++ ++// Check whether alternate arch values map to the correct library. ++// ++// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \ + // RUN: --target=i686-pc-linux \ +-// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I686 %s +-// CHECK-CLANGRT-I686: libclang_rt.builtins-i686.a ++// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s +diff --git a/test/Driver/windows-cross.c b/test/Driver/windows-cross.c +index 5a2fe52b09..78b4981c9d 100644 +--- a/test/Driver/windows-cross.c ++++ b/test/Driver/windows-cross.c +@@ -59,7 +59,7 @@ + // RUN: | FileCheck %s --check-prefix CHECK-SANITIZE-ADDRESS-EXE-X86 + + // CHECK-SANITIZE-ADDRESS-EXE-X86: "-fsanitize=address" +-// CHECK-SANITIZE-ADDRESS-EXE-X86: "{{.*}}clang_rt.asan_dynamic-i686.lib" "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i686.lib" "--undefined" "___asan_seh_interceptor" ++// CHECK-SANITIZE-ADDRESS-EXE-X86: "{{.*}}clang_rt.asan_dynamic-i386.lib" "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i386.lib" "--undefined" "___asan_seh_interceptor" + + // RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -fuse-ld=lld-link2 -shared -o shared.dll -fsanitize=tsan -x c++ %s 2>&1 \ + // RUN: | FileCheck %s --check-prefix CHECK-SANITIZE-TSAN +-- +2.11.0 + diff --git a/sys-devel/clang/files/5.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch b/sys-devel/clang/files/5.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch new file mode 100644 index 000000000000..22f6d5685f33 --- /dev/null +++ b/sys-devel/clang/files/5.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch @@ -0,0 +1,83 @@ +From f3ff810e81c35133f6a7e463d860bcd4ca30be84 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Sun, 19 Feb 2017 12:13:04 +0100 +Subject: [PATCH 2/2] [test] Fix clang library dir in LD_LIBRARY_PATH For + stand-alone build + +Prepend the clang library directory (determined using SHLIBDIR, alike +in clang) to the LD_LIBRARY_PATH to ensure that just-built clang +libraries will be used instead of a previous installed version. + +When a stand-alone build is performed, LLVM_LIBS_DIR contains the path +to installed LLVM library directory. The same directory frequently +contains a previously installed version of clang. SHLIBDIR, on the other +hand, is always the build-tree directory, and therefore contains +the freshly built clang libraries. + +In a non-stand-alone build, both paths will be the same and therefore +including them both will not cause any issues. +--- + test/Unit/lit.cfg | 9 ++++++--- + test/lit.cfg | 5 ++++- + test/lit.site.cfg.in | 1 + + 3 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg +index ff70123c..3a1da187 100644 +--- a/test/Unit/lit.cfg ++++ b/test/Unit/lit.cfg +@@ -41,14 +41,17 @@ elif platform.system() == 'Windows': + shlibpath_var = 'PATH' + + # Point the dynamic loader at dynamic libraries in 'lib'. ++shlibdir = getattr(config, 'shlibdir', None) ++if not shlibdir: ++ lit_config.fatal('No shlibdir set!') + 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((shlibdir, 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)) ++if sys.platform in ['win32', 'cygwin'] and os.path.isdir(shlibdir): ++ shlibpath = os.path.pathsep.join((shlibdir, shlibpath)) + + config.environment[shlibpath_var] = shlibpath +diff --git a/test/lit.cfg b/test/lit.cfg +index bb592936..0e7de849 100644 +--- a/test/lit.cfg ++++ b/test/lit.cfg +@@ -99,10 +99,13 @@ if clang_tools_binary_dir is not None: + clang_tools_dir, llvm_tools_dir, config.environment['PATH'])) + config.environment['PATH'] = path + ++ clang_libs_dir = getattr(config, 'clang_libs_dir', None) ++ if not clang_libs_dir: ++ lit_config.fatal('No Clang libs 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((clang_libs_dir, llvm_libs_dir, + config.environment.get('LD_LIBRARY_PATH',''))) + config.environment['LD_LIBRARY_PATH'] = path + +diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in +index dfd0164c..f310b59a 100644 +--- a/test/lit.site.cfg.in ++++ b/test/lit.site.cfg.in +@@ -7,6 +7,7 @@ config.llvm_libs_dir = "@LLVM_LIBS_DIR@" + config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" + config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@" + config.clang_tools_dir = "@CLANG_TOOLS_DIR@" ++config.clang_libs_dir = "@SHLIBDIR@" + config.python_executable = "@PYTHON_EXECUTABLE@" + config.target_triple = "@TARGET_TRIPLE@" + +-- +2.12.0 + |