diff options
author | Jim Ingham <jingham@apple.com> | 2019-10-09 20:56:43 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2019-10-09 20:56:43 +0000 |
commit | c0da1282fc036908cc721ee74f574fbb99d5e506 (patch) | |
tree | f217053c624717c6ea023fba47f2f1657b031e45 /lldb/scripts/Python/finishSwigPythonLLDB.py | |
parent | 21b8a8ae27f3a374c55efce5a5637f732eb6595c (diff) | |
download | bcm5719-llvm-c0da1282fc036908cc721ee74f574fbb99d5e506.tar.gz bcm5719-llvm-c0da1282fc036908cc721ee74f574fbb99d5e506.zip |
Revert "[lldb] Calculate relative path for symbol links"
This reverts commit 958091c209d0a92e38b9cb27fb77a0ff7da11853.
This commit incorrectly sets the _lldb.so symlink (at least it does when
building in Stefans' two build directory mode, where you build llvm with
cmake/ninja and lldb with cmake/Xcode, using a cmake generated project.
The _lldb.so link is SUPPOSED to point to:
bin/LLDB.framework/Versions/A/LLDB
but instead it points to
bin/LLDB
which is where LLDB was staged to before constructing the framework. This
causes all sorts of problems when we then build the lldb driver into bin -
remember that MacOS is a case-preserving but case insensitive filesystem -
so when we later go to dlopen _lldb.so, we dlopen the main executable instead.
llvm-svn: 374226
Diffstat (limited to 'lldb/scripts/Python/finishSwigPythonLLDB.py')
-rw-r--r-- | lldb/scripts/Python/finishSwigPythonLLDB.py | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/lldb/scripts/Python/finishSwigPythonLLDB.py b/lldb/scripts/Python/finishSwigPythonLLDB.py index 902ad8af5dd..d12c833a4e4 100644 --- a/lldb/scripts/Python/finishSwigPythonLLDB.py +++ b/lldb/scripts/Python/finishSwigPythonLLDB.py @@ -365,6 +365,7 @@ def make_symlink_native(vDictArgs, strSrc, strTarget): # Throws: None. #-- + def make_symlink( vDictArgs, vstrFrameworkPythonDir, @@ -373,13 +374,27 @@ def make_symlink( dbg = utilsDebug.CDebugFnVerbose("Python script make_symlink()") strTarget = os.path.join(vstrFrameworkPythonDir, vstrTargetFile) strTarget = os.path.normcase(strTarget) - strPrefix = vDictArgs['--prefix'] + strSrc = "" os.chdir(vstrFrameworkPythonDir) + bMakeFileCalled = "-m" in vDictArgs + eOSType = utilsOsType.determine_os_type() + if not bMakeFileCalled: + strBuildDir = os.path.join("..", "..", "..") + else: + # Resolve vstrSrcFile path relatively the build directory + if eOSType == utilsOsType.EnumOsType.Windows: + # On a Windows platform the vstrFrameworkPythonDir looks like: + # llvm\\build\\Lib\\site-packages\\lldb + strBuildDir = os.path.join("..", "..", "..") + else: + # On a UNIX style platform the vstrFrameworkPythonDir looks like: + # llvm/build/lib/python2.7/site-packages/lldb + strBuildDir = os.path.join("..", "..", "..", "..") + strSrc = os.path.normcase(os.path.join(strBuildDir, vstrSrcFile)) + + return make_symlink_native(vDictArgs, strSrc, strTarget) - strSrc = os.path.normcase(os.path.join(strPrefix, vstrSrcFile)) - strRelSrc = os.path.relpath(strSrc, os.path.dirname(strTarget)) - return make_symlink_native(vDictArgs, strRelSrc, strTarget) #++--------------------------------------------------------------------------- # Details: Make the symbolic that the script bridge for Python will need in |