<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Right. On a Mac there's a heavy-handed way to do this ("-undefined dyamic_lookup") and a lighter way ("-bundle_loader path/to/clang"). According to  the flag on Linux might be --allow-shlib-undefined or --unresolved-symbols=ignore-in-object-files; I don't know if there's an equivalent to -bundle_loader.</div><div><br></div><div>Jordan</div><div><br></div><br><div><div>On Sep 3, 2013, at 8:50 , Gábor Kozár <<a href="mailto:kozargabor@gmail.com">kozargabor@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">


<title></title>

<div><div>Thanks Laszlo, you make good points, I'll investigate.</div>
<div> </div>
<div id="sig19426269"><div class="signature">-- <br></div>
<div class="signature">  Gábor Kozár<br></div>
<div class="signature">  <a href="mailto:kozargabor@gmail.com">kozargabor@gmail.com</a><br></div>
<div class="signature"> </div>
</div>
<div> </div>
<div> </div>
<div>On Tue, Sep 3, 2013, at 16:52, Laszlo Nagy wrote:<br></div>
<blockquote type="cite"><div>Hi Gabor,<br></div>
<div> </div>
<blockquote><blockquote><div>#1 you should not link any Clang<br></div>
<div>library against when you make your plugin<br></div>
</blockquote><div> </div>
<div>How do I not link against any Clang library when I'm writing a Clang plugin?<br></div>
<div>I need to use Clang's classes extensively.<br></div>
</blockquote><div> </div>
<div>Sound weird, but works just fine. Your plugin will be loaded by the<br></div>
<div>Clang binary, and it already loaded the needed symbols. That's why you<br></div>
<div>don't need to explicitly link against them... You can look at<br></div>
<div><a href="https://github.com/rizsotto/Constantine">https://github.com/rizsotto/Constantine</a> for cmake example.<br></div>
<div> </div>
<blockquote><div>In the meanwhile, I realize that I have done it all with the assumption that<br></div>
<div>GCC 4.7.2 and Clang 3.3 generate compatible binaries. Could this be the<br></div>
<div>source of the issue? I'll try self-hosting Clang 3.3 and see what happens<br></div>
<div>then.<br></div>
</blockquote><div> </div>
<div>I do compile my plugin with GCC and Clang is able to load it without<br></div>
<div>problem.<br></div>
<div> </div>
<div>My two cents are still on the llvm::cl classes. Although you are not<br></div>
<div>using them, but the libraries that you are link against might. (That's<br></div>
<div>why I was suggest not to do that.) And not to mention the fact, that<br></div>
<div>the messages are emitted by the CommandLine.cpp:144. See also:<br></div>
<div> </div>
<div>  <a href="http://comments.gmane.org/gmane.comp.compilers.clang.devel/6870">http://comments.gmane.org/gmane.comp.compilers.clang.devel/6870</a><br></div>
<div>  <a href="http://comments.gmane.org/gmane.comp.compilers.clang.scm/63478">http://comments.gmane.org/gmane.comp.compilers.clang.scm/63478</a><br></div>
<div> </div>
<div>Regards,<br></div>
<div>Laszlo<br></div>
</blockquote></div>

_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></body></html>