Revert "[lldb] Calculate relative path for symbol links"

This reverts commit 958091c209.

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
This commit is contained in:
Jim Ingham 2019-10-09 20:56:43 +00:00
parent 21b8a8ae27
commit c0da1282fc
1 changed files with 19 additions and 4 deletions

View File

@ -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