[cfe-dev] RFC: __atomic_* support for gcc 4.7 compatibility

Chandler Carruth chandlerc at google.com
Tue Apr 10 16:14:09 PDT 2012


To comment first on your high level questions, because I think it's
important to quickly get some consensus here.

On Tue, Apr 10, 2012 at 11:57 PM, Howard Hinnant <hhinnant at apple.com> wrote:

> It looks like we have a couple of questions:
>
> 1.  Does clang support libstdc++ <atomic>?
>
> 2.  Does libc++ <atomic> support gcc?
>
> I have no opinion on 1.  I will leave that to the clang developers.
>

For us, this is a simple necessity. We cannot use Clang without also using
libstdc++ at least for the time being. I don't claim that this is a perfect
state of the world, but it is a strongly desirable one.

One perhaps important point -- the libstdc++ developers have thus far been
perfectly receptive of C++ conformance patches only required for Clang.
While it seems hopeless to get them to not support GCC builtins, they are
meeting us part of the way there.

Also note that we have a long history in Clang of supporting GCC builtins
to ease migration. I see the atomics in a very similar light.


> On 2, I have no motivation to support gcc.  gcc has its own std::lib
> solution and the GPL is not compatible with libc++ licensing.  However if
> there are members of this community that wish to support gcc (and wish to
> do the work to make it so), and if there is zero run time and code size
> overhead, and if the compile time overhead is negligible, I have no
> objection.  I will cringe at the ugliness it will introduce to the source,
> but I can live with that.
>

I would like to suggest that we aim for this as well. Certainly for us, it
helps to have both standard libraries and compilers be cross-tested with
each other. This makes evaluating them independently and supporting them in
different contexts easier and more predictable.

I generally think that as the less-adopted system, it would benefit libc++
(similarly to the way it benefits Clang) to be as compatible as it is
reasonable to be.

That said, I do firmly agree with your restrictions: it should never make
using libc++ with Clang *worse* only to get support for GCC. Users should
not pay for what they do not need.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120411/b2233539/attachment.html>


More information about the cfe-dev mailing list