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>
On 10 December 2013 11:18, João Matos <ripzonetriton at gmail.com> wrote:> 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)Do you have an idea for how long you will have to support these distros? This change would only show up on clang 3.5, and it is not even expected to build with gcc 4.6> 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 the clang side the change should be trivial (note the attached clang.patch on first email). Do you think that is something you can keep locally if needed? If we can avoid creating new ABI options I think that is desirable. Cheers, Rafael
> > On the clang side the change should be trivial (note the attached > clang.patch on first email). Do you think that is something you can > keep locally if needed? > > If we can avoid creating new ABI options I think that is desirable. >I can work around it locally, let's keep it simple on the Clang side. -- João Matos -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131211/0e84057a/attachment.html>
Possibly Parallel Threads
- [LLVMdev] Switching to the new MingW ABI
- [LLVMdev] Switching to the new MingW ABI
- [LLVMdev] Switching to the new MingW ABI
- [LLVMdev] x86_stdcallcc @<n> mangling vs. '\1' prefix [was: x86_stdcallcc and extra name mangling on Windows]
- [LLVMdev] x86_stdcallcc @<n> mangling vs. '\1' prefix [was: x86_stdcallcc and extra name mangling on Windows]