On Wed, Jun 6, 2012 at 6:25 PM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div class="h5"><br><div><div>On Jun 5, 2012, at 23:24 , Manuel Klimek <<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>> wrote:</div><br><blockquote type="cite">
On Tue, Jun 5, 2012 at 4:56 PM, Erik Verbruggen <span dir="ltr"><<a href="mailto:erikjv@me.com" target="_blank">erikjv@me.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word"><div><div><br><div><div>On Jun 4, 2012, at 15:32, Manuel Klimek wrote:</div><br><blockquote type="cite"><div class="gmail_quote">On Fri, Jun 1, 2012 at 1:10 PM, Erik Verbruggen <span dir="ltr"><<a href="mailto:erikjv@me.com" target="_blank">erikjv@me.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br>
On May 24, 2012, at 19:07, Manuel Klimek wrote:<br>
<br>
> Author: klimek<br>
> Date: Thu May 24 12:07:18 2012<br>
> New Revision: 157396<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=157396&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=157396&view=rev</a><br>
> Log:<br>
> Adds a tutorial for how to write clang plugins.<br>
<br>
</div>Sorry for the late reply, but it would be really nice if you could add a paragraph which mentions the libraries used for linking (for all those people who want (have?) to use esoteric build systems)...<br></blockquote>


<div><br></div><div>Hm, since this is a dynamic library, doesn't it basically not require linking anything in at compile time, but the right symbols to be available in the clang executable at runtime? Or did you have something else in mind?</div>


</div></blockquote><br></div></div></div><div>I link with:</div><div><br></div><div><div style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><div style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">

<span>clang++ -headerpad_max_install_names -arch x86_64 -o qt-checker main.o     -L/data/clang-llvm/llvm-3.1-install/lib -lpthread -lm -lLLVMCore -lLLVMSupport -lclangTooling -lclangAST -lclangFrontend -lclangSerialization -lclangSema -lclangAnalysis -lclangBasic -lclangEdit -lclangLex -lclangParse -Wl,-undefined,dynamic_lookup -L../checkers -lcheckers </span></div>

<div style="margin-right:0px;text-indent:0px;margin-left:0px;margin-bottom:0px;margin-top:0px"><br></div></div><div style="margin-right:0px;text-indent:0px;margin-left:0px;margin-bottom:0px;margin-top:0px">I get:</div><div style="margin-right:0px;text-indent:0px;margin-left:0px;margin-bottom:0px;margin-top:0px">

<br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> dyld: lazy symbol binding failed: Symbol not found: __ZN5clang6driver6DriverC1EN4llvm9StringRefES3_S3_bRNS_17DiagnosticsEngineE<br>

  Referenced from: /data/git/qtcheckers/app/qt-checker<br>  Expected in: dynamic lookup<br><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Etc. For clang plug-ins it works, but apparently not for tooling executables...</div>

</div></div></blockquote><div><br></div><div>Ah, but then ClangPlugins.html seems the wrong place. Also, since clang is pretty nicely modularized here, the process seems to be: look into the Makefiles or CMakeLists.txt for the libraries you use, build the transitive closure, and link that in? Not sure there's a better way to document this, as those dependencies change...</div>

<div><br></div><div>Cheers,</div><div>/Manuel</div></div></blockquote><br></div></div></div><div>FWIW CMake seems to do the transitive closure part for you, but gmake won't. And I'd also be in favor of adding the current requirements for linking against Tooling, at least, to LibTooling.html, with a caveat saying that it might not be up-to-date. This would also be useful for people who want to build clang-based tools outside of the clang source tree.</div>
</div></blockquote><div><br></div><div>All right: r158088.</div><div><br></div><div>Cheers,</div><div>/Manuel</div></div>