<div dir="ltr">BTW, I did an in-place upgrade on my laptop from OSX 10.9.5 to 10.10.3 and this problem disappeared (same exact binaries.)<div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 19, 2015 at 10:13 AM, Ying Chen <span dir="ltr"><<a href="mailto:chying@google.com" target="_blank">chying@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Vince,<div><br></div><div>OSX builder has vanilla image 10.9.5.</div><div><br></div><div>Thanks,</div><div>Ying</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 18, 2015 at 10:27 PM, Vince Harron <span dir="ltr"><<a href="mailto:vince@nethacker.com" target="_blank">vince@nethacker.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Ying,</div><div><br></div><div>Is the OSX builder a Google image or a vanilla OSX image?</div><div><br></div><div>Hi Greg,</div><div><br></div><div>vharron-macbookpro:Debug vharron$ ls -lAF ./LLDB.framework/LLDB</div><div>lrwxr-xr-x 1 vharron eng 21 May 16 09:28 ./LLDB.framework/LLDB@ -> Versions/Current/LLDB</div><div>vharron-macbookpro:Debug vharron$ ls -lAF ./LLDB.framework/Versions/Current/LLDB</div><div>-rwxr-xr-x 1 vharron eng 73051980 May 18 21:06 ./LLDB.framework/Versions/Current/LLDB*</div><div>vharron-macbookpro:Debug vharron$ ./lldb</div><div>(lldb) quit</div><div>vharron-macbookpro:Debug vharron$ cd ..</div><div>vharron-macbookpro:build vharron$ Debug/lldb</div><div>(lldb) quit</div><div>vharron-macbookpro:build vharron$ echo $DYLD_FRAMEWORK_PATH </div><div>/Users/vharron/ll/tot/lldb/build/Debug</div><div>vharron-macbookpro:build vharron$ unset DYLD_FRAMEWORK_PATH</div><div>vharron-macbookpro:build vharron$ Debug/lldb</div><span><div>dyld: Library not loaded: @rpath/LLDB.framework/LLDB</div></span><div> Referenced from: /Users/vharron/ll/tot/lldb/build/Debug/lldb</div><span><div> Reason: image not found</div><div>Trace/BPT trap: 5</div><div><br></div></span><div><div>I'm going to try to reproduce this on a VM with a vanilla OSX build tomorrow.</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 12, 2015 at 1:24 PM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That should work. Can you verify that you have a "./LLDB.framework/LLDB" in the same directory as the "lldb" binary?<br>
<br>
This should be a symlink:<br>
<br>
% ls -lAF ./LLDB.framework/LLDB<br>
lrwxr-xr-x 1 gclayton apple_sw 21 May 1 14:44 ./LLDB.framework/LLDB@ -> Versions/Current/LLDB<br>
% ls -lAF ./LLDB.framework/Versions/Current/LLDB<br>
-rwxr-xr-x 1 gclayton apple_sw 72865260 May 7 11:44 ./LLDB.framework/Versions/Current/LLDB*<br>
<br>
Make sure the symlink is there and that it is correct?<br>
<span><font color="#888888"><br>
Greg<br>
</font></span><div><div><br>
> On May 12, 2015, at 12:13 PM, Vince Harron <<a href="mailto:vince@nethacker.com" target="_blank">vince@nethacker.com</a>> wrote:<br>
><br>
> Hi Greg,<br>
><br>
> Thanks for your email. Following those instructions exactly, I'm still getting the same error:<br>
> (10.9.5 XCode 6.2)<br>
><br>
> git clone <a href="http://llvm.org/git/lldb.git" target="_blank">http://llvm.org/git/lldb.git</a><br>
> cd lldb<span><br>
> xcodebuild -configuration Debug -target desktop<br>
><br></span>
> vharron-macpro3:fresh vharron$ lldb/build/Debug/lldb<span><br>
> dyld: Library not loaded: @rpath/LLDB.framework/LLDB<br></span>
> Referenced from: /Users/vharron/ll/fresh/lldb/build/Debug/lldb<span><br>
> Reason: image not found<br>
> Trace/BPT trap: 5<br>
><br></span>
> vharron-macpro3:fresh vharron$ export DYLD_FRAMEWORK_PATH=/Users/vharron/ll/fresh/lldb/build/Debug<br>
> vharron-macpro3:fresh vharron$ lldb/build/Debug/lldb<br>
> (lldb) quit<br>
><br>
> vharron-macpro3:Debug vharron$ otool -lv lldb | grep -A3 LC_RPATH<span><br>
> cmd LC_RPATH<br>
> cmdsize 32<br>
> path @loader_path (offset 12)<br></span>
> Load command 18<br>
> vharron-macpro3:Debug vharron$ otool -lv lldb | grep -A5 LC_LOAD_DYLIB<span><br>
> ...<br>
><br>
> cmd LC_LOAD_DYLIB<br>
> cmdsize 56<br>
> name @rpath/LLDB.framework/LLDB (offset 24)<br>
> time stamp 2 Wed Dec 31 16:00:02 1969<br>
> current version 340.99.0<br>
> compatibility version 1.0.0<br></span>
> ...<span><br>
><br>
> > So it should load the LLDB framework from the current directory that the "lldb" tool is built in.<br>
><br></span>
> That is my understanding but I haven't moved anything anywhere. I'm trying to use them in the output location.<div><div><br>
><br>
><br>
><br>
> On Tue, May 12, 2015 at 10:52 AM, Greg Clayton <<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>> wrote:<br>
> All you need to do to build LLDB with Xcode is:<br>
><br>
><br>
> % git clone <a href="http://llvm.org/git/lldb.git" target="_blank">http://llvm.org/git/lldb.git</a><br>
> % cd lldb<br>
> % xcodebuild -configuration Debug -target desktop<br>
><br>
><br>
> The Xcode build will checkout llvm and clang for you in the right spot and with the right llvm/clang repository versions. Some repos are locked down to certain versions of llvm and clang and it is best to let the build scripts do everything for you.<br>
><br>
> You don't need to set any DYLD_FRAMEWORK_PATH or anything. The "Debug" and "Release" configurations will build the "lldb" command line tool with an rpath that looks in the same directory as the "lldb" command line tool itself:<br>
><br>
> % cd build/Debug<br>
> % otool -lv lldb | grep -A3 LC_RPATH<br>
> cmd LC_RPATH<br>
> cmdsize 32<br>
> path @loader_path (offset 12)<br>
><br>
> The "lldb" tool states it needs LLDB that is relative to the path:<br>
><br>
> % otool -lv lldb | grep -A5 LC_LOAD_DYLIB<br>
> ...<br>
> cmd LC_LOAD_DYLIB<br>
> cmdsize 56<br>
> name @rpath/LLDB.framework/LLDB (offset 24)<br>
> time stamp 2 Wed Dec 31 16:00:02 1969<br>
> current version 340.99.0<br>
> compatibility version 1.0.0<br>
><br>
><br>
> So it should load the LLDB framework from the current directory that the "lldb" tool is built in. This means you can't move the "lldb" tool to /usr/bin and move the "LLDB.framework" to /System/Library/Frameworks because the rpath isn't set correctly for that. If you look at the Xcode version of lldb we see if it setup differently:<br>
><br>
> % otool -lv `xcrun -find lldb` | grep -A3 LC_RPATH<br>
> cmd LC_RPATH<br>
> cmdsize 64<br>
> path @loader_path/../../Library/PrivateFrameworks (offset 12)<br>
> Load command 18<br>
> cmd LC_RPATH<br>
> cmdsize 56<br>
> path @loader_path/../../../SharedFrameworks (offset 12)<br>
> Load command 19<br>
> cmd LC_RPATH<br>
> cmdsize 64<br>
> path @loader_path/../../System/Library/PrivateFrameworks (offset 12)<br>
> Load command 20<br>
> cmd LC_RPATH<br>
> cmdsize 64<br>
> path @loader_path/../../Library/PrivateFrameworks (offset 12)<br>
> Load command 21<br>
><br>
><br>
> @loader_path is the current directory that contains the "lldb" executable.<br>
><br>
> Greg<br>
><br>
><br>
> > On May 9, 2015, at 11:44 PM, Vince Harron <<a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a>> wrote:<br>
> ><br>
> > I forgot to "export" DYLD_FRAMEWORK_PATH *blush*<br>
> ><br>
> > But still, this should be fixed in the documentation or in the build. Which should it be?<br>
> ><br>
> > One step repro:<br>
> ><br>
> > #!/bin/bash -ex<br>
> ><br>
> > ROOT_DIR=$HOME/ll/fresh<br>
> > LLDB_CONFIG=Debug<br>
> > LLDB_BIN=$ROOT_DIR/lldb/DerivedData/lldb/Build/Products/$LLDB_CONFIG<br>
> ><br>
> > mkdir -p $ROOT_DIR<br>
> > cd $ROOT_DIR<br>
> > git clone <a href="http://llvm.org/git/lldb.git" target="_blank">http://llvm.org/git/lldb.git</a> &<br>
> > git clone <a href="http://llvm.org/git/llvm.git" target="_blank">http://llvm.org/git/llvm.git</a> &<br>
> > git clone <a href="http://llvm.org/git/clang.git" target="_blank">http://llvm.org/git/clang.git</a> &<br>
> > wait<br>
> ><br>
> > mv clang llvm/tools/clang<br>
> > mv llvm lldb<br>
> ><br>
> > XCBUILD="xcodebuild -scheme lldb-tool -workspace $ROOT_DIR/lldb/lldb.xcworkspace -configuration $LLDB_CONFIG build"<br>
> > # first clean build always fails but second one will succeed!<br>
> > $XCBUILD || $XCBUILD<br>
> ><br>
> > unset DYLD_FRAMEWORK_PATH<br>
> ><br>
> > # launch it<br>
> > $LLDB_BIN/lldb<br>
> ><br>
> ><br>
> > On Sat, May 9, 2015 at 5:17 PM, Vince Harron <<a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a>> wrote:<br>
> > Xcode 6.1.1 on OSX 10.9.5<br>
> ><br>
> ><br>
> > On Sat, May 9, 2015 at 5:12 PM, Vince Harron <<a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a>> wrote:<br>
> > Hi Greg,<br>
> ><br>
> > This is still a problem for me. I just did a clean checkout and build. I'm unable to run lldb. This makes it very difficult to test my changes on OSX. =)<br>
> ><br>
> > REPRO STEPS:<br>
> > vharron-macpro3:ll vharron$ mkdir fresh<br>
> > vharron-macpro3:ll vharron$ cd fresh<br>
> > vharron-macpro3:fresh vharron$ git clone <a href="http://llvm.org/git/lldb.git" target="_blank">http://llvm.org/git/lldb.git</a><br>
> > Cloning into 'lldb'...<br>
> > remote: Counting objects: 120337, done.<br>
> > remote: Compressing objects: 100% <a href="tel:%2836468%2F36468" value="+13646836468" target="_blank">(36468/36468</a>), done.<br>
> > remote: Total 120337 (delta 92692), reused 107965 (delta 82116)<br>
> > Receiving objects: 100% (120337/120337), 30.90 MiB | 6.67 MiB/s, done.<br>
> > Resolving deltas: 100% (92692/92692), done.<br>
> > Checking connectivity... done.<br>
> > vharron-macpro3:fresh vharron$ git clone <a href="http://llvm.org/git/lldb.git" target="_blank">http://llvm.org/git/lldb.git</a><br>
> ><br>
> > Open ~/ll/fresh/lldb/lldb.xcworkspace<br>
> > Select lldb-tool<br>
> > Select Build<br>
> > (wait for build to complete successfully)<br>
> ><br>
> > vharron-macpro3:Debug vharron$ pwd<br>
> > /Users/vharron/ll/fresh/lldb/DerivedData/lldb/Build/Products/Debug<br>
> > vharron-macpro3:Debug vharron$ history|less<br>
> > vharron-macpro3:Debug vharron$ otool -lv lldb | grep -A2 LC_RPATH<br>
> > cmd LC_RPATH<br>
> > cmdsize 32<br>
> > path @loader_path (offset 12)<br>
> > vharron-macpro3:Debug vharron$ ./lldb<br>
> > dyld: Library not loaded: @rpath/LLDB.framework/LLDB<br>
> > Referenced from: /Users/vharron/ll/fresh/lldb/DerivedData/lldb/Build/Products/Debug/./lldb<br>
> > Reason: image not found<br>
> > Trace/BPT trap: 5<br>
> > vharron-macpro3:Debug vharron$ echo $DYLD_FRAMEWORK_PATH<br>
> > /Users/vharron/ll/fresh/lldb/DerivedData/lldb/Build/Products/Debug<br>
> > vharron-macpro3:Debug vharron$ ls -l LLDB.framework/LLDB<br>
> > lrwxr-xr-x 1 vharron eng 21 May 8 22:04 LLDB.framework/LLDB -> Versions/Current/LLDB<br>
> > vharron-macpro3:Debug vharron$ ls -l LLDB.framework/Versions/Current/LLDB<br>
> > -rwxr-xr-x 1 vharron eng 72990060 May 8 22:04 LLDB.framework/Versions/Current/LLDB<br>
> > vharron-macpro3:Debug vharron$ ls -l<br>
> > total 873336<br>
> > drwxr-xr-x 6 vharron eng 204 May 9 15:55 LLDB.framework<br>
> > -rw-r--r-- 1 vharron eng 2806473 May 8 22:04 LLDBWrapPython.cpp<br>
> > -rwxr-xr-x 1 vharron eng 43807600 May 8 22:04 argdumper<br>
> > -rwxr-xr-x 1 vharron eng 49332 May 8 22:04 darwin-debug<br>
> > -rwxr-xr-x 1 vharron eng 5595984 May 9 15:55 debugserver<br>
> > -rw-r--r-- 1 vharron eng 353044136 May 8 22:04 liblldb-core.a<br>
> > -rwxr-xr-x 1 vharron eng 147776 May 9 15:55 lldb<br>
> > -rwxr-xr-x 1 vharron eng 41134240 May 9 15:55 lldb-server<br>
> > -rw-r--r-- 1 vharron eng 538509 May 8 22:04 lldb.py<br>
> > vharron-macpro3:Debug vharron$<br>
> ><br>
> ><br>
> > On Wed, Feb 11, 2015 at 4:13 PM, Oleksiy Vyalov <<a href="mailto:ovyalov@google.com" target="_blank">ovyalov@google.com</a>> wrote:<br>
> > It happens to me from time to time but I don't know exactly why - as a workaround, set DYLD_FRAMEWORK_PATH to your output build directory, e.g. export DYLD_FRAMEWORK_PATH=/Users/ovyalov/google/lldb/git/lldb/DerivedData/lldb/Build/Products/Debug<br>
> ><br>
> > On Wed, Feb 11, 2015 at 3:32 PM, Ryan Brown <<a href="mailto:ribrdb@google.com" target="_blank">ribrdb@google.com</a>> wrote:<br>
> > Did you ever figure this out? I'm getting the same thing after updating my lldb sources and rebuilding:<br>
> ><br>
> > $ /Users/ribrdb/Documents/git/lldb/DerivedData/lldb/Build/Products/Debug/lldb<br>
> > dyld: Library not loaded: @rpath/LLDB.framework/LLDB<br>
> > Referenced from: /Users/ribrdb/Documents/git/lldb/DerivedData/lldb/Build/Products/Debug/lldb<br>
> > Reason: image not found<br>
> > Trace/BPT trap: 5<br>
> > $ otool -lv /Users/ribrdb/Documents/git/lldb/DerivedData/lldb/Build/Products/Debug/lldb|grep -A2 LC_RPATH<br>
> > cmd LC_RPATH<br>
> > cmdsize 32<br>
> > path @loader_path (offset 12)<br>
> > $ file /Users/ribrdb/Documents/git/lldb/DerivedData/lldb/Build/Products/Debug/LLDB.framework/LLDB<br>
> > /Users/ribrdb/Documents/git/lldb/DerivedData/lldb/Build/Products/Debug/LLDB.framework/LLDB: Mach-O 64-bit dynamically linked shared library x86_64<br>
> ><br>
> ><br>
> > On Mon Feb 02 2015 at 11:38:32 AM Greg Clayton <<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>> wrote:<br>
> > 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.<br>
> ><br>
> > To find out where the "lldb" binary will search for its @rpath binaries you can type:<br>
> ><br>
> > % otool -lv lldb | grep -A2 LC_RPATH<br>
> > cmd LC_RPATH<br>
> > cmdsize 32<br>
> > path @loader_path (offset 12)<br>
> ><br>
> > We see the path for a "Debug" configuration is to look in the current directory (@loader_path). If you look at the installed lldb:<br>
> ><br>
> > % otool -lv `xcrun -find lldb` | grep -A2 LC_RPATH | grep path<br>
> > path @loader_path/../../Library/PrivateFrameworks (offset 12)<br>
> > path @loader_path/../../../SharedFrameworks (offset 12)<br>
> > path @loader_path/../../System/Library/PrivateFrameworks (offset 12)<br>
> > path @loader_path/../../Library/PrivateFrameworks (offset 12)<br>
> ><br>
> > 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.<br>
> ><br>
> > Greg<br>
> ><br>
> ><br>
> > > On Feb 2, 2015, at 9:29 AM, Oleksiy Vyalov <<a href="mailto:ovyalov@google.com" target="_blank">ovyalov@google.com</a>> wrote:<br>
> > ><br>
> > > Hello,<br>
> > ><br>
> > > I'm facing some weird problems while trying to run lldb on OSX (10.9.5)<br>
> > > It was okay up until recently but now lldb is complaining about not found dependencies:<br>
> > ><br>
> > > ovyalov-macpro2:Debug ovyalov$ ./lldb<br>
> > > dyld: Library not loaded: @rpath/LLDB.framework/LLDB<br>
> > > Referenced from: /Users/ovyalov/google/lldb/git/lldb/DerivedData/lldb/Build/Products/Debug/./lldb<br>
> > > Reason: image not found<br>
> > > Trace/BPT trap: 5<br>
> > ><br>
> > > 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.<br>
> > > However, if I set "Linking/Runpath search paths" option as ..../DerivedData/lldb/Build/Products/Debug then lldb is running without issues.<br>
> > ><br>
> > > Please advise what might be wrong here.<br>
> > > Thank you in advance.<br>
> > ><br>
> > ><br>
> > > --<br>
> > > Oleksiy Vyalov | Software Engineer | <a href="mailto:ovyalov@google.com" target="_blank">ovyalov@google.com</a><br>
> > > _______________________________________________<br>
> > > lldb-dev mailing list<br>
> > > <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
> > > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > lldb-dev mailing list<br>
> > <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > Oleksiy Vyalov | Software Engineer | <a href="mailto:ovyalov@google.com" target="_blank">ovyalov@google.com</a><br>
> ><br>
> > _______________________________________________<br>
> > lldb-dev mailing list<br>
> > <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> ><br>
> > Vince Harron | Technical Lead Manager | <a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a> | <a href="tel:858-442-0868" value="+18584420868" target="_blank">858-442-0868</a><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> ><br>
> > Vince Harron | Technical Lead Manager | <a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a> | <a href="tel:858-442-0868" value="+18584420868" target="_blank">858-442-0868</a><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> ><br>
> > Vince Harron | Technical Lead Manager | <a href="mailto:vharron@google.com" target="_blank">vharron@google.com</a> | <a href="tel:858-442-0868" value="+18584420868" target="_blank">858-442-0868</a><br>
> ><br>
> > _______________________________________________<br>
> > lldb-dev mailing list<br>
> > <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
><br>
><br>
> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
><br>
<br>
</div></div></div></div></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>