<p dir="ltr">On 29 Nov 2014 09:35, "David Blaikie" <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> On Sat, Nov 29, 2014 at 8:08 AM, Rodney M. Bates <<a href="mailto:rodney_bates@lcwb.coop">rodney_bates@lcwb.coop</a>> wrote:<br>
>><br>
>> I am working on a project that entails writing calls in Modula3 code to C<br>
>> and C++ code in the llvm infrastructure.  For C, things are fine.  For C++,<br>
>> they are working, but I am having to put the mangled linker name in my binding.<br>
>><br>
>> My questions are<br>
>><br>
>> 1) Does the mangled linker name of a C++ nonmember function depend only on the<br>
>>    function signature?<br>
><br>
><br>
> Yes (mangling is there to support overloading and namespaces - since the underlying symbol system doesn't support either, mangling is the task of putting all the unique data about a function into the (mangled) name)<br>
>  <br>
>><br>
>><br>
>> 2) Do gcc and clang both mangle the same?<br>
><br>
><br>
> Yes - this is necessary for C++ libraries compiled with Clang to link successfully with C++ libraries compiled with GCC.</p>
<p dir="ltr">The mangling scheme used for most platforms (used by all gcc-supported platforms IIUC, but notably not used by MSVC) is documented here: <a href="https://mentorembedded.github.io/cxx-abi/abi.html#mangling">https://mentorembedded.github.io/cxx-abi/abi.html#mangling</a></p>
<p dir="ltr">> (modulo bugs, edge cases, etc)<br>
>  <br>
>><br>
>><br>
>> If not, then I will probably need to do more work to produce C bindings<br>
>> similar to those in llvm-c/Core.h<br>
>><br>
>> -- <br>
>> Rodney Bates<br>
>> <a href="mailto:rodney.m.bates@acm.org">rodney.m.bates@acm.org</a><br>
>> _______________________________________________<br>
>> cfe-dev mailing list<br>
>> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
><br>
</p>