#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_
| Bugzilla Link | 11174 |
| Resolution | FIXED |
| Resolved on | Nov 05, 2015 13:43 |
| Version | unspecified |
| OS | All |
| Blocks | llvm/llvm-bugzilla-archive#24345 |
| Reporter | LLVM Bugzilla Contributor |
| CC | @Bigcheese,@weiguozhi,@echristo,@efriedma-quic,@rprichard |
mentioned in issue llvm/llvm-bugzilla-archive#24345
Fixed in r178816 for x86.
Patch: http://llvm-reviews.chandlerc.com/D621
I met the same problem when building glib. Since lack of __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4, it caused the glib configuration failed.
Also see http://llvm.org/bugs/show_bug.cgi?id=12730.
This is actually an ABI issue, and should be raised in priority. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42734
GCC rather helpfully defines these macros when it is capable of supporting atomic intrinsics for a particular word size. For example:
- on -march=i386 atomics are not supported
- on -march=i486 atomics are supported only for word sizes up to 4
- on -march=i586 and higher it's supported for 8 as well
clang doesn't define these macros and doesn't seem to define anything equivalent either. That prevents having an #ifdef around code that might either use these operations or elect to implement them with a mutex.