Re: [PATCH] D23719: [libc++] Use C11 for atomics check

2016-08-22 Thread Shoaib Meenai via cfe-commits
smeenai abandoned this revision. smeenai added a comment. Will create a different change with the other config change, since it's completely different conceptually. https://reviews.llvm.org/D23719 ___ cfe-commits mailing list cfe-commits@lists.llvm

Re: [PATCH] D23719: [libc++] Use C11 for atomics check

2016-08-19 Thread Shoaib Meenai via cfe-commits
smeenai added a comment. In https://reviews.llvm.org/D23719#521250, @rsmith wrote: > Is there a -nodefaultlib analogue of -nostdinc++ to turn off just the C++ > standard library portion of the link? There's `-nostdlib`, but if I'm parsing the GCC documentation

Re: [PATCH] D23719: [libc++] Use C11 for atomics check

2016-08-19 Thread Richard Smith via cfe-commits
rsmith added a comment. In https://reviews.llvm.org/D23719#521233, @smeenai wrote: > I'm thinking the best way to accomplish this is to globally add > `-nodefaultlib` to `CMAKE_REQUIRED_FLAGS`, and then globally set > `CMAKE_REQUIRED_LIBRARIES` to the required set of libraries, similar to what

Re: [PATCH] D23719: [libc++] Use C11 for atomics check

2016-08-19 Thread Shoaib Meenai via cfe-commits
smeenai planned changes to this revision. smeenai added a comment. @rsmith: I think your points are valid, and I should have been more explicit with the motivation :) The issue is with linking, not with compiling. When we call `check_cxx_source_compiles`, the compiler driver passes all the stan

Re: [PATCH] D23719: [libc++] Use C11 for atomics check

2016-08-19 Thread Richard Smith via cfe-commits
rsmith added a comment. I have to admit to not understanding the motivation for this change. It claims that this is removing a reliance on having an existing C++ standard library, but it doesn't appear to affect that: this test explicitly passes `-nostdinc++` to avoid using a system standard li

Re: [PATCH] D23719: [libc++] Use C11 for atomics check

2016-08-19 Thread Ben Craig via cfe-commits
bcraig added a comment. In https://reviews.llvm.org/D23719#520969, @rsmith wrote: > In https://reviews.llvm.org/D23719#520954, @bcraig wrote: > > > In https://reviews.llvm.org/D23719#520952, @rsmith wrote: > > > > > Are we really guaranteed that the C and C++ compiler behave the same way > > > h

Re: [PATCH] D23719: [libc++] Use C11 for atomics check

2016-08-19 Thread Richard Smith via cfe-commits
rsmith added a comment. In https://reviews.llvm.org/D23719#520954, @bcraig wrote: > In https://reviews.llvm.org/D23719#520952, @rsmith wrote: > > > Are we really guaranteed that the C and C++ compiler behave the same way > > here? I don't see why that would necessarily be the case. > > > For lib

Re: [PATCH] D23719: [libc++] Use C11 for atomics check

2016-08-19 Thread Ben Craig via cfe-commits
bcraig added a comment. In https://reviews.llvm.org/D23719#520953, @smeenai wrote: > @bcraig: `__STDC_NO_ATOMICS__` wouldn't be defined for pre-C11 compilers > either, right? > > From what I understand of the original code sample, one of the purposes was > to check for 64-bit atomic support on

Re: [PATCH] D23719: [libc++] Use C11 for atomics check

2016-08-19 Thread Ben Craig via cfe-commits
bcraig added a comment. In https://reviews.llvm.org/D23719#520952, @rsmith wrote: > Are we really guaranteed that the C and C++ compiler behave the same way > here? I don't see why that would necessarily be the case. For libc++, std::atomic is implemented in terms of _Atomic. So as long as th

Re: [PATCH] D23719: [libc++] Use C11 for atomics check

2016-08-19 Thread Shoaib Meenai via cfe-commits
smeenai added a comment. @bcraig: `__STDC_NO_ATOMICS__` wouldn't be defined for pre-C11 compilers either, right? From what I understand of the original code sample, one of the purposes was to check for 64-bit atomic support on 32-bit systems (hence the use of `uintmax_t` and the check for `__a

Re: [PATCH] D23719: [libc++] Use C11 for atomics check

2016-08-19 Thread Richard Smith via cfe-commits
rsmith added a subscriber: rsmith. rsmith added a comment. Are we really guaranteed that the C and C++ compiler behave the same way here? I don't see why that would necessarily be the case. https://reviews.llvm.org/D23719 ___ cfe-commits mailing li

Re: [PATCH] D23719: [libc++] Use C11 for atomics check

2016-08-19 Thread Ben Craig via cfe-commits
bcraig added a subscriber: bcraig. bcraig added a comment. I like the rationale here, but can we avoid pulling in headers at all? You could test _ _STDC_NO_ATOMICS_ _. You could also have some code like this... _Atomic int x; int main() { x += 1; return x; } https://reviews.llvm