[all-commits] [llvm/llvm-project] bbfebd: [CMake] Add $ORIGIN/../../../../lib to rpath if BU...
Fangrui Song via All-commits
all-commits at lists.llvm.org
Mon Jan 6 10:02:01 PST 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: bbfebd7b8a671c9649305b8a5f72e93dd1ef60e1
https://github.com/llvm/llvm-project/commit/bbfebd7b8a671c9649305b8a5f72e93dd1ef60e1
Author: Fangrui Song <maskray at google.com>
Date: 2020-01-06 (Mon, 06 Jan 2020)
Changed paths:
M lldb/source/API/CMakeLists.txt
Log Message:
-----------
[CMake] Add $ORIGIN/../../../../lib to rpath if BUILD_SHARED_LIBS or LLVM_LINK_LLVM_DYLIB on *nix
Summary:
lib/python2.7/dist-packages/lldb/_lldb.so is a symlink to lib/liblldb.so,
which depends on lib/libLLVM*.so (-DBUILD_SHARED_LIBS=ON) or lib/libLLVM-10git.so
(-DLLVM_LINK_LLVM_DYLIB=ON). Add an additional rpath `$ORIGIN/../../../../lib` so
that _lldb.so can be loaded from Python.
This fixes an import error from lib/python2.7/dist-packages/lldb/__init__.py
from . import _lldb
ImportError: libLLVMAArch64CodeGen.so.10git: cannot open shared object file: No such file or directory
The following configurations will work:
* -DBUILD_SHARED_LIBS=ON
* -DBUILD_SHARED_LIBS=OFF -DLLVM_LINK_LLVM_DYLIB=ON
* -DBUILD_SHARED_LIBS=OFF -DLLVM_LINK_LLVM_DYLIB=ON -DCLANG_LINK_CLANG_DYLIB=ON
(-DCLANG_LINK_CLANG_DYLIB=ON depends on -DLLVM_LINK_LLVM_DYLIB=ON)
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D71800
More information about the All-commits
mailing list