<div dir="ltr"><span style="color:rgb(0,0,0)">Thanks a lot, Ken. Yes, I understand that, but I believe there was some ABI incompatibility introduced with GCC 5, wasn't it? If I recall correctly, it wasn't just a matter of what C++ standard library you choose, but that even if you chose the same, GCC 5 still broke the ABI compatibility. At the time the rumors said that the reason was an attempt to break compatibility with LLVM because GCC saw it like a competitor, but that was just a rumor.</span><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">Kind regards and thanks a lot,</div><div style="color:rgb(0,0,0)"><br></div><div style="color:rgb(0,0,0)">César</div><div style="color:rgb(0,0,0)"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 19, 2020 at 5:08 PM Kenneth F. Cunningham <<a href="mailto:ken.cunningham.webuse@gmail.com">ken.cunningham.webuse@gmail.com</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">> Hi!<br>
> <br>
> I remember a few years ago when a change in GCC 5 caused ABI<br>
> incompatibility with clang. I'm searching for updates on this, and it seems<br>
> like clang applied the same change eventually, but can they considered<br>
> binary compatible at this moment? Is it now safe to link object code coming<br>
> from GCC and from clang?<br>
> <br>
> Thanks!<br>
> <br>
> César<br>
<br>
The issue is not so much with the compiler as with the c++ standard library.<br>
<br>
Any compiler can use any c++ standard library.<br>
<br>
But *by default* (1) clang will use libc++ and gcc will use libstdc++, and these are not compatible with each other.<br>
<br>
So if you are going to mix objects (and libraries) coming out of clang and gcc, you have to be sure that they all use the same c++ standard library. <br>
<br>
With c++ code, that is quite tricky to do properly.<br>
<br>
If you use gcc just to build "c" code, or fortran code, there is no problem mixing those libraries or objects with clang c++ code.<br>
<br>
Ken<br>
<br>
<br>
<br>
<br>
1. By default, on current MacOS and on all MacOS on MacPorts. Further needless and sometimes confusing detail omitted for clarity of focus, ask if truly curious. -K</blockquote></div>