[lldb-dev] lldb is failing to start on OSX

Greg Clayton gclayton at apple.com
Mon Feb 2 11:25:35 PST 2015


As long as you don't build the BuildAndIntegration build you should be good. Build the "Debug" or "Release" configurations and you should be good.

To find out where the "lldb" binary will search for its @rpath binaries you can type:

% otool -lv lldb | grep -A2 LC_RPATH
          cmd LC_RPATH
      cmdsize 32
         path @loader_path (offset 12)

We see the path for a "Debug" configuration is to look in the current directory (@loader_path). If you look at the installed lldb:

% otool -lv `xcrun -find lldb` | grep -A2 LC_RPATH | grep path
         path @loader_path/../../Library/PrivateFrameworks (offset 12)
         path @loader_path/../../../SharedFrameworks (offset 12)
         path @loader_path/../../System/Library/PrivateFrameworks (offset 12)
         path @loader_path/../../Library/PrivateFrameworks (offset 12)

You can see it will look relative to the lldb binary (@loader_path) in a variety of different directories. This is how the BuildAndIntegration version is setup because you would install LLDB in a "bin" folder somewhere (like "/Applications/Xcode.app/Contents/Developer/usr/bin") and it will look for LLDB.framework and any other @rpath binaries using the paths mentioned in the LC_RPATH load commands of the executable.

Greg


> On Feb 2, 2015, at 9:29 AM, Oleksiy Vyalov <ovyalov at google.com> wrote:
> 
> Hello,
> 
> I'm facing some weird problems while trying to run lldb on OSX (10.9.5)
> It was okay up until recently but now lldb is complaining about not found dependencies:
> 
> ovyalov-macpro2:Debug ovyalov$ ./lldb
> dyld: Library not loaded: @rpath/LLDB.framework/LLDB
>   Referenced from: /Users/ovyalov/google/lldb/git/lldb/DerivedData/lldb/Build/Products/Debug/./lldb
>   Reason: image not found
> Trace/BPT trap: 5
> 
> I'm running lldb binary from DerivedData/lldb/Build/Products/Debug directory. It started to fail for me yesterday and I'm wondering whether it's XCode or MacOS SDK updates.
> However, if I set "Linking/Runpath search paths" option as ..../DerivedData/lldb/Build/Products/Debug then lldb is running without issues.
> 
> Please advise what might be wrong here.
> Thank you in advance. 
> 
> 
> -- 
> Oleksiy Vyalov | Software Engineer | ovyalov at google.com
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev





More information about the lldb-dev mailing list