<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 11, 2014 at 9:38 PM, Shankar Easwaran <span dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">One source of confusion is libstdc++ owns the API __cxa_demangle, when the demangle code is moved from libc++ to llvm, does libc++ link with libSupport ?<br></blockquote><div><br></div><div>libSupport would have nothing to do with the __cxa_demangle symbol. It would be llvm::demangle (and probably have a different signature, e.g. StringRef).</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
libc++ needs to continue to own the demangle API too, IMO.<span class="HOEnZb"><font color="#888888"><br>
<br>
Shankar Easwaran</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On 12/11/2014 6:24 PM, Sean Silva wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The simplest long-term solution would probably be to just add demangling in<br>
a portable way to libSupport. Then we don't need to conditionalize or<br>
anything. We just call llvm::demangle(). This is the only viable solution<br>
for proper cross-linking anyway.<br>
<br>
Given that there should be existing demanglers we can reuse, I'm not sure<br>
that this long term solution is significantly more difficult than the short<br>
term solution you are proposing.<br>
<br>
-- Sean Silva<br>
<br>
On Tue, Apr 1, 2014 at 9:19 PM, Shankar Easwaran <<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>><br>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Nick, Bigcheese,<br>
<br>
When lld is used to link C++ code, it would be required to demangle symbol<br>
names by default/user driven option.<br>
<br>
The Gnu linker has the following options :-<br>
<br>
--demangle=[style]<br>
--no-demangle<br>
<br>
I found that clang/llvm-symbolizer use __cxx_demangle function.<br>
<br>
I would think that lld also need to call the same function, and I think<br>
the way we want to demangle is to have the function in LinkingContext as<br>
various flavors may choose to use different API's to demangle symbol names.<br>
<br>
The API's that would be in LinkingContext would be :-<br>
<br>
         * virtual bool canDemangle()  = 0; // Does the flavor provide a<br>
way to demangle symbol names ?<br>
         * virtual std::string demangle(StringRef symbolName) = 0; //<br>
demangle the symbol name<br>
<br>
Thoughts / Suggestions ?<br>
<br>
Thanks<br>
<br>
Shankar Easwaran<br>
<br>
--<br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted<br>
by the Linux Foundation<br>
<br>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
<br>
</blockquote></blockquote>
<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation<br>
<br>
</div></div></blockquote></div></div></div>