[cfe-users] Migrating to clang from GCC

David Blaikie dblaikie at gmail.com
Fri Jul 24 08:19:22 PDT 2015

This thread seems to have gone in a strange direction - using clang does
not imply or require using libc++.

To answer your original question: this is essentially fine/correct modulo
bugs and version incompatibilities (the two compilers don't necessarily
line up perfectly with respect to feature, bug, etc implementation at all

You can compile parts of your c++ program (including using c++ standard
library types on that interface boundary) with clang and parts with gcc
(both using the same standard library) and they should link and run
correctly together.

(If you're curious about the nitty gritty of why this works, its related to
a thing called the ABI, and specifically the itanium ABI)
On Jul 24, 2015 12:40 AM, "Ankit Garg" <Ankit_Garg at mentor.com> wrote:

> Hi All,
>          I am not sure whether its the right forum to ask this question.
> I am trying to move to clang compiler from GCC, but our software has tons
> of components independently developed provding different static archive
> libraries. All these libraries are finally linked into executable.  Now
> rather than compiling every component with clang from scratch, I was
> thinking to pick one component at time to compile with clang and use GCC
> compiled static archives for other components to link into executable using
> clang compiler.  Would this always work ?
> So my question is whether GCC compiled object/archives involving C/C++
> code would always be compatible with clang generated object files and can
> be mixed together during link step using clang compiler.  Would this always
> work if I can make sure that our libraries are not using any features of
> C++11 .
> Regards
> Ankit
> _______________________________________________
> cfe-users mailing list
> cfe-users at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20150724/7e01ea51/attachment.html>

More information about the cfe-users mailing list