<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Aug 3, 2018 at 1:37 AM Ivan Donchevskii <<a href="mailto:ivan.donchevskii@qt.io" target="_blank">ivan.donchevskii@qt.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div id="gmail-m_-4495702918448391807m_-7398561474145650899divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0px;margin-bottom:0px">Hi!<br>
Why do you need to mix C++ symbols with what libclang exports?</p></div></div></blockquote><div><br></div><div>My reasoning was that the C/C++ difference was already imposed by the headers included by a libclang.so user. But I also see why limiting the exported symbols can catch user errors.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div id="gmail-m_-4495702918448391807m_-7398561474145650899divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr"><p style="margin-top:0px;margin-bottom:0px"> Doesn't it make sense to have separate clang.so instead? I also think there's already a possibility to build such library by providing some LLVM flags.</p></div></div></blockquote><div><br></div><div>I think you mean LLVM_ENABLE_SHARED? That builds each individual library (libclangAST, libclangDriver etc) as shared libraries, rather than producing a single shared library. I am not aware of any other option that can help.</div><div><br></div><div>To clarify my proposal, I've uploaded a patch (<a href="https://reviews.llvm.org/D50359">https://reviews.llvm.org/D50359</a>) that adds this new library. The library is named libclang-cxx in that patch - which I think is slightly more informative than libclang-full.</div><div><br></div><div>Please add comments in the patch or to this discussions.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div id="gmail-m_-4495702918448391807m_-7398561474145650899divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">Kind regards,</p>
<p style="margin-top:0px;margin-bottom:0px">Ivan</p>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-4495702918448391807m_-7398561474145650899divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> cfe-dev <<a href="mailto:cfe-dev-bounces@lists.llvm.org" target="_blank">cfe-dev-bounces@lists.llvm.org</a>> on behalf of Pirama Arumuga Nainar via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>><br>
<b>Sent:</b> Thursday, August 2, 2018 11:48:16 PM<br>
<b>To:</b> cfe-dev list<br>
<b>Cc:</b> Tzu-hsiang Chien<br>
<b>Subject:</b> Re: [cfe-dev] libclang shared library that exports all symbols</font>
<div> </div>
</div>
<div>
<div dir="ltr">Ping for any thoughts on this proposal...</div>
<br>
<div class="gmail-m_-4495702918448391807m_-7398561474145650899x_gmail_quote">
<div dir="ltr">On Thu, Jul 26, 2018 at 3:59 PM Pirama Arumuga Nainar <<a href="mailto:pirama@google.com" target="_blank">pirama@google.com</a>> wrote:<br>
</div>
<blockquote class="gmail-m_-4495702918448391807m_-7398561474145650899x_gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">libclang.so exports only the symbols needed by the C API. This is in contrast to libLLVM.so that exports all symbols from the LLVM static libraries. Would it be useful to provide a libclang shared library that exports all symbols for use by
tools that use Clang's (admittedly non-backwards-compatible) C++ API?
<div><br>
</div>
<div>We can either:</div>
<div>1. Add a new shared library (libclang_full.so?) that is built based on a CMake option.</div>
<div>2. Export all symbols from the current libclang.so. We'd have to also include a few additional libraries such as libClangAnalysis. Tools using the C API are still restricted to the stable interface if they use the clang-c headers.</div>
<div><br>
</div>
<div>Motivation:</div>
<div>There are a few Clang-based tools used by Android's build system (1, 2) that use the C++ API. They are built using Android build rules but need to link against Android's Clang toolchain that's built with CMake. We don't want to include the libclang static
libraries with the toolchain for space considerations, and also to avoid exposing Clang's build internals (internal library dependences and changes to them) to downstream tools.</div>
<div><br>
</div>
<div>Do other Clang/LLVM toolchain maintainers face similar issues and have solutions that are applicable here?</div>
<div><br>
</div>
<div>[1] <a href="https://android.googlesource.com/platform/development/+/master/vndk/tools/header-checker/" target="_blank">https://android.googlesource.com/platform/development/+/master/vndk/tools/header-checker/</a></div>
<div>[2] <a href="https://android.googlesource.com/platform/development/+/master/vndk/tools/vtable-dumper/" target="_blank">https://android.googlesource.com/platform/development/+/master/vndk/tools/vtable-dumper/</a></div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote></div></div>