[cfe-dev] clang, g++, icc link compatibity?

Smith, Kevin B kevin.b.smith at intel.com
Mon May 11 13:00:49 PDT 2015


ICC/ICPC uses whatever STL includes and headers are installed on the linux machine.  ICC/ICPC is expected to be completely
compatible with the gcc installed on the linux machine as well.  It checks for the version of gcc in the user’s path and tailors its
compatibility to that specific version of gcc.

And AFAIK clang/llvm tries to be compatible to the same ABI as well, so the basics should be that all three are expected to be ABI
compatible with each other.

As others have said though, there are lots of possibilities for subtle issues.

Kevin B. Smith
Intel Compiler Architect

From: cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu] On Behalf Of David Blaikie
Sent: Monday, May 11, 2015 12:20 PM
To: C Bergström
Cc: cfe-dev Developers
Subject: Re: [cfe-dev] clang, g++, icc link compatibity?



On Mon, May 11, 2015 at 12:08 PM, C Bergström <cbergstrom at pathscale.com<mailto:cbergstrom at pathscale.com>> wrote:
On Tue, May 12, 2015 at 1:52 AM, Christian Convey
<christian.convey at gmail.com<mailto:christian.convey at gmail.com>> wrote:
> Thanks David.  So it sounds like you're saying that all the previously messy
> stuff like vtable layouts, exception handling, etc. are non-issues for
> current versions of those three compilers.  Is that right?

David's reply is very very misleading -

You're not only dealing with potential incompatibilities at the ABI
level. There is also the STL that can play a role.

Sure enough, thanks for the clarification.

Is clang using the system STL or libc++? (I think libc++ does play
nice with GNU STL in some circumstances, but not all afaik)

Clang is designed to find the same STL as any locally installed GCC (obviously if you use some non-default GCC (if you have multiple versions installed, etc) or force the use of libc++ that'll get more interesting).

If all 3 compilers are on the same page with the ABI, using the same
EH, the same STL and same runtime - yes in theory, barring things I
can't think right now - it should work.

So double check which runtime/STL ICC is relying on.

*nod*


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150511/31fbe874/attachment.html>


More information about the cfe-dev mailing list