[all-commits] [llvm/llvm-project] ce4d15: [lldb] Symlink the Clang resource directory to the...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Tue Oct 6 00:29:15 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ce4d15fe142eb0e0ed7c998a73b13e7bee45d99e
      https://github.com/llvm/llvm-project/commit/ce4d15fe142eb0e0ed7c998a73b13e7bee45d99e
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2020-10-06 (Tue, 06 Oct 2020)

  Changed paths:
    M lldb/cmake/modules/LLDBConfig.cmake
    M lldb/cmake/modules/LLDBFramework.cmake
    M lldb/source/API/CMakeLists.txt

  Log Message:
  -----------
  [lldb] Symlink the Clang resource directory to the LLDB build directory in standalone builds

When doing a standalone build (i.e., building just LLDB against an existing
LLVM/Clang installation), LLDB is currently unable to find any Clang resource
directory that contains all the builtin headers we need to parse real source
code. This causes several tests that actually parse source code on disk within
the expression parser to fail (most notably nearly all the import-std-module
tests).

The reason why LLDB can't find the resource directory is that we search based on
the path of the LLDB shared library path. We assumed that the Clang resource
directory is in the same prefix and has the same relative path to the LLDB
shared library (e.g., `../clang/10.0.0/include`). However for a standalone build
where the existing Clang can be anywhere on the disk, so we can't just rely on
the hardcoded relative paths to the LLDB shared library.

It seems we can either solve this by copying the resource directory to the LLDB
installation, symlinking it there or we pass the path to the Clang installation
to the code that is trying to find the resource directory. When building the
LLDB framework we currently copy the resource directory over to the framework
folder (this is why the import-std-module are not failing on the Green Dragon
standalone bot).

This patch symlinks the resource directory of Clang into the LLDB build
directory. The reason for that is simply that this is only needed when running
LLDB from the build directory. Once LLDB and Clang/LLVM are installed the
already existing logic can find the Clang resource directory by searching
relative to the LLDB shared library.

Reviewed By: kastiglione, JDevlieghere

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




More information about the All-commits mailing list