[LLVMdev] Switching to the new MingW ABI

João Matos ripzonetriton at gmail.com
Tue Dec 10 08:18:30 PST 2013


The tool uses Clang to parse the user's C/C++ code to get the calling
conventions from the AST, so they need to match the ones in the compiled
libraries to allow correct interop. If the user libraries were compiled
with GCC 4.6 (which stills seems used by some MinGW distros) then once we
upgrade to the latest Clang we'll start getting thiscall CC instead of the
correct one used pre-4.7 for those libraries. If there was something like
an "-fgcc-abi=4.6" flag we could pass to Clang, then it would provide us
with the correct CCs for the given GCC version.

If the community thinks that is undesirable for the project then we can
work around it on our side, but it seems to me these details should be
contained in Clang.


On Tue, Dec 10, 2013 at 2:21 PM, Rafael Espíndola <
rafael.espindola at gmail.com> wrote:

> On 10 December 2013 09:16, João Matos <ripzonetriton at gmail.com> wrote:
> > For the current project I'm working on (https://github.com/mono/CppSharp
> )
> > having the flags to change the ABI based on a GCC version would be
> ideal. If
> > there are no flags, this means we must implement some logic to change the
> > calling conventions of methods manually to how they were pre-4.7. Should
> not
> > be a lot of work but it'd be best to contain all the C++ ABI details
> inside
> > Clang itself.
>
> Because you must link with gcc 4.6 compiled libraries for now or is
> that a permanent thing?
>
> Cheers,
> Rafael
>



-- 
João Matos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131210/833f5674/attachment.html>


More information about the llvm-dev mailing list