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

Douglas Gregor dgregor at apple.com
Wed Apr 11 07:52:01 PDT 2012

On Apr 10, 2012, at 4:14 PM, Chandler Carruth <chandlerc at google.com> wrote:

> 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.

I completely agree with this. Clang absolutely must support libstdc++, especially because libstdc++ is the dominant C++ Standard Library on a number of important platforms. 

> 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.

I don't feel as strongly about #2, but so long as it isn't overly painful for libc++ to support building with GCC, I think it is a good goal.

	- Doug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120411/4cf16ccc/attachment.html>

More information about the cfe-dev mailing list